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 |
|---|---|---|---|---|---|---|---|---|---|---|
junit-team/junit4 | src/main/java/org/junit/runner/Computer.java | Computer.getRunner | protected Runner getRunner(RunnerBuilder builder, Class<?> testClass) throws Throwable {
"""
Create a single-class runner for {@code testClass}, using {@code builder}
"""
return builder.runnerForClass(testClass);
} | java | protected Runner getRunner(RunnerBuilder builder, Class<?> testClass) throws Throwable {
return builder.runnerForClass(testClass);
} | [
"protected",
"Runner",
"getRunner",
"(",
"RunnerBuilder",
"builder",
",",
"Class",
"<",
"?",
">",
"testClass",
")",
"throws",
"Throwable",
"{",
"return",
"builder",
".",
"runnerForClass",
"(",
"testClass",
")",
";",
"}"
] | Create a single-class runner for {@code testClass}, using {@code builder} | [
"Create",
"a",
"single",
"-",
"class",
"runner",
"for",
"{"
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runner/Computer.java#L49-L51 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java | DataFrameJoiner.rightOuter | public Table rightOuter(Table table2, String[] col2Names) {
"""
Joins the joiner to the table2, using the given columns for the second table and returns the resulting table
@param table2 The table to join with
@param col2Names The columns to join on. If a name refers to a double column, the join is performe... | java | public Table rightOuter(Table table2, String[] col2Names) {
return rightOuter(table2, false, col2Names);
} | [
"public",
"Table",
"rightOuter",
"(",
"Table",
"table2",
",",
"String",
"[",
"]",
"col2Names",
")",
"{",
"return",
"rightOuter",
"(",
"table2",
",",
"false",
",",
"col2Names",
")",
";",
"}"
] | Joins the joiner to the table2, using the given columns for the second table and returns the resulting table
@param table2 The table to join with
@param col2Names The columns to join on. If a name refers to a double column, the join is performed after
rounding to integers.
@return The resulting table | [
"Joins",
"the",
"joiner",
"to",
"the",
"table2",
"using",
"the",
"given",
"columns",
"for",
"the",
"second",
"table",
"and",
"returns",
"the",
"resulting",
"table"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L590-L592 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketUtil.java | WebSocketUtil.randomNumber | static int randomNumber(int minimum, int maximum) {
"""
Generates a pseudo-random number
@param minimum The minimum allowable value
@param maximum The maximum allowable value
@return A pseudo-random number
"""
assert minimum < maximum;
double fraction = PlatformDependent.threadLocalRandom(... | java | static int randomNumber(int minimum, int maximum) {
assert minimum < maximum;
double fraction = PlatformDependent.threadLocalRandom().nextDouble();
// the idea here is that nextDouble gives us a random value
//
// 0 <= fraction <= 1
//
// the distanc... | [
"static",
"int",
"randomNumber",
"(",
"int",
"minimum",
",",
"int",
"maximum",
")",
"{",
"assert",
"minimum",
"<",
"maximum",
";",
"double",
"fraction",
"=",
"PlatformDependent",
".",
"threadLocalRandom",
"(",
")",
".",
"nextDouble",
"(",
")",
";",
"// the i... | Generates a pseudo-random number
@param minimum The minimum allowable value
@param maximum The maximum allowable value
@return A pseudo-random number | [
"Generates",
"a",
"pseudo",
"-",
"random",
"number"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketUtil.java#L120-L144 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.isValidTimeout | public boolean isValidTimeout(AllocationID allocationId, UUID ticket) {
"""
Check whether the timeout with ticket is valid for the given allocation id.
@param allocationId to check against
@param ticket of the timeout
@return True if the timeout is valid; otherwise false
"""
checkInit();
return timer... | java | public boolean isValidTimeout(AllocationID allocationId, UUID ticket) {
checkInit();
return timerService.isValid(allocationId, ticket);
} | [
"public",
"boolean",
"isValidTimeout",
"(",
"AllocationID",
"allocationId",
",",
"UUID",
"ticket",
")",
"{",
"checkInit",
"(",
")",
";",
"return",
"timerService",
".",
"isValid",
"(",
"allocationId",
",",
"ticket",
")",
";",
"}"
] | Check whether the timeout with ticket is valid for the given allocation id.
@param allocationId to check against
@param ticket of the timeout
@return True if the timeout is valid; otherwise false | [
"Check",
"whether",
"the",
"timeout",
"with",
"ticket",
"is",
"valid",
"for",
"the",
"given",
"allocation",
"id",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L361-L365 |
meertensinstituut/mtas | src/main/java/mtas/codec/util/CodecCollector.java | CodecCollector.computeTermvectorNumberBasic | private static TermvectorNumberBasic computeTermvectorNumberBasic(
List<Integer> docSet, int termDocId, TermsEnum termsEnum, LeafReader r,
LeafReaderContext lrc, PostingsEnum postingsEnum) throws IOException {
"""
Compute termvector number basic.
@param docSet
the doc set
@param termDocId
the ter... | java | private static TermvectorNumberBasic computeTermvectorNumberBasic(
List<Integer> docSet, int termDocId, TermsEnum termsEnum, LeafReader r,
LeafReaderContext lrc, PostingsEnum postingsEnum) throws IOException {
TermvectorNumberBasic result = new TermvectorNumberBasic();
boolean hasDeletedDocuments = ... | [
"private",
"static",
"TermvectorNumberBasic",
"computeTermvectorNumberBasic",
"(",
"List",
"<",
"Integer",
">",
"docSet",
",",
"int",
"termDocId",
",",
"TermsEnum",
"termsEnum",
",",
"LeafReader",
"r",
",",
"LeafReaderContext",
"lrc",
",",
"PostingsEnum",
"postingsEnu... | Compute termvector number basic.
@param docSet
the doc set
@param termDocId
the term doc id
@param termsEnum
the terms enum
@param r
the r
@param lrc
the lrc
@param postingsEnum
the postings enum
@return the termvector number basic
@throws IOException
Signals that an I/O exception has occurred. | [
"Compute",
"termvector",
"number",
"basic",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/util/CodecCollector.java#L4163-L4194 |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/BeanHelperCache.java | BeanHelperCache.createHelper | BeanHelper createHelper(final JClassType pjtype, final TreeLogger plogger,
final GeneratorContext pcontext) throws UnableToCompleteException {
"""
Creates a BeanHelper and writes an interface containing its instance. Also, recursively creates
any BeanHelpers on its constrained properties.
"""
final ... | java | BeanHelper createHelper(final JClassType pjtype, final TreeLogger plogger,
final GeneratorContext pcontext) throws UnableToCompleteException {
final JClassType erasedType = pjtype.getErasedType();
try {
final Class<?> clazz = Class.forName(erasedType.getQualifiedBinaryName());
return doCreateH... | [
"BeanHelper",
"createHelper",
"(",
"final",
"JClassType",
"pjtype",
",",
"final",
"TreeLogger",
"plogger",
",",
"final",
"GeneratorContext",
"pcontext",
")",
"throws",
"UnableToCompleteException",
"{",
"final",
"JClassType",
"erasedType",
"=",
"pjtype",
".",
"getErase... | Creates a BeanHelper and writes an interface containing its instance. Also, recursively creates
any BeanHelpers on its constrained properties. | [
"Creates",
"a",
"BeanHelper",
"and",
"writes",
"an",
"interface",
"containing",
"its",
"instance",
".",
"Also",
"recursively",
"creates",
"any",
"BeanHelpers",
"on",
"its",
"constrained",
"properties",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/BeanHelperCache.java#L84-L94 |
OpenLiberty/open-liberty | dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ConfigurationStore.java | ConfigurationStore.deserializeConfigurationData | ExtendedConfigurationImpl deserializeConfigurationData(String pid) throws IOException {
"""
If a serialized file does not exist, a null is returned.
If a serialized file exists for the given pid, it deserializes
configuration dictionary
and bound location and returns in an array of size 2.
Index 0 of returning... | java | ExtendedConfigurationImpl deserializeConfigurationData(String pid) throws IOException {
ExtendedConfigurationImpl config = null;
File configFile = persistedConfig.getConfigFile(pid);
if (configFile != null) {
if (configFile.length() > 0) {
FileInputStream fis = null... | [
"ExtendedConfigurationImpl",
"deserializeConfigurationData",
"(",
"String",
"pid",
")",
"throws",
"IOException",
"{",
"ExtendedConfigurationImpl",
"config",
"=",
"null",
";",
"File",
"configFile",
"=",
"persistedConfig",
".",
"getConfigFile",
"(",
"pid",
")",
";",
"if... | If a serialized file does not exist, a null is returned.
If a serialized file exists for the given pid, it deserializes
configuration dictionary
and bound location and returns in an array of size 2.
Index 0 of returning array contains configuration dictionary.
Index 1 of returning array contains bound bundle location i... | [
"If",
"a",
"serialized",
"file",
"does",
"not",
"exist",
"a",
"null",
"is",
"returned",
".",
"If",
"a",
"serialized",
"file",
"exists",
"for",
"the",
"given",
"pid",
"it",
"deserializes",
"configuration",
"dictionary",
"and",
"bound",
"location",
"and",
"ret... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ConfigurationStore.java#L230-L270 |
netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java | EpollSocketChannelConfig.setTcpMd5Sig | public EpollSocketChannelConfig setTcpMd5Sig(Map<InetAddress, byte[]> keys) {
"""
Set the {@code TCP_MD5SIG} option on the socket. See {@code linux/tcp.h} for more details.
Keys can only be set on, not read to prevent a potential leak, as they are confidential.
Allowing them being read would mean anyone with acc... | java | public EpollSocketChannelConfig setTcpMd5Sig(Map<InetAddress, byte[]> keys) {
try {
((EpollSocketChannel) channel).setTcpMd5Sig(keys);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
} | [
"public",
"EpollSocketChannelConfig",
"setTcpMd5Sig",
"(",
"Map",
"<",
"InetAddress",
",",
"byte",
"[",
"]",
">",
"keys",
")",
"{",
"try",
"{",
"(",
"(",
"EpollSocketChannel",
")",
"channel",
")",
".",
"setTcpMd5Sig",
"(",
"keys",
")",
";",
"return",
"this... | Set the {@code TCP_MD5SIG} option on the socket. See {@code linux/tcp.h} for more details.
Keys can only be set on, not read to prevent a potential leak, as they are confidential.
Allowing them being read would mean anyone with access to the channel could get them. | [
"Set",
"the",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java#L518-L525 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getRegexEntityInfos | public List<RegexEntityExtractor> getRegexEntityInfos(UUID appId, String versionId, GetRegexEntityInfosOptionalParameter getRegexEntityInfosOptionalParameter) {
"""
Gets information about the regex entity models.
@param appId The application ID.
@param versionId The version ID.
@param getRegexEntityInfosOptio... | java | public List<RegexEntityExtractor> getRegexEntityInfos(UUID appId, String versionId, GetRegexEntityInfosOptionalParameter getRegexEntityInfosOptionalParameter) {
return getRegexEntityInfosWithServiceResponseAsync(appId, versionId, getRegexEntityInfosOptionalParameter).toBlocking().single().body();
} | [
"public",
"List",
"<",
"RegexEntityExtractor",
">",
"getRegexEntityInfos",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"GetRegexEntityInfosOptionalParameter",
"getRegexEntityInfosOptionalParameter",
")",
"{",
"return",
"getRegexEntityInfosWithServiceResponseAsync",
"... | Gets information about the regex entity models.
@param appId The application ID.
@param versionId The version ID.
@param getRegexEntityInfosOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@thro... | [
"Gets",
"information",
"about",
"the",
"regex",
"entity",
"models",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7120-L7122 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CfInterfaceCodeGen.java | CfInterfaceCodeGen.writeConnection | private void writeConnection(Definition def, Writer out, int indent) throws IOException {
"""
Output Connection method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, inde... | java | private void writeConnection(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, indent, " * Get connection from factory\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent,
" * @return " + de... | [
"private",
"void",
"writeConnection",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/** \\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"in... | Output Connection method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"Connection",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CfInterfaceCodeGen.java#L91-L103 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/GenericAuditEventMessageImpl.java | GenericAuditEventMessageImpl.setAuditSourceId | public void setAuditSourceId(String sourceId, String enterpriseSiteId, RFC3881AuditSourceTypeCodes[] typeCodes) {
"""
Sets a Audit Source Identification block for a given Audit Source ID,
Audit Source Enterprise Site ID, and a list of audit source type codes
@param sourceId The Audit Source ID to use
@param ent... | java | public void setAuditSourceId(String sourceId, String enterpriseSiteId, RFC3881AuditSourceTypeCodes[] typeCodes)
{
addAuditSourceIdentification(sourceId, enterpriseSiteId, typeCodes);
} | [
"public",
"void",
"setAuditSourceId",
"(",
"String",
"sourceId",
",",
"String",
"enterpriseSiteId",
",",
"RFC3881AuditSourceTypeCodes",
"[",
"]",
"typeCodes",
")",
"{",
"addAuditSourceIdentification",
"(",
"sourceId",
",",
"enterpriseSiteId",
",",
"typeCodes",
")",
";... | Sets a Audit Source Identification block for a given Audit Source ID,
Audit Source Enterprise Site ID, and a list of audit source type codes
@param sourceId The Audit Source ID to use
@param enterpriseSiteId The Audit Enterprise Site ID to use
@param typeCodes The RFC 3881 Audit Source Type codes to use
@deprecated us... | [
"Sets",
"a",
"Audit",
"Source",
"Identification",
"block",
"for",
"a",
"given",
"Audit",
"Source",
"ID",
"Audit",
"Source",
"Enterprise",
"Site",
"ID",
"and",
"a",
"list",
"of",
"audit",
"source",
"type",
"codes",
"@param",
"sourceId",
"The",
"Audit",
"Sourc... | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/GenericAuditEventMessageImpl.java#L91-L94 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.isInstanceOf | @GwtIncompatible("incompatible method")
public static void isInstanceOf(final Class<?> type, final Object obj) {
"""
Validates that the argument is an instance of the specified class, if not throws an exception.
<p>This method is useful when validating according to an arbitrary class</p>
<pre>Validate.is... | java | @GwtIncompatible("incompatible method")
public static void isInstanceOf(final Class<?> type, final Object obj) {
// TODO when breaking BC, consider returning obj
if (!type.isInstance(obj)) {
throw new IllegalArgumentException(StringUtils.simpleFormat(DEFAULT_IS_INSTANCE_OF_EX_MESSAGE, ty... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"void",
"isInstanceOf",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Object",
"obj",
")",
"{",
"// TODO when breaking BC, consider returning obj",
"if",
"(",
"!",
"typ... | Validates that the argument is an instance of the specified class, if not throws an exception.
<p>This method is useful when validating according to an arbitrary class</p>
<pre>Validate.isInstanceOf(OkClass.class, object);</pre>
<p>The message of the exception is "Expected type: {type}, actual: {obj_type}"... | [
"Validates",
"that",
"the",
"argument",
"is",
"an",
"instance",
"of",
"the",
"specified",
"class",
"if",
"not",
"throws",
"an",
"exception",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L1266-L1273 |
javabits/yar | yar-api/src/main/java/org/javabits/yar/TimeoutException.java | TimeoutException.getTimeoutMessage | public static String getTimeoutMessage(long timeout, TimeUnit unit) {
"""
Utility method that produce the message of the timeout.
@param timeout the maximum time to wait.
@param unit the time unit of the timeout argument
@return formatted string that contains the timeout information.
"""
return S... | java | public static String getTimeoutMessage(long timeout, TimeUnit unit) {
return String.format("Timeout of %d %s reached", timeout, requireNonNull(unit, "unit"));
} | [
"public",
"static",
"String",
"getTimeoutMessage",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"Timeout of %d %s reached\"",
",",
"timeout",
",",
"requireNonNull",
"(",
"unit",
",",
"\"unit\"",
")",
")",
... | Utility method that produce the message of the timeout.
@param timeout the maximum time to wait.
@param unit the time unit of the timeout argument
@return formatted string that contains the timeout information. | [
"Utility",
"method",
"that",
"produce",
"the",
"message",
"of",
"the",
"timeout",
"."
] | train | https://github.com/javabits/yar/blob/e146a86611ca4831e8334c9a98fd7086cee9c03e/yar-api/src/main/java/org/javabits/yar/TimeoutException.java#L91-L93 |
igniterealtime/Smack | smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/util/OpenPgpPubSubUtil.java | OpenPgpPubSubUtil.fetchPubkeysList | public static PublicKeysListElement fetchPubkeysList(XMPPConnection connection, BareJid contact)
throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException,
PubSubException.NotALeafNodeException, SmackException.NotConnectedException, PubSubException.NotAPub... | java | public static PublicKeysListElement fetchPubkeysList(XMPPConnection connection, BareJid contact)
throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException,
PubSubException.NotALeafNodeException, SmackException.NotConnectedException, PubSubException.NotAPub... | [
"public",
"static",
"PublicKeysListElement",
"fetchPubkeysList",
"(",
"XMPPConnection",
"connection",
",",
"BareJid",
"contact",
")",
"throws",
"InterruptedException",
",",
"XMPPException",
".",
"XMPPErrorException",
",",
"SmackException",
".",
"NoResponseException",
",",
... | Consult the public key metadata node of {@code contact} to fetch the list of their published OpenPGP public keys.
@see <a href="https://xmpp.org/extensions/xep-0373.html#discover-pubkey-list">
XEP-0373 §4.3: Discovering Public Keys of a User</a>
@param connection XMPP connection
@param contact {@link BareJid} of the ... | [
"Consult",
"the",
"public",
"key",
"metadata",
"node",
"of",
"{",
"@code",
"contact",
"}",
"to",
"fetch",
"the",
"list",
"of",
"their",
"published",
"OpenPGP",
"public",
"keys",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/util/OpenPgpPubSubUtil.java#L204-L217 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.createCertificate | public X509Certificate createCertificate(InputStream certRequestInputStream, X509Certificate cert,
PrivateKey privateKey, int lifetime, GSIConstants.CertificateType certType) throws IOException,
GeneralSecurityException {
"""
Creates a proxy certificate from the certificate request.
@see #create... | java | public X509Certificate createCertificate(InputStream certRequestInputStream, X509Certificate cert,
PrivateKey privateKey, int lifetime, GSIConstants.CertificateType certType) throws IOException,
GeneralSecurityException {
return createCertificate(certRequestInputStream, cert, privateKey, lifetim... | [
"public",
"X509Certificate",
"createCertificate",
"(",
"InputStream",
"certRequestInputStream",
",",
"X509Certificate",
"cert",
",",
"PrivateKey",
"privateKey",
",",
"int",
"lifetime",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"IOException",
... | Creates a proxy certificate from the certificate request.
@see #createCertificate(InputStream, X509Certificate, PrivateKey, int, int, X509ExtensionSet, String)
createCertificate | [
"Creates",
"a",
"proxy",
"certificate",
"from",
"the",
"certificate",
"request",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L519-L524 |
azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java | ProjectManagerServlet.lockFlowsForProject | private void lockFlowsForProject(Project project, List<String> lockedFlows) {
"""
Lock the specified flows for the project.
@param project the project
@param lockedFlows list of flow IDs of flows to lock
"""
for (String flowId: lockedFlows) {
Flow flow = project.getFlow(flowId);
if (flow !=... | java | private void lockFlowsForProject(Project project, List<String> lockedFlows) {
for (String flowId: lockedFlows) {
Flow flow = project.getFlow(flowId);
if (flow != null) {
flow.setLocked(true);
}
}
} | [
"private",
"void",
"lockFlowsForProject",
"(",
"Project",
"project",
",",
"List",
"<",
"String",
">",
"lockedFlows",
")",
"{",
"for",
"(",
"String",
"flowId",
":",
"lockedFlows",
")",
"{",
"Flow",
"flow",
"=",
"project",
".",
"getFlow",
"(",
"flowId",
")",... | Lock the specified flows for the project.
@param project the project
@param lockedFlows list of flow IDs of flows to lock | [
"Lock",
"the",
"specified",
"flows",
"for",
"the",
"project",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/ProjectManagerServlet.java#L1925-L1932 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/MagickUtil.java | MagickUtil.createIndexColorModel | public static IndexColorModel createIndexColorModel(PixelPacket[] pColormap, boolean pAlpha) {
"""
Creates an {@code IndexColorModel} from an array of
{@code PixelPacket}s.
@param pColormap the original colormap as a {@code PixelPacket} array
@param pAlpha keep alpha channel
@return a new {@code IndexColor... | java | public static IndexColorModel createIndexColorModel(PixelPacket[] pColormap, boolean pAlpha) {
int[] colors = new int[pColormap.length];
// TODO: Verify if this is correct for alpha...?
int trans = pAlpha ? colors.length - 1 : -1;
//for (int i = 0; i < pColormap.length; i++) {
... | [
"public",
"static",
"IndexColorModel",
"createIndexColorModel",
"(",
"PixelPacket",
"[",
"]",
"pColormap",
",",
"boolean",
"pAlpha",
")",
"{",
"int",
"[",
"]",
"colors",
"=",
"new",
"int",
"[",
"pColormap",
".",
"length",
"]",
";",
"// TODO: Verify if this is co... | Creates an {@code IndexColorModel} from an array of
{@code PixelPacket}s.
@param pColormap the original colormap as a {@code PixelPacket} array
@param pAlpha keep alpha channel
@return a new {@code IndexColorModel} | [
"Creates",
"an",
"{",
"@code",
"IndexColorModel",
"}",
"from",
"an",
"array",
"of",
"{",
"@code",
"PixelPacket",
"}",
"s",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/MagickUtil.java#L499-L522 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/style/marker/PrettyMarkers.java | PrettyMarkers.plotGray | protected void plotGray(SVGPlot plot, Element parent, double x, double y, double size) {
"""
Plot a replacement marker when an object is to be plotted as "disabled",
usually gray.
@param plot Plot to draw to
@param parent Parent element
@param x X position
@param y Y position
@param size Size
"""
E... | java | protected void plotGray(SVGPlot plot, Element parent, double x, double y, double size) {
Element marker = plot.svgCircle(x, y, size * .5);
SVGUtil.setStyle(marker, SVGConstants.CSS_FILL_PROPERTY + ":" + greycolor);
parent.appendChild(marker);
} | [
"protected",
"void",
"plotGray",
"(",
"SVGPlot",
"plot",
",",
"Element",
"parent",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"size",
")",
"{",
"Element",
"marker",
"=",
"plot",
".",
"svgCircle",
"(",
"x",
",",
"y",
",",
"size",
"*",
".5"... | Plot a replacement marker when an object is to be plotted as "disabled",
usually gray.
@param plot Plot to draw to
@param parent Parent element
@param x X position
@param y Y position
@param size Size | [
"Plot",
"a",
"replacement",
"marker",
"when",
"an",
"object",
"is",
"to",
"be",
"plotted",
"as",
"disabled",
"usually",
"gray",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/style/marker/PrettyMarkers.java#L251-L255 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java | WindowsProcessFaxClientSpi.addCommandLineArgument | protected void addCommandLineArgument(StringBuilder buffer,String argument,String value) {
"""
This function adds the given command line argument to the buffer.
@param buffer
The buffer
@param argument
The argument
@param value
The argument value
"""
if((value!=null)&&(value.length()>0))
... | java | protected void addCommandLineArgument(StringBuilder buffer,String argument,String value)
{
if((value!=null)&&(value.length()>0))
{
buffer.append(argument);
buffer.append(Fax4jExeConstants.SPACE_STR);
buffer.append(Fax4jExeConstants.VALUE_WRAPPER);
buff... | [
"protected",
"void",
"addCommandLineArgument",
"(",
"StringBuilder",
"buffer",
",",
"String",
"argument",
",",
"String",
"value",
")",
"{",
"if",
"(",
"(",
"value",
"!=",
"null",
")",
"&&",
"(",
"value",
".",
"length",
"(",
")",
">",
"0",
")",
")",
"{"... | This function adds the given command line argument to the buffer.
@param buffer
The buffer
@param argument
The argument
@param value
The argument value | [
"This",
"function",
"adds",
"the",
"given",
"command",
"line",
"argument",
"to",
"the",
"buffer",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java#L299-L310 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/user/AbstractUserObject.java | AbstractUserObject.unassignFromUserObjectInDb | protected void unassignFromUserObjectInDb(final Type _unassignType,
final JAASSystem _jaasSystem,
final AbstractUserObject _object)
throws EFapsException {
"""
Unassign this user object from the given user object fo... | java | protected void unassignFromUserObjectInDb(final Type _unassignType,
final JAASSystem _jaasSystem,
final AbstractUserObject _object)
throws EFapsException
{
Connection con = null;
try {
con... | [
"protected",
"void",
"unassignFromUserObjectInDb",
"(",
"final",
"Type",
"_unassignType",
",",
"final",
"JAASSystem",
"_jaasSystem",
",",
"final",
"AbstractUserObject",
"_object",
")",
"throws",
"EFapsException",
"{",
"Connection",
"con",
"=",
"null",
";",
"try",
"{... | Unassign this user object from the given user object for given JAAS
system.
@param _unassignType type used to unassign (in other words the
relationship type)
@param _jaasSystem JAAS system for which this user object is unassigned
from given object
@param _object user object from which this user object is unassigned
@t... | [
"Unassign",
"this",
"user",
"object",
"from",
"the",
"given",
"user",
"object",
"for",
"given",
"JAAS",
"system",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/user/AbstractUserObject.java#L280-L324 |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/TypedArrayCompat.java | TypedArrayCompat.getDrawable | public static Drawable getDrawable(Resources.Theme theme, TypedArray a, TypedValue[] values, int index) {
"""
Retrieve the Drawable for the attribute at <var>index</var>.
@param index Index of attribute to retrieve.
@return Drawable for the attribute, or null if not defined.
"""
if (values != null... | java | public static Drawable getDrawable(Resources.Theme theme, TypedArray a, TypedValue[] values, int index) {
if (values != null && theme != null) {
TypedValue v = values[index];
if (v.type == TypedValue.TYPE_ATTRIBUTE) {
TEMP_ARRAY[0] = v.data;
TypedArray t... | [
"public",
"static",
"Drawable",
"getDrawable",
"(",
"Resources",
".",
"Theme",
"theme",
",",
"TypedArray",
"a",
",",
"TypedValue",
"[",
"]",
"values",
",",
"int",
"index",
")",
"{",
"if",
"(",
"values",
"!=",
"null",
"&&",
"theme",
"!=",
"null",
")",
"... | Retrieve the Drawable for the attribute at <var>index</var>.
@param index Index of attribute to retrieve.
@return Drawable for the attribute, or null if not defined. | [
"Retrieve",
"the",
"Drawable",
"for",
"the",
"attribute",
"at",
"<var",
">",
"index<",
"/",
"var",
">",
"."
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/TypedArrayCompat.java#L77-L98 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/animation/transformation/Transformation.java | Transformation.forTicks | public T forTicks(int duration, int delay) {
"""
Sets the duration and delay for this {@link Transformation}.
@param duration the duration
@param delay the delay
@return the t
"""
this.duration = Timer.tickToTime(duration);
this.delay = Timer.tickToTime(delay);
return self();
} | java | public T forTicks(int duration, int delay)
{
this.duration = Timer.tickToTime(duration);
this.delay = Timer.tickToTime(delay);
return self();
} | [
"public",
"T",
"forTicks",
"(",
"int",
"duration",
",",
"int",
"delay",
")",
"{",
"this",
".",
"duration",
"=",
"Timer",
".",
"tickToTime",
"(",
"duration",
")",
";",
"this",
".",
"delay",
"=",
"Timer",
".",
"tickToTime",
"(",
"delay",
")",
";",
"ret... | Sets the duration and delay for this {@link Transformation}.
@param duration the duration
@param delay the delay
@return the t | [
"Sets",
"the",
"duration",
"and",
"delay",
"for",
"this",
"{",
"@link",
"Transformation",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/Transformation.java#L93-L99 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addMethod | @Nonnull
public BugInstance addMethod(@SlashedClassName String className, String methodName, String methodSig, int accessFlags) {
"""
Add a method annotation. If this is the first method annotation added, it
becomes the primary method annotation.
@param className
name of the class containing the method
@... | java | @Nonnull
public BugInstance addMethod(@SlashedClassName String className, String methodName, String methodSig, int accessFlags) {
addMethod(MethodAnnotation.fromForeignMethod(className, methodName, methodSig, accessFlags));
return this;
} | [
"@",
"Nonnull",
"public",
"BugInstance",
"addMethod",
"(",
"@",
"SlashedClassName",
"String",
"className",
",",
"String",
"methodName",
",",
"String",
"methodSig",
",",
"int",
"accessFlags",
")",
"{",
"addMethod",
"(",
"MethodAnnotation",
".",
"fromForeignMethod",
... | Add a method annotation. If this is the first method annotation added, it
becomes the primary method annotation.
@param className
name of the class containing the method
@param methodName
name of the method
@param methodSig
type signature of the method
@param accessFlags
accessFlags for the method
@return this object | [
"Add",
"a",
"method",
"annotation",
".",
"If",
"this",
"is",
"the",
"first",
"method",
"annotation",
"added",
"it",
"becomes",
"the",
"primary",
"method",
"annotation",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1325-L1329 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java | RedundentExprEliminator.createIteratorFromSteps | protected WalkingIterator createIteratorFromSteps(final WalkingIterator wi, int numSteps) {
"""
Create a new WalkingIterator from the steps in another WalkingIterator.
@param wi The iterator from where the steps will be taken.
@param numSteps The number of steps from the first to copy into the new
iterator.
... | java | protected WalkingIterator createIteratorFromSteps(final WalkingIterator wi, int numSteps)
{
WalkingIterator newIter = new WalkingIterator(wi.getPrefixResolver());
try
{
AxesWalker walker = (AxesWalker)wi.getFirstWalker().clone();
newIter.setFirstWalker(walker);
walker.setLocPathIterator(newIter);... | [
"protected",
"WalkingIterator",
"createIteratorFromSteps",
"(",
"final",
"WalkingIterator",
"wi",
",",
"int",
"numSteps",
")",
"{",
"WalkingIterator",
"newIter",
"=",
"new",
"WalkingIterator",
"(",
"wi",
".",
"getPrefixResolver",
"(",
")",
")",
";",
"try",
"{",
... | Create a new WalkingIterator from the steps in another WalkingIterator.
@param wi The iterator from where the steps will be taken.
@param numSteps The number of steps from the first to copy into the new
iterator.
@return The new iterator. | [
"Create",
"a",
"new",
"WalkingIterator",
"from",
"the",
"steps",
"in",
"another",
"WalkingIterator",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java#L487-L509 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/ProjectManager.java | ProjectManager.purgeProject | public synchronized Project purgeProject(final Project project, final User deleter)
throws ProjectManagerException {
"""
Permanently delete all project files and properties data for all versions of a project and log
event in project_events table
"""
this.projectLoader.cleanOlderProjectVersion(projec... | java | public synchronized Project purgeProject(final Project project, final User deleter)
throws ProjectManagerException {
this.projectLoader.cleanOlderProjectVersion(project.getId(),
project.getVersion() + 1, Collections.emptyList());
this.projectLoader
.postEvent(project, EventType.PURGE, dele... | [
"public",
"synchronized",
"Project",
"purgeProject",
"(",
"final",
"Project",
"project",
",",
"final",
"User",
"deleter",
")",
"throws",
"ProjectManagerException",
"{",
"this",
".",
"projectLoader",
".",
"cleanOlderProjectVersion",
"(",
"project",
".",
"getId",
"(",... | Permanently delete all project files and properties data for all versions of a project and log
event in project_events table | [
"Permanently",
"delete",
"all",
"project",
"files",
"and",
"properties",
"data",
"for",
"all",
"versions",
"of",
"a",
"project",
"and",
"log",
"event",
"in",
"project_events",
"table"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/ProjectManager.java#L315-L323 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/cachekeygenerator/KeyGenUtil.java | KeyGenUtil.generateKey | static public String generateKey(HttpServletRequest request, Iterable<ICacheKeyGenerator> keyGens) {
"""
Generates a cache key by aggregating (concatenating) the output of
each of the cache key generators in the array.
@param request The request object
@param keyGens The array
@return The aggregated cache ke... | java | static public String generateKey(HttpServletRequest request, Iterable<ICacheKeyGenerator> keyGens) {
StringBuffer sb = new StringBuffer();
for (ICacheKeyGenerator keyGen : keyGens) {
String key = keyGen.generateKey(request);
if (key != null && key.length() > 0) {
sb.append(sb.length() > 0 ? ";" : "")... | [
"static",
"public",
"String",
"generateKey",
"(",
"HttpServletRequest",
"request",
",",
"Iterable",
"<",
"ICacheKeyGenerator",
">",
"keyGens",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"ICacheKeyGenerator",
"keyGen",
... | Generates a cache key by aggregating (concatenating) the output of
each of the cache key generators in the array.
@param request The request object
@param keyGens The array
@return The aggregated cache key | [
"Generates",
"a",
"cache",
"key",
"by",
"aggregating",
"(",
"concatenating",
")",
"the",
"output",
"of",
"each",
"of",
"the",
"cache",
"key",
"generators",
"in",
"the",
"array",
"."
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/cachekeygenerator/KeyGenUtil.java#L58-L67 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java | CmsContainerpageHandler.createViewOnlineEntry | protected I_CmsContextMenuEntry createViewOnlineEntry() {
"""
Creates the view online entry, if an online link is available.<p>
@return the menu entry or null, if not available
"""
final String onlineLink = m_controller.getData().getOnlineLink();
CmsContextMenuEntry entry = null;
if... | java | protected I_CmsContextMenuEntry createViewOnlineEntry() {
final String onlineLink = m_controller.getData().getOnlineLink();
CmsContextMenuEntry entry = null;
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(onlineLink)) {
I_CmsContextMenuCommand command = new I_CmsContextMenuCommand() {... | [
"protected",
"I_CmsContextMenuEntry",
"createViewOnlineEntry",
"(",
")",
"{",
"final",
"String",
"onlineLink",
"=",
"m_controller",
".",
"getData",
"(",
")",
".",
"getOnlineLink",
"(",
")",
";",
"CmsContextMenuEntry",
"entry",
"=",
"null",
";",
"if",
"(",
"CmsSt... | Creates the view online entry, if an online link is available.<p>
@return the menu entry or null, if not available | [
"Creates",
"the",
"view",
"online",
"entry",
"if",
"an",
"online",
"link",
"is",
"available",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java#L1451-L1487 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServersInner.java | ServersInner.beginUpdate | public ServerInner beginUpdate(String resourceGroupName, String serverName, ServerUpdate parameters) {
"""
Updates a server.
@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 serverName The nam... | java | public ServerInner beginUpdate(String resourceGroupName, String serverName, ServerUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body();
} | [
"public",
"ServerInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"parameters",
")",
".... | Updates a server.
@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 serverName The name of the server.
@param parameters The requested server resource state.
@throws IllegalArgumentException thrown if ... | [
"Updates",
"a",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServersInner.java#L839-L841 |
facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/TicketSeedFileParser.java | TicketSeedFileParser.deriveKeyFromSeed | private SessionTicketKey deriveKeyFromSeed(String seed) {
"""
Derives a {@link SessionTicketKey} from the given ticket seed using the {@link CryptoUtil#hkdf} function.
@param seed the ticket seed.
@return the ticket key.
"""
byte[] seedBin = decodeHex(seed);
byte[] keyName = hkdf(seedBin, s... | java | private SessionTicketKey deriveKeyFromSeed(String seed) {
byte[] seedBin = decodeHex(seed);
byte[] keyName = hkdf(seedBin, salt, NAME_BYTES, SessionTicketKey.NAME_SIZE);
byte[] aesKey = hkdf(seedBin, salt, AES_BYTES, SessionTicketKey.AES_KEY_SIZE);
byte[] hmacKey = hkdf(seedBin, salt, HM... | [
"private",
"SessionTicketKey",
"deriveKeyFromSeed",
"(",
"String",
"seed",
")",
"{",
"byte",
"[",
"]",
"seedBin",
"=",
"decodeHex",
"(",
"seed",
")",
";",
"byte",
"[",
"]",
"keyName",
"=",
"hkdf",
"(",
"seedBin",
",",
"salt",
",",
"NAME_BYTES",
",",
"Ses... | Derives a {@link SessionTicketKey} from the given ticket seed using the {@link CryptoUtil#hkdf} function.
@param seed the ticket seed.
@return the ticket key. | [
"Derives",
"a",
"{",
"@link",
"SessionTicketKey",
"}",
"from",
"the",
"given",
"ticket",
"seed",
"using",
"the",
"{",
"@link",
"CryptoUtil#hkdf",
"}",
"function",
"."
] | train | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/TicketSeedFileParser.java#L189-L195 |
Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java | TypefaceHelper.setTypeface | public void setTypeface(Activity activity, String typefaceName, int style) {
"""
Set the typeface to the all text views belong to the activity.
Note that we use decor view of the activity so that the typeface will also be applied to action bar.
@param activity the activity.
@param typefaceName typeface name.
@... | java | public void setTypeface(Activity activity, String typefaceName, int style) {
setTypeface((ViewGroup) activity.getWindow().getDecorView(), typefaceName, style);
} | [
"public",
"void",
"setTypeface",
"(",
"Activity",
"activity",
",",
"String",
"typefaceName",
",",
"int",
"style",
")",
"{",
"setTypeface",
"(",
"(",
"ViewGroup",
")",
"activity",
".",
"getWindow",
"(",
")",
".",
"getDecorView",
"(",
")",
",",
"typefaceName",... | Set the typeface to the all text views belong to the activity.
Note that we use decor view of the activity so that the typeface will also be applied to action bar.
@param activity the activity.
@param typefaceName typeface name.
@param style the typeface style. | [
"Set",
"the",
"typeface",
"to",
"the",
"all",
"text",
"views",
"belong",
"to",
"the",
"activity",
".",
"Note",
"that",
"we",
"use",
"decor",
"view",
"of",
"the",
"activity",
"so",
"that",
"the",
"typeface",
"will",
"also",
"be",
"applied",
"to",
"action"... | train | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L336-L338 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/log/LogViewSerialization.java | LogViewSerialization.write | public static void write(LogView logView, String path) throws IOException {
"""
Serializes the log view under the given path.
@param logView Log view to serialize.
@param path Target path of the serialized log view.
@throws IOException If the log view can't be written under the given
path.
"""
... | java | public static void write(LogView logView, String path) throws IOException {
String xml = xstream.toXML(logView);
try (BufferedWriter out = new BufferedWriter(new FileWriter(path))) {
out.write(xml);
}
} | [
"public",
"static",
"void",
"write",
"(",
"LogView",
"logView",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"String",
"xml",
"=",
"xstream",
".",
"toXML",
"(",
"logView",
")",
";",
"try",
"(",
"BufferedWriter",
"out",
"=",
"new",
"BufferedWri... | Serializes the log view under the given path.
@param logView Log view to serialize.
@param path Target path of the serialized log view.
@throws IOException If the log view can't be written under the given
path. | [
"Serializes",
"the",
"log",
"view",
"under",
"the",
"given",
"path",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/LogViewSerialization.java#L160-L165 |
wkgcass/Style | src/main/java/net/cassite/style/IfBlock.java | IfBlock.ElseIf | public IfBlock<T, INIT> ElseIf(RFunc0<INIT> init, RFunc1<T, INIT> body) {
"""
define an ElseIf block.<br>
@param init lambda expression returns an object or boolean value,
init==null || init.equals(false) will be considered
<b>false</b> in traditional if expression. in other
cases, considered true
@param bo... | java | public IfBlock<T, INIT> ElseIf(RFunc0<INIT> init, RFunc1<T, INIT> body) {
return ElseIf(init, $(body));
} | [
"public",
"IfBlock",
"<",
"T",
",",
"INIT",
">",
"ElseIf",
"(",
"RFunc0",
"<",
"INIT",
">",
"init",
",",
"RFunc1",
"<",
"T",
",",
"INIT",
">",
"body",
")",
"{",
"return",
"ElseIf",
"(",
"init",
",",
"$",
"(",
"body",
")",
")",
";",
"}"
] | define an ElseIf block.<br>
@param init lambda expression returns an object or boolean value,
init==null || init.equals(false) will be considered
<b>false</b> in traditional if expression. in other
cases, considered true
@param body takes in INIT value, and return body's return value if
init is considered true
@return... | [
"define",
"an",
"ElseIf",
"block",
".",
"<br",
">"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/IfBlock.java#L208-L210 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/PropertyColumnTableDescription.java | PropertyColumnTableDescription.addPropertyColumn | public void addPropertyColumn(String propertyName, Class propertyType, TableCellEditor editor) {
"""
WARNING: propertyType is discarded, it should be fetched from the entityType through introspection.
@deprecated
@see #addPropertyColumn(String)
@see PropertyColumn#withEditor(javax.swing.table.TableCellEditor)... | java | public void addPropertyColumn(String propertyName, Class propertyType, TableCellEditor editor)
{
addPropertyColumn(propertyName).withEditor(editor);
} | [
"public",
"void",
"addPropertyColumn",
"(",
"String",
"propertyName",
",",
"Class",
"propertyType",
",",
"TableCellEditor",
"editor",
")",
"{",
"addPropertyColumn",
"(",
"propertyName",
")",
".",
"withEditor",
"(",
"editor",
")",
";",
"}"
] | WARNING: propertyType is discarded, it should be fetched from the entityType through introspection.
@deprecated
@see #addPropertyColumn(String)
@see PropertyColumn#withEditor(javax.swing.table.TableCellEditor) | [
"WARNING",
":",
"propertyType",
"is",
"discarded",
"it",
"should",
"be",
"fetched",
"from",
"the",
"entityType",
"through",
"introspection",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/PropertyColumnTableDescription.java#L240-L243 |
Pixplicity/EasyPrefs | library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java | Prefs.putStringSet | @SuppressWarnings("WeakerAccess")
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void putStringSet(final String key, final Set<String> value) {
"""
Stores a Set of Strings. On Honeycomb and later this will call the native implementation in
SharedPreferences.Editor, on older SDKs this will call {@... | java | @SuppressWarnings("WeakerAccess")
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void putStringSet(final String key, final Set<String> value) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
final Editor editor = getPreferences().edit();
editor.putStringSe... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"static",
"void",
"putStringSet",
"(",
"final",
"String",
"key",
",",
"final",
"Set",
"<",
"String",
">",
"value",
"... | Stores a Set of Strings. On Honeycomb and later this will call the native implementation in
SharedPreferences.Editor, on older SDKs this will call {@link #putOrderedStringSet(String,
Set)}.
<strong>Note that the native implementation of {@link Editor#putStringSet(String,
Set)} does not reliably preserve the order of th... | [
"Stores",
"a",
"Set",
"of",
"Strings",
".",
"On",
"Honeycomb",
"and",
"later",
"this",
"will",
"call",
"the",
"native",
"implementation",
"in",
"SharedPreferences",
".",
"Editor",
"on",
"older",
"SDKs",
"this",
"will",
"call",
"{",
"@link",
"#putOrderedStringS... | train | https://github.com/Pixplicity/EasyPrefs/blob/0ca13a403bf099019a13d68b38edcf55fca5a653/library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java#L360-L371 |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/Batch.java | Batch.query | private <T> QueryRequest<T> query(String fql, JavaType type) {
"""
Implementation now that we have chosen a Jackson JavaType for the return value
"""
this.checkForBatchExecution();
if (this.multiqueryRequest == null) {
this.multiqueryRequest = new MultiqueryRequest(mapper, this.createUnmappedChai... | java | private <T> QueryRequest<T> query(String fql, JavaType type) {
this.checkForBatchExecution();
if (this.multiqueryRequest == null) {
this.multiqueryRequest = new MultiqueryRequest(mapper, this.createUnmappedChain());
this.graphRequests.add(this.multiqueryRequest);
}
// There is a circular ref... | [
"private",
"<",
"T",
">",
"QueryRequest",
"<",
"T",
">",
"query",
"(",
"String",
"fql",
",",
"JavaType",
"type",
")",
"{",
"this",
".",
"checkForBatchExecution",
"(",
")",
";",
"if",
"(",
"this",
".",
"multiqueryRequest",
"==",
"null",
")",
"{",
"this"... | Implementation now that we have chosen a Jackson JavaType for the return value | [
"Implementation",
"now",
"that",
"we",
"have",
"chosen",
"a",
"Jackson",
"JavaType",
"for",
"the",
"return",
"value"
] | train | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/Batch.java#L233-L255 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java | DocBookBuilder.buildTranslatedBook | public HashMap<String, byte[]> buildTranslatedBook(final ContentSpec contentSpec, final String requester,
final DocBookBuildingOptions buildingOptions, final Map<String, byte[]> overrideFiles,
final ZanataDetails zanataDetails) throws BuilderCreationException, BuildProcessingException {
"""
... | java | public HashMap<String, byte[]> buildTranslatedBook(final ContentSpec contentSpec, final String requester,
final DocBookBuildingOptions buildingOptions, final Map<String, byte[]> overrideFiles,
final ZanataDetails zanataDetails) throws BuilderCreationException, BuildProcessingException {
... | [
"public",
"HashMap",
"<",
"String",
",",
"byte",
"[",
"]",
">",
"buildTranslatedBook",
"(",
"final",
"ContentSpec",
"contentSpec",
",",
"final",
"String",
"requester",
",",
"final",
"DocBookBuildingOptions",
"buildingOptions",
",",
"final",
"Map",
"<",
"String",
... | Builds a DocBook Formatted Book using a Content Specification to define the structure and contents of the book.
@param contentSpec The content specification to build from.
@param requester The user who requested the build.
@param buildingOptions The options to be used when building.
@param overrideFiles
@par... | [
"Builds",
"a",
"DocBook",
"Formatted",
"Book",
"using",
"a",
"Content",
"Specification",
"to",
"define",
"the",
"structure",
"and",
"contents",
"of",
"the",
"book",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java#L442-L446 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/authorization/authorizationpolicy_binding.java | authorizationpolicy_binding.get | public static authorizationpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch authorizationpolicy_binding resource of given name .
"""
authorizationpolicy_binding obj = new authorizationpolicy_binding();
obj.set_name(name);
authorizationpolicy_binding resp... | java | public static authorizationpolicy_binding get(nitro_service service, String name) throws Exception{
authorizationpolicy_binding obj = new authorizationpolicy_binding();
obj.set_name(name);
authorizationpolicy_binding response = (authorizationpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"authorizationpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"authorizationpolicy_binding",
"obj",
"=",
"new",
"authorizationpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
... | Use this API to fetch authorizationpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"authorizationpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authorization/authorizationpolicy_binding.java#L147-L152 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotDisplayed | private boolean isNotDisplayed(String action, String expected, String extra) {
"""
Determines if the element is displayed. If it isn't, it'll wait up to the
default time (5 seconds) for the element to be displayed
@param action - what action is occurring
@param expected - what is the expected result
@param... | java | private boolean isNotDisplayed(String action, String expected, String extra) {
// wait for element to be displayed
if (!is.displayed()) {
waitForState.displayed();
}
if (!is.displayed()) {
reporter.fail(action, expected, extra + prettyOutput() + NOT_DISPLAYED);
... | [
"private",
"boolean",
"isNotDisplayed",
"(",
"String",
"action",
",",
"String",
"expected",
",",
"String",
"extra",
")",
"{",
"// wait for element to be displayed",
"if",
"(",
"!",
"is",
".",
"displayed",
"(",
")",
")",
"{",
"waitForState",
".",
"displayed",
"... | Determines if the element is displayed. If it isn't, it'll wait up to the
default time (5 seconds) for the element to be displayed
@param action - what action is occurring
@param expected - what is the expected result
@param extra - what actually is occurring
@return Boolean: is the element displayed? | [
"Determines",
"if",
"the",
"element",
"is",
"displayed",
".",
"If",
"it",
"isn",
"t",
"it",
"ll",
"wait",
"up",
"to",
"the",
"default",
"time",
"(",
"5",
"seconds",
")",
"for",
"the",
"element",
"to",
"be",
"displayed"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L615-L626 |
netty/netty | transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java | EmbeddedChannel.writeOneOutbound | public ChannelFuture writeOneOutbound(Object msg, ChannelPromise promise) {
"""
Writes one message to the outbound of this {@link Channel} and does not flush it. This
method is conceptually equivalent to {@link #write(Object, ChannelPromise)}.
@see #writeOneInbound(Object, ChannelPromise)
"""
if (c... | java | public ChannelFuture writeOneOutbound(Object msg, ChannelPromise promise) {
if (checkOpen(true)) {
return write(msg, promise);
}
return checkException(promise);
} | [
"public",
"ChannelFuture",
"writeOneOutbound",
"(",
"Object",
"msg",
",",
"ChannelPromise",
"promise",
")",
"{",
"if",
"(",
"checkOpen",
"(",
"true",
")",
")",
"{",
"return",
"write",
"(",
"msg",
",",
"promise",
")",
";",
"}",
"return",
"checkException",
"... | Writes one message to the outbound of this {@link Channel} and does not flush it. This
method is conceptually equivalent to {@link #write(Object, ChannelPromise)}.
@see #writeOneInbound(Object, ChannelPromise) | [
"Writes",
"one",
"message",
"to",
"the",
"outbound",
"of",
"this",
"{",
"@link",
"Channel",
"}",
"and",
"does",
"not",
"flush",
"it",
".",
"This",
"method",
"is",
"conceptually",
"equivalent",
"to",
"{",
"@link",
"#write",
"(",
"Object",
"ChannelPromise",
... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java#L431-L436 |
JDBDT/jdbdt | src/main/java/org/jdbdt/DataSetBuilder.java | DataSetBuilder.ensureValidRange | private static <T extends Comparable<T>> void ensureValidRange(T min, T max) {
"""
Range validation utility method.
@param <T> Type of data.
@param min Minimum value.
@param max Maximum value.
@throws InvalidOperationException if the range is not valid.
"""
if (min == null) {
throw new InvalidOpe... | java | private static <T extends Comparable<T>> void ensureValidRange(T min, T max) {
if (min == null) {
throw new InvalidOperationException("Null value for minimum.");
}
if (max == null) {
throw new InvalidOperationException("Null value for maximum.");
}
if (min.compareTo(max) >= 0) {
th... | [
"private",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"T",
">",
">",
"void",
"ensureValidRange",
"(",
"T",
"min",
",",
"T",
"max",
")",
"{",
"if",
"(",
"min",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidOperationException",
"(",
"\"Null value ... | Range validation utility method.
@param <T> Type of data.
@param min Minimum value.
@param max Maximum value.
@throws InvalidOperationException if the range is not valid. | [
"Range",
"validation",
"utility",
"method",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DataSetBuilder.java#L1043-L1053 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsSlideAnimation.java | CmsSlideAnimation.slideOut | public static CmsSlideAnimation slideOut(Element element, Command callback, int duration) {
"""
Slides the given element out of view executing the callback afterwards.<p>
@param element the element to slide out
@param callback the callback
@param duration the animation duration
@return the running animatio... | java | public static CmsSlideAnimation slideOut(Element element, Command callback, int duration) {
CmsSlideAnimation animation = new CmsSlideAnimation(element, false, callback);
animation.run(duration);
return animation;
} | [
"public",
"static",
"CmsSlideAnimation",
"slideOut",
"(",
"Element",
"element",
",",
"Command",
"callback",
",",
"int",
"duration",
")",
"{",
"CmsSlideAnimation",
"animation",
"=",
"new",
"CmsSlideAnimation",
"(",
"element",
",",
"false",
",",
"callback",
")",
"... | Slides the given element out of view executing the callback afterwards.<p>
@param element the element to slide out
@param callback the callback
@param duration the animation duration
@return the running animation object | [
"Slides",
"the",
"given",
"element",
"out",
"of",
"view",
"executing",
"the",
"callback",
"afterwards",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsSlideAnimation.java#L102-L107 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.alternateCalls | public void alternateCalls(String connId, String heldConnId) throws WorkspaceApiException {
"""
Alternate two calls so that you retrieve a call on hold and place the established call on hold instead.
This is a shortcut for doing `holdCall()` and `retrieveCall()` separately.
@param connId The connection ID of the... | java | public void alternateCalls(String connId, String heldConnId) throws WorkspaceApiException {
this.alternateCalls(connId, heldConnId, null, null);
} | [
"public",
"void",
"alternateCalls",
"(",
"String",
"connId",
",",
"String",
"heldConnId",
")",
"throws",
"WorkspaceApiException",
"{",
"this",
".",
"alternateCalls",
"(",
"connId",
",",
"heldConnId",
",",
"null",
",",
"null",
")",
";",
"}"
] | Alternate two calls so that you retrieve a call on hold and place the established call on hold instead.
This is a shortcut for doing `holdCall()` and `retrieveCall()` separately.
@param connId The connection ID of the established call that should be placed on hold.
@param heldConnId The connection ID of the held call t... | [
"Alternate",
"two",
"calls",
"so",
"that",
"you",
"retrieve",
"a",
"call",
"on",
"hold",
"and",
"place",
"the",
"established",
"call",
"on",
"hold",
"instead",
".",
"This",
"is",
"a",
"shortcut",
"for",
"doing",
"holdCall",
"()",
"and",
"retrieveCall",
"()... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L868-L870 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasView.java | CmsAliasView.setData | public void setData(List<CmsAliasTableRow> data, List<CmsRewriteAliasTableRow> rewriteData) {
"""
Replaces the contents of the live data row list with another list of rows.<p>
@param data the new list of rows to be placed into the live data list
@param rewriteData the list of rewrite alias data
"""
... | java | public void setData(List<CmsAliasTableRow> data, List<CmsRewriteAliasTableRow> rewriteData) {
m_table.getLiveDataList().clear();
m_table.getLiveDataList().addAll(data);
m_rewriteTable.getLiveDataList().clear();
m_rewriteTable.getLiveDataList().addAll(rewriteData);
} | [
"public",
"void",
"setData",
"(",
"List",
"<",
"CmsAliasTableRow",
">",
"data",
",",
"List",
"<",
"CmsRewriteAliasTableRow",
">",
"rewriteData",
")",
"{",
"m_table",
".",
"getLiveDataList",
"(",
")",
".",
"clear",
"(",
")",
";",
"m_table",
".",
"getLiveDataL... | Replaces the contents of the live data row list with another list of rows.<p>
@param data the new list of rows to be placed into the live data list
@param rewriteData the list of rewrite alias data | [
"Replaces",
"the",
"contents",
"of",
"the",
"live",
"data",
"row",
"list",
"with",
"another",
"list",
"of",
"rows",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasView.java#L299-L305 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java | CommonMpJwtFat.badAppExpectations | public Expectations badAppExpectations(String errorMessage) throws Exception {
"""
Set bad app check expectations - sets checks for a 401 status code and the expected error message in the server's messages.log
@param errorMessage - the error message to search for in the server's messages.log file
@return - new... | java | public Expectations badAppExpectations(String errorMessage) throws Exception {
Expectations expectations = new Expectations();
expectations.addExpectation(new ResponseStatusExpectation(HttpServletResponse.SC_UNAUTHORIZED));
expectations.addExpectation(new ResponseMessageExpectation(MpJwtFatCons... | [
"public",
"Expectations",
"badAppExpectations",
"(",
"String",
"errorMessage",
")",
"throws",
"Exception",
"{",
"Expectations",
"expectations",
"=",
"new",
"Expectations",
"(",
")",
";",
"expectations",
".",
"addExpectation",
"(",
"new",
"ResponseStatusExpectation",
"... | Set bad app check expectations - sets checks for a 401 status code and the expected error message in the server's messages.log
@param errorMessage - the error message to search for in the server's messages.log file
@return - newly created Expectations
@throws Exception | [
"Set",
"bad",
"app",
"check",
"expectations",
"-",
"sets",
"checks",
"for",
"a",
"401",
"status",
"code",
"and",
"the",
"expected",
"error",
"message",
"in",
"the",
"server",
"s",
"messages",
".",
"log"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java#L111-L118 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/JsonUtil.java | JsonUtil.getValueString | public static String getValueString(Object value, int type, MappingRules mapping) {
"""
Embeds the property type in the string value if the formats scope is 'value'.
@param value
@param type
@param mapping
@return
"""
String string = value.toString();
if (type != PropertyType.STRING &&
... | java | public static String getValueString(Object value, int type, MappingRules mapping) {
String string = value.toString();
if (type != PropertyType.STRING &&
mapping.propertyFormat.embedType &&
mapping.propertyFormat.scope == MappingRules.PropertyFormat.Scope.value) {
... | [
"public",
"static",
"String",
"getValueString",
"(",
"Object",
"value",
",",
"int",
"type",
",",
"MappingRules",
"mapping",
")",
"{",
"String",
"string",
"=",
"value",
".",
"toString",
"(",
")",
";",
"if",
"(",
"type",
"!=",
"PropertyType",
".",
"STRING",
... | Embeds the property type in the string value if the formats scope is 'value'.
@param value
@param type
@param mapping
@return | [
"Embeds",
"the",
"property",
"type",
"in",
"the",
"string",
"value",
"if",
"the",
"formats",
"scope",
"is",
"value",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/JsonUtil.java#L948-L956 |
sothawo/mapjfx | src/main/java/com/sothawo/mapjfx/MapView.java | JavaConnector.singleClickAt | public void singleClickAt(double lat, double lon) {
"""
called when the user has single-clicked in the map. the coordinates are EPSG:4326 (WGS) values.
@param lat
new latitude value
@param lon
new longitude value
"""
final Coordinate coordinate = new Coordinate(lat, lon);
if (logg... | java | public void singleClickAt(double lat, double lon) {
final Coordinate coordinate = new Coordinate(lat, lon);
if (logger.isTraceEnabled()) {
logger.trace("JS reports single click at {}", coordinate);
}
fireEvent(new MapViewEvent(MapViewEvent.MAP_CLICKED, coo... | [
"public",
"void",
"singleClickAt",
"(",
"double",
"lat",
",",
"double",
"lon",
")",
"{",
"final",
"Coordinate",
"coordinate",
"=",
"new",
"Coordinate",
"(",
"lat",
",",
"lon",
")",
";",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"l... | called when the user has single-clicked in the map. the coordinates are EPSG:4326 (WGS) values.
@param lat
new latitude value
@param lon
new longitude value | [
"called",
"when",
"the",
"user",
"has",
"single",
"-",
"clicked",
"in",
"the",
"map",
".",
"the",
"coordinates",
"are",
"EPSG",
":",
"4326",
"(",
"WGS",
")",
"values",
"."
] | train | https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1372-L1378 |
find-sec-bugs/find-sec-bugs | findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/common/ByteCode.java | ByteCode.getConstantLDC | public static <T> T getConstantLDC(InstructionHandle h, ConstantPoolGen cpg, Class<T> clazz) {
"""
Get the constant value of the given instruction.
(The instruction must refer to the Constant Pool otherwise null is return)
<T> is the Type of the constant value return
This utility method should be us... | java | public static <T> T getConstantLDC(InstructionHandle h, ConstantPoolGen cpg, Class<T> clazz) {
Instruction prevIns = h.getInstruction();
if (prevIns instanceof LDC) {
LDC ldcInst = (LDC) prevIns;
Object val = ldcInst.getValue(cpg);
if (val.getClass().equals(clazz)) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"getConstantLDC",
"(",
"InstructionHandle",
"h",
",",
"ConstantPoolGen",
"cpg",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"Instruction",
"prevIns",
"=",
"h",
".",
"getInstruction",
"(",
")",
";",
"if",
"(",
... | Get the constant value of the given instruction.
(The instruction must refer to the Constant Pool otherwise null is return)
<T> is the Type of the constant value return
This utility method should be used only when the taint analysis is not needed.
For example, to detect api where the value will typically be ha... | [
"Get",
"the",
"constant",
"value",
"of",
"the",
"given",
"instruction",
".",
"(",
"The",
"instruction",
"must",
"refer",
"to",
"the",
"Constant",
"Pool",
"otherwise",
"null",
"is",
"return",
")"
] | train | https://github.com/find-sec-bugs/find-sec-bugs/blob/362da013cef4925e6a1506dd3511fe5bdcc5fba3/findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/common/ByteCode.java#L97-L117 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java | ProcessedInput.fillParameterValues | public void fillParameterValues(Map<String, Object> valuesMap) {
"""
Utility function.
Fills this ProcessedInput with values.
This function iterates over parameter names list and loads corresponding value from MAp
@param valuesMap Map of values which would be loaded
"""
AssertUtils.assertNotNull(... | java | public void fillParameterValues(Map<String, Object> valuesMap) {
AssertUtils.assertNotNull(valuesMap, "Value map cannot be null");
if (this.sqlParameterNames != null) {
String parameterName = null;
this.sqlParameterValues = new ArrayList<Object>();
// using... | [
"public",
"void",
"fillParameterValues",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"valuesMap",
")",
"{",
"AssertUtils",
".",
"assertNotNull",
"(",
"valuesMap",
",",
"\"Value map cannot be null\"",
")",
";",
"if",
"(",
"this",
".",
"sqlParameterNames",
"!="... | Utility function.
Fills this ProcessedInput with values.
This function iterates over parameter names list and loads corresponding value from MAp
@param valuesMap Map of values which would be loaded | [
"Utility",
"function",
".",
"Fills",
"this",
"ProcessedInput",
"with",
"values",
".",
"This",
"function",
"iterates",
"over",
"parameter",
"names",
"list",
"and",
"loads",
"corresponding",
"value",
"from",
"MAp"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java#L316-L336 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/CollectionUtils.java | CollectionUtils.removeObject | public static <T> boolean removeObject(List<T> l, T o) {
"""
Removes the first occurrence in the list of the specified object, using
object identity (==) not equality as the criterion for object presence. If
this list does not contain the element, it is unchanged.
@param l
The {@link List} from which to remo... | java | public static <T> boolean removeObject(List<T> l, T o) {
int i = 0;
for (Object o1 : l) {
if (o == o1) {
l.remove(i);
return true;
} else
i++;
}
return false;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"removeObject",
"(",
"List",
"<",
"T",
">",
"l",
",",
"T",
"o",
")",
"{",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"Object",
"o1",
":",
"l",
")",
"{",
"if",
"(",
"o",
"==",
"o1",
")",
"{",
"l",
... | Removes the first occurrence in the list of the specified object, using
object identity (==) not equality as the criterion for object presence. If
this list does not contain the element, it is unchanged.
@param l
The {@link List} from which to remove the object
@param o
The object to be removed.
@return Whether or not... | [
"Removes",
"the",
"first",
"occurrence",
"in",
"the",
"list",
"of",
"the",
"specified",
"object",
"using",
"object",
"identity",
"(",
"==",
")",
"not",
"equality",
"as",
"the",
"criterion",
"for",
"object",
"presence",
".",
"If",
"this",
"list",
"does",
"n... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/CollectionUtils.java#L261-L271 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/utils/JPAUtils.java | JPAUtils.getKeyQuery | public static String getKeyQuery(String queryString, String name) {
"""
Gets Query String for selecting primary keys
@param queryString the original query
@param name primary key name
@return query string
"""
Matcher m = FROM_PATTERN.matcher(queryString);
if (m.find()) {
... | java | public static String getKeyQuery(String queryString, String name) {
Matcher m = FROM_PATTERN.matcher(queryString);
if (m.find()) {
StringBuilder sb = new StringBuilder("SELECT ");
sb.append(getAlias(queryString));
sb.append(".");
sb.append(name);
... | [
"public",
"static",
"String",
"getKeyQuery",
"(",
"String",
"queryString",
",",
"String",
"name",
")",
"{",
"Matcher",
"m",
"=",
"FROM_PATTERN",
".",
"matcher",
"(",
"queryString",
")",
";",
"if",
"(",
"m",
".",
"find",
"(",
")",
")",
"{",
"StringBuilder... | Gets Query String for selecting primary keys
@param queryString the original query
@param name primary key name
@return query string | [
"Gets",
"Query",
"String",
"for",
"selecting",
"primary",
"keys"
] | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/utils/JPAUtils.java#L233-L246 |
primefaces/primefaces | src/main/java/org/primefaces/util/FileUploadUtils.java | FileUploadUtils.isValidType | public static boolean isValidType(FileUpload fileUpload, String fileName, InputStream inputStream) {
"""
Check if an uploaded file meets all specifications regarding its filename and content type. It evaluates {@link FileUpload#getAllowTypes}
as well as {@link FileUpload#getAccept} and uses the installed {@link j... | java | public static boolean isValidType(FileUpload fileUpload, String fileName, InputStream inputStream) {
try {
boolean validType = isValidFileName(fileUpload, fileName) && isValidFileContent(fileUpload, fileName, inputStream);
if (validType) {
if (LOGGER.isLoggable(Level.FINE... | [
"public",
"static",
"boolean",
"isValidType",
"(",
"FileUpload",
"fileUpload",
",",
"String",
"fileName",
",",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"boolean",
"validType",
"=",
"isValidFileName",
"(",
"fileUpload",
",",
"fileName",
")",
"&&",
"isV... | Check if an uploaded file meets all specifications regarding its filename and content type. It evaluates {@link FileUpload#getAllowTypes}
as well as {@link FileUpload#getAccept} and uses the installed {@link java.nio.file.spi.FileTypeDetector} implementation.
For most reliable content type checking it's recommended to ... | [
"Check",
"if",
"an",
"uploaded",
"file",
"meets",
"all",
"specifications",
"regarding",
"its",
"filename",
"and",
"content",
"type",
".",
"It",
"evaluates",
"{"
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/util/FileUploadUtils.java#L143-L159 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/spatialite/SpatialDbsImportUtils.java | SpatialDbsImportUtils.createTableFromShp | public static String createTableFromShp( ASpatialDb db, File shapeFile, String newTableName, boolean avoidSpatialIndex )
throws Exception {
"""
Create a spatial table using a shapefile as schema.
@param db the database to use.
@param shapeFile the shapefile to use.
@param newTableName the new name... | java | public static String createTableFromShp( ASpatialDb db, File shapeFile, String newTableName, boolean avoidSpatialIndex )
throws Exception {
FileDataStore store = FileDataStoreFinder.getDataStore(shapeFile);
SimpleFeatureSource featureSource = store.getFeatureSource();
SimpleFeatureTy... | [
"public",
"static",
"String",
"createTableFromShp",
"(",
"ASpatialDb",
"db",
",",
"File",
"shapeFile",
",",
"String",
"newTableName",
",",
"boolean",
"avoidSpatialIndex",
")",
"throws",
"Exception",
"{",
"FileDataStore",
"store",
"=",
"FileDataStoreFinder",
".",
"ge... | Create a spatial table using a shapefile as schema.
@param db the database to use.
@param shapeFile the shapefile to use.
@param newTableName the new name of the table. If null, the shp name is used.
@return the name of the created table.
@param avoidSpatialIndex if <code>true</code>, no spatial index will be created.... | [
"Create",
"a",
"spatial",
"table",
"using",
"a",
"shapefile",
"as",
"schema",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/spatialite/SpatialDbsImportUtils.java#L88-L97 |
bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java | AstyanaxTableDAO.tableFromJson | @VisibleForTesting
Table tableFromJson(TableJson json) {
"""
Parse the persistent JSON object into an AstyanaxTable.
If the master placement doesn't belong to this datacenter, this method will:
a. try to find a facade for this table that belongs to this datacenter
b. If no facade is found, it will return th... | java | @VisibleForTesting
Table tableFromJson(TableJson json) {
if (json.isDropped()) {
return null;
}
String name = json.getTable();
Map<String, Object> attributes = json.getAttributeMap();
Storage masterStorage = json.getMasterStorage();
String masterPlacement ... | [
"@",
"VisibleForTesting",
"Table",
"tableFromJson",
"(",
"TableJson",
"json",
")",
"{",
"if",
"(",
"json",
".",
"isDropped",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"String",
"name",
"=",
"json",
".",
"getTable",
"(",
")",
";",
"Map",
"<",
"S... | Parse the persistent JSON object into an AstyanaxTable.
If the master placement doesn't belong to this datacenter, this method will:
a. try to find a facade for this table that belongs to this datacenter
b. If no facade is found, it will return the table in the master placement. | [
"Parse",
"the",
"persistent",
"JSON",
"object",
"into",
"an",
"AstyanaxTable",
".",
"If",
"the",
"master",
"placement",
"doesn",
"t",
"belong",
"to",
"this",
"datacenter",
"this",
"method",
"will",
":",
"a",
".",
"try",
"to",
"find",
"a",
"facade",
"for",
... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/AstyanaxTableDAO.java#L1228-L1268 |
samskivert/pythagoras | src/main/java/pythagoras/f/Quaternion.java | Quaternion.fromAngles | public Quaternion fromAngles (Vector3 angles) {
"""
Sets this quaternion to one that first rotates about x by the specified number of radians,
then rotates about y, then about z.
"""
return fromAngles(angles.x, angles.y, angles.z);
} | java | public Quaternion fromAngles (Vector3 angles) {
return fromAngles(angles.x, angles.y, angles.z);
} | [
"public",
"Quaternion",
"fromAngles",
"(",
"Vector3",
"angles",
")",
"{",
"return",
"fromAngles",
"(",
"angles",
".",
"x",
",",
"angles",
".",
"y",
",",
"angles",
".",
"z",
")",
";",
"}"
] | Sets this quaternion to one that first rotates about x by the specified number of radians,
then rotates about y, then about z. | [
"Sets",
"this",
"quaternion",
"to",
"one",
"that",
"first",
"rotates",
"about",
"x",
"by",
"the",
"specified",
"number",
"of",
"radians",
"then",
"rotates",
"about",
"y",
"then",
"about",
"z",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Quaternion.java#L206-L208 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/PropertiesUtils.java | PropertiesUtils.saveProperties | public static void saveProperties(final File file, final Properties props, final String comment) {
"""
Save properties to a file.
@param file
Destination file - Cannot be <code>null</code> and parent directory must exist.
@param props
Properties to save - Cannot be <code>null</code>.
@param comment
Comment... | java | public static void saveProperties(final File file, final Properties props, final String comment) {
checkNotNull("file", file);
checkNotNull("props", props);
if (!file.getParentFile().exists()) {
throw new IllegalArgumentException("The parent directory '" + file.getParentFile() + "' ... | [
"public",
"static",
"void",
"saveProperties",
"(",
"final",
"File",
"file",
",",
"final",
"Properties",
"props",
",",
"final",
"String",
"comment",
")",
"{",
"checkNotNull",
"(",
"\"file\"",
",",
"file",
")",
";",
"checkNotNull",
"(",
"\"props\"",
",",
"prop... | Save properties to a file.
@param file
Destination file - Cannot be <code>null</code> and parent directory must exist.
@param props
Properties to save - Cannot be <code>null</code>.
@param comment
Comment for the file. | [
"Save",
"properties",
"to",
"a",
"file",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L123-L135 |
ihaolin/session | session-api/src/main/java/me/hao0/session/util/WebUtil.java | WebUtil.findCookie | public static Cookie findCookie(HttpServletRequest request, String name) {
"""
find cookie from request
@param request current request
@param name cookie name
@return cookie value or null
"""
if (request != null) {
Cookie[] cookies = request.getCookies();
if (cookies != null ... | java | public static Cookie findCookie(HttpServletRequest request, String name) {
if (request != null) {
Cookie[] cookies = request.getCookies();
if (cookies != null && cookies.length > 0) {
for (Cookie cookie : cookies) {
if (cookie.getName().equals(name)) {... | [
"public",
"static",
"Cookie",
"findCookie",
"(",
"HttpServletRequest",
"request",
",",
"String",
"name",
")",
"{",
"if",
"(",
"request",
"!=",
"null",
")",
"{",
"Cookie",
"[",
"]",
"cookies",
"=",
"request",
".",
"getCookies",
"(",
")",
";",
"if",
"(",
... | find cookie from request
@param request current request
@param name cookie name
@return cookie value or null | [
"find",
"cookie",
"from",
"request"
] | train | https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/util/WebUtil.java#L61-L73 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/MRAsyncDiskService.java | MRAsyncDiskService.moveAndDeleteRelativePath | public boolean moveAndDeleteRelativePath(String volume, String pathName)
throws IOException {
"""
Move the path name on one volume to a temporary location and then
delete them.
This functions returns when the moves are done, but not necessarily all
deletions are done. This is usually good enough because... | java | public boolean moveAndDeleteRelativePath(String volume, String pathName)
throws IOException {
volume = normalizePath(volume);
// Move the file right now, so that it can be deleted later
String newPathName =
format.format(new Date()) + "_" + uniqueId.getAndIncrement();
newPathNam... | [
"public",
"boolean",
"moveAndDeleteRelativePath",
"(",
"String",
"volume",
",",
"String",
"pathName",
")",
"throws",
"IOException",
"{",
"volume",
"=",
"normalizePath",
"(",
"volume",
")",
";",
"// Move the file right now, so that it can be deleted later",
"String",
"newP... | Move the path name on one volume to a temporary location and then
delete them.
This functions returns when the moves are done, but not necessarily all
deletions are done. This is usually good enough because applications
won't see the path name under the old name anyway after the move.
@param volume The disk vol... | [
"Move",
"the",
"path",
"name",
"on",
"one",
"volume",
"to",
"a",
"temporary",
"location",
"and",
"then",
"delete",
"them",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/MRAsyncDiskService.java#L251-L290 |
52inc/android-52Kit | library-drawer/src/main/java/com/ftinc/kit/drawer/Drawer.java | Drawer.formatNavDrawerItem | private void formatNavDrawerItem(DrawerItem item, boolean selected) {
"""
Format a nav drawer item based on current selected states
@param item
@param selected
"""
if (item instanceof SeperatorDrawerItem || item instanceof SwitchDrawerItem) {
// not applicable
return;
... | java | private void formatNavDrawerItem(DrawerItem item, boolean selected) {
if (item instanceof SeperatorDrawerItem || item instanceof SwitchDrawerItem) {
// not applicable
return;
}
// Get the associated view
View view = mNavDrawerItemViews.get(item.getId());
... | [
"private",
"void",
"formatNavDrawerItem",
"(",
"DrawerItem",
"item",
",",
"boolean",
"selected",
")",
"{",
"if",
"(",
"item",
"instanceof",
"SeperatorDrawerItem",
"||",
"item",
"instanceof",
"SwitchDrawerItem",
")",
"{",
"// not applicable",
"return",
";",
"}",
"/... | Format a nav drawer item based on current selected states
@param item
@param selected | [
"Format",
"a",
"nav",
"drawer",
"item",
"based",
"on",
"current",
"selected",
"states"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-drawer/src/main/java/com/ftinc/kit/drawer/Drawer.java#L536-L556 |
vladmihalcea/flexy-pool | flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java | ReflectionUtils.invokeSetter | public static void invokeSetter(Object target, String property, Object parameter) {
"""
Invoke setter method with the given parameter
@param target target object
@param property property
@param parameter setter parameter
"""
Method setter = getSetter(target, property, parameter.getClass());
... | java | public static void invokeSetter(Object target, String property, Object parameter) {
Method setter = getSetter(target, property, parameter.getClass());
try {
setter.invoke(target, parameter);
} catch (IllegalAccessException e) {
throw handleException(setter.getName(), e);
... | [
"public",
"static",
"void",
"invokeSetter",
"(",
"Object",
"target",
",",
"String",
"property",
",",
"Object",
"parameter",
")",
"{",
"Method",
"setter",
"=",
"getSetter",
"(",
"target",
",",
"property",
",",
"parameter",
".",
"getClass",
"(",
")",
")",
";... | Invoke setter method with the given parameter
@param target target object
@param property property
@param parameter setter parameter | [
"Invoke",
"setter",
"method",
"with",
"the",
"given",
"parameter"
] | train | https://github.com/vladmihalcea/flexy-pool/blob/d763d359e68299c2b4e28e4b67770581ae083431/flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java#L142-L151 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java | LoggerRegistry.hasLogger | public boolean hasLogger(final String name, final MessageFactory messageFactory) {
"""
Detects if a Logger with the specified name and MessageFactory exists.
@param name The Logger name to search for.
@param messageFactory The message factory to search for.
@return true if the Logger exists, false otherwise.
@... | java | public boolean hasLogger(final String name, final MessageFactory messageFactory) {
return getOrCreateInnerMap(factoryKey(messageFactory)).containsKey(name);
} | [
"public",
"boolean",
"hasLogger",
"(",
"final",
"String",
"name",
",",
"final",
"MessageFactory",
"messageFactory",
")",
"{",
"return",
"getOrCreateInnerMap",
"(",
"factoryKey",
"(",
"messageFactory",
")",
")",
".",
"containsKey",
"(",
"name",
")",
";",
"}"
] | Detects if a Logger with the specified name and MessageFactory exists.
@param name The Logger name to search for.
@param messageFactory The message factory to search for.
@return true if the Logger exists, false otherwise.
@since 2.5 | [
"Detects",
"if",
"a",
"Logger",
"with",
"the",
"specified",
"name",
"and",
"MessageFactory",
"exists",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L164-L166 |
gallandarakhneorg/afc | advanced/attributes/src/main/java/org/arakhne/afc/attrs/collection/BufferedAttributeCollection.java | BufferedAttributeCollection.setAttributeFromRawValue | protected Attribute setAttributeFromRawValue(String name, AttributeValue value) throws AttributeException {
"""
Set the attribute value.
@param name is the name of the attribute
@param value is the raw value to store.
@return the new created attribute
@throws AttributeException on error.
"""
return set... | java | protected Attribute setAttributeFromRawValue(String name, AttributeValue value) throws AttributeException {
return setAttributeFromRawValue(name, value.getType(), value.getValue());
} | [
"protected",
"Attribute",
"setAttributeFromRawValue",
"(",
"String",
"name",
",",
"AttributeValue",
"value",
")",
"throws",
"AttributeException",
"{",
"return",
"setAttributeFromRawValue",
"(",
"name",
",",
"value",
".",
"getType",
"(",
")",
",",
"value",
".",
"ge... | Set the attribute value.
@param name is the name of the attribute
@param value is the raw value to store.
@return the new created attribute
@throws AttributeException on error. | [
"Set",
"the",
"attribute",
"value",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/attributes/src/main/java/org/arakhne/afc/attrs/collection/BufferedAttributeCollection.java#L229-L231 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/Strings.java | Strings.leftPad | public static String leftPad(String str, int size, char padChar) {
"""
<p>
Left pad a String with a specified character.
</p>
<p>
Pad to a size of {@code size}.
</p>
<pre>
leftPad(null, *, *) = null
leftPad("", 3, 'z') = "zzz"
leftPad("bat", 3, 'z') = "bat"
leftPad("bat", 5, 'z') = "zzbat"
l... | java | public static String leftPad(String str, int size, char padChar) {
if (str == null) { return null; }
int pads = size - str.length();
if (pads <= 0) { return str; // returns original String when possible
}
return repeat(padChar, pads).concat(str);
} | [
"public",
"static",
"String",
"leftPad",
"(",
"String",
"str",
",",
"int",
"size",
",",
"char",
"padChar",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"pads",
"=",
"size",
"-",
"str",
".",
"length",
"(",
... | <p>
Left pad a String with a specified character.
</p>
<p>
Pad to a size of {@code size}.
</p>
<pre>
leftPad(null, *, *) = null
leftPad("", 3, 'z') = "zzz"
leftPad("bat", 3, 'z') = "bat"
leftPad("bat", 5, 'z') = "zzbat"
leftPad("bat", 1, 'z') = "bat"
leftPad("bat", -1, 'z') = "bat"
</pre>
@param str the St... | [
"<p",
">",
"Left",
"pad",
"a",
"String",
"with",
"a",
"specified",
"character",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Pad",
"to",
"a",
"size",
"of",
"{",
"@code",
"size",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L522-L528 |
allengeorge/libraft | libraft-agent/src/main/java/io/libraft/agent/protocol/RaftRPC.java | RaftRPC.setupCustomCommandSerializationAndDeserialization | public static void setupCustomCommandSerializationAndDeserialization(ObjectMapper mapper, CommandSerializer commandSerializer, CommandDeserializer commandDeserializer) {
"""
Setup custom serialization and deserialization for POJO {@link Command} subclasses.
<p/>
See {@code RaftAgent} for more on which {@code Com... | java | public static void setupCustomCommandSerializationAndDeserialization(ObjectMapper mapper, CommandSerializer commandSerializer, CommandDeserializer commandDeserializer) {
SimpleModule module = new SimpleModule("raftrpc-custom-command-module", new Version(0, 0, 0, "inline", "io.libraft", "raftrpc-command-module")... | [
"public",
"static",
"void",
"setupCustomCommandSerializationAndDeserialization",
"(",
"ObjectMapper",
"mapper",
",",
"CommandSerializer",
"commandSerializer",
",",
"CommandDeserializer",
"commandDeserializer",
")",
"{",
"SimpleModule",
"module",
"=",
"new",
"SimpleModule",
"(... | Setup custom serialization and deserialization for POJO {@link Command} subclasses.
<p/>
See {@code RaftAgent} for more on which {@code Command} types are supported.
@param mapper instance of {@code ObjectMapper} with which the serialization/deserialization mapping is registered
@param commandSerializer instance of {@... | [
"Setup",
"custom",
"serialization",
"and",
"deserialization",
"for",
"POJO",
"{",
"@link",
"Command",
"}",
"subclasses",
".",
"<p",
"/",
">",
"See",
"{",
"@code",
"RaftAgent",
"}",
"for",
"more",
"on",
"which",
"{",
"@code",
"Command",
"}",
"types",
"are",... | train | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-agent/src/main/java/io/libraft/agent/protocol/RaftRPC.java#L113-L120 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckJSDoc.java | CheckJSDoc.validateNoSideEffects | private void validateNoSideEffects(Node n, JSDocInfo info) {
"""
Check that @nosideeeffects annotations are only present in externs.
"""
// Cannot have @modifies or @nosideeffects in regular (non externs) js. Report errors.
if (info == null) {
return;
}
if (n.isFromExterns()) {
ret... | java | private void validateNoSideEffects(Node n, JSDocInfo info) {
// Cannot have @modifies or @nosideeffects in regular (non externs) js. Report errors.
if (info == null) {
return;
}
if (n.isFromExterns()) {
return;
}
if (info.hasSideEffectsArgumentsAnnotation() || info.modifiesThis()) ... | [
"private",
"void",
"validateNoSideEffects",
"(",
"Node",
"n",
",",
"JSDocInfo",
"info",
")",
"{",
"// Cannot have @modifies or @nosideeffects in regular (non externs) js. Report errors.",
"if",
"(",
"info",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"n",
... | Check that @nosideeeffects annotations are only present in externs. | [
"Check",
"that"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckJSDoc.java#L657-L673 |
derari/cthul | objects/src/main/java/org/cthul/objects/Boxing.java | Boxing.deepBox | public static Object[] deepBox(Class<?> resultType, final Object src) {
"""
Returns any multidimensional array into an array of boxed values.
@param resultType target type
@param src source array
@return multidimensional array
"""
Class<?> compType = resultType.getComponentType();
if (compTy... | java | public static Object[] deepBox(Class<?> resultType, final Object src) {
Class<?> compType = resultType.getComponentType();
if (compType.isArray()) {
final Object[] src2 = (Object[]) src;
final Object[] result = (Object[]) newArray(compType, src2.length);
for (int i = ... | [
"public",
"static",
"Object",
"[",
"]",
"deepBox",
"(",
"Class",
"<",
"?",
">",
"resultType",
",",
"final",
"Object",
"src",
")",
"{",
"Class",
"<",
"?",
">",
"compType",
"=",
"resultType",
".",
"getComponentType",
"(",
")",
";",
"if",
"(",
"compType",... | Returns any multidimensional array into an array of boxed values.
@param resultType target type
@param src source array
@return multidimensional array | [
"Returns",
"any",
"multidimensional",
"array",
"into",
"an",
"array",
"of",
"boxed",
"values",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/Boxing.java#L724-L736 |
pravega/pravega | shared/cluster/src/main/java/io/pravega/common/cluster/ClusterException.java | ClusterException.create | public static ClusterException create(Type type, String message) {
"""
Factory method to construct Store exceptions.
@param type Type of Exception.
@param message Exception message
@return Instance of ClusterException.
"""
switch (type) {
case METASTORE:
return new Meta... | java | public static ClusterException create(Type type, String message) {
switch (type) {
case METASTORE:
return new MetaStoreException(message);
default:
throw new IllegalArgumentException("Invalid exception type");
}
} | [
"public",
"static",
"ClusterException",
"create",
"(",
"Type",
"type",
",",
"String",
"message",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"METASTORE",
":",
"return",
"new",
"MetaStoreException",
"(",
"message",
")",
";",
"default",
":",
"throw",
... | Factory method to construct Store exceptions.
@param type Type of Exception.
@param message Exception message
@return Instance of ClusterException. | [
"Factory",
"method",
"to",
"construct",
"Store",
"exceptions",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/cluster/src/main/java/io/pravega/common/cluster/ClusterException.java#L32-L39 |
Impetus/Kundera | src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java | KuduDBClient.populateEntity | public void populateEntity(Object entity, RowResult result, EntityType entityType, MetamodelImpl metaModel) {
"""
Populate entity.
@param entity
the entity
@param result
the result
@param entityType
the entity type
@param metaModel
the meta model
"""
Set<Attribute> attributes = entityType.get... | java | public void populateEntity(Object entity, RowResult result, EntityType entityType, MetamodelImpl metaModel)
{
Set<Attribute> attributes = entityType.getAttributes();
Iterator<Attribute> iterator = attributes.iterator();
iterateAndPopulateEntity(entity, result, metaModel, iterator);
} | [
"public",
"void",
"populateEntity",
"(",
"Object",
"entity",
",",
"RowResult",
"result",
",",
"EntityType",
"entityType",
",",
"MetamodelImpl",
"metaModel",
")",
"{",
"Set",
"<",
"Attribute",
">",
"attributes",
"=",
"entityType",
".",
"getAttributes",
"(",
")",
... | Populate entity.
@param entity
the entity
@param result
the result
@param entityType
the entity type
@param metaModel
the meta model | [
"Populate",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java#L286-L291 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/reflection/MyReflectionUtils.java | MyReflectionUtils.buildInstanceForMap | public static <T> T buildInstanceForMap(Class<T> clazz, Map<String, Object> values, MyReflectionDifferenceHandler differenceHandler)
throws InstantiationException, IllegalAccessException, IntrospectionException,
IllegalArgumentException, InvocationTargetException {
"""
Builds a instance of the class fo... | java | public static <T> T buildInstanceForMap(Class<T> clazz, Map<String, Object> values, MyReflectionDifferenceHandler differenceHandler)
throws InstantiationException, IllegalAccessException, IntrospectionException,
IllegalArgumentException, InvocationTargetException {
log.debug("Building new instance of C... | [
"public",
"static",
"<",
"T",
">",
"T",
"buildInstanceForMap",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
",",
"MyReflectionDifferenceHandler",
"differenceHandler",
")",
"throws",
"InstantiationException",
",",... | Builds a instance of the class for a map containing the values
@param clazz Class to build
@param values Values map
@param differenceHandler The difference handler
@return The created instance
@throws InstantiationException Error instantiating
@throws IllegalAccessException Access error
@throws IntrospectionException ... | [
"Builds",
"a",
"instance",
"of",
"the",
"class",
"for",
"a",
"map",
"containing",
"the",
"values"
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/reflection/MyReflectionUtils.java#L68-L106 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/JobServiceClient.java | JobServiceClient.listJobs | public final ListJobsPagedResponse listJobs(String parent, String filter) {
"""
Lists jobs by filter.
<p>Sample code:
<pre><code>
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
TenantOrProjectName parent = TenantName.of("[PROJECT]", "[TENANT]");
String filter = "";
for (Job element... | java | public final ListJobsPagedResponse listJobs(String parent, String filter) {
ListJobsRequest request =
ListJobsRequest.newBuilder().setParent(parent).setFilter(filter).build();
return listJobs(request);
} | [
"public",
"final",
"ListJobsPagedResponse",
"listJobs",
"(",
"String",
"parent",
",",
"String",
"filter",
")",
"{",
"ListJobsRequest",
"request",
"=",
"ListJobsRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",
"setFilter",
"(",
... | Lists jobs by filter.
<p>Sample code:
<pre><code>
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
TenantOrProjectName parent = TenantName.of("[PROJECT]", "[TENANT]");
String filter = "";
for (Job element : jobServiceClient.listJobs(parent.toString(), filter).iterateAll()) {
// doThingsWith(eleme... | [
"Lists",
"jobs",
"by",
"filter",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/JobServiceClient.java#L642-L646 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsContainerElementBean.java | CmsContainerElementBean.cloneWithFormatter | public static CmsContainerElementBean cloneWithFormatter(CmsContainerElementBean source, CmsUUID formatterId) {
"""
Clones the given element bean with a different formatter.<p>
@param source the element to clone
@param formatterId the new formatter id
@return the element bean
"""
CmsContainerEl... | java | public static CmsContainerElementBean cloneWithFormatter(CmsContainerElementBean source, CmsUUID formatterId) {
CmsContainerElementBean result = source.clone();
result.m_formatterId = formatterId;
return result;
} | [
"public",
"static",
"CmsContainerElementBean",
"cloneWithFormatter",
"(",
"CmsContainerElementBean",
"source",
",",
"CmsUUID",
"formatterId",
")",
"{",
"CmsContainerElementBean",
"result",
"=",
"source",
".",
"clone",
"(",
")",
";",
"result",
".",
"m_formatterId",
"="... | Clones the given element bean with a different formatter.<p>
@param source the element to clone
@param formatterId the new formatter id
@return the element bean | [
"Clones",
"the",
"given",
"element",
"bean",
"with",
"a",
"different",
"formatter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsContainerElementBean.java#L211-L216 |
to2mbn/JMCCC | jmccc/src/main/java/org/to2mbn/jmccc/util/ExtraArgumentsTemplates.java | ExtraArgumentsTemplates.OSX_DOCK_ICON | public static String OSX_DOCK_ICON(MinecraftDirectory minecraftDir, Version version) throws IOException {
"""
Caution: This option is available only on OSX.
@param minecraftDir the minecraft directory
@param version the minecraft version
@return a <code>-Xdock:icon</code> option, null if the assets cannot be ... | java | public static String OSX_DOCK_ICON(MinecraftDirectory minecraftDir, Version version) throws IOException {
Set<Asset> assetIndex = Versions.resolveAssets(minecraftDir, version);
if (assetIndex == null)
return null;
return OSX_DOCK_ICON(minecraftDir, assetIndex);
} | [
"public",
"static",
"String",
"OSX_DOCK_ICON",
"(",
"MinecraftDirectory",
"minecraftDir",
",",
"Version",
"version",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"Asset",
">",
"assetIndex",
"=",
"Versions",
".",
"resolveAssets",
"(",
"minecraftDir",
",",
"versio... | Caution: This option is available only on OSX.
@param minecraftDir the minecraft directory
@param version the minecraft version
@return a <code>-Xdock:icon</code> option, null if the assets cannot be resolved
@throws IOException if an I/O error has occurred during resolving asset index
@see #OSX_DOCK_ICON(MinecraftDir... | [
"Caution",
":",
"This",
"option",
"is",
"available",
"only",
"on",
"OSX",
"."
] | train | https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc/src/main/java/org/to2mbn/jmccc/util/ExtraArgumentsTemplates.java#L63-L69 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/SerializeInterceptor.java | SerializeInterceptor.getMime | private String getMime(String name, String delimiter) {
"""
Method get the mime value from the given file name
@param name the filename
@param delimiter the delimiter
@return String the mime value
"""
if (StringUtils.hasText(name)) {
return name.substring(name.lastIndexOf(delimiter), name.length());
... | java | private String getMime(String name, String delimiter) {
if (StringUtils.hasText(name)) {
return name.substring(name.lastIndexOf(delimiter), name.length());
}
return null;
} | [
"private",
"String",
"getMime",
"(",
"String",
"name",
",",
"String",
"delimiter",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"name",
")",
")",
"{",
"return",
"name",
".",
"substring",
"(",
"name",
".",
"lastIndexOf",
"(",
"delimiter",
")",... | Method get the mime value from the given file name
@param name the filename
@param delimiter the delimiter
@return String the mime value | [
"Method",
"get",
"the",
"mime",
"value",
"from",
"the",
"given",
"file",
"name"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/SerializeInterceptor.java#L203-L208 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/core/DictionaryFactory.java | DictionaryFactory.createSingletonDictionary | public static ADictionary createSingletonDictionary(JcsegTaskConfig config, boolean loadDic) {
"""
create a singleton ADictionary object according to the JcsegTaskConfig
@param config
@param loadDic
@return ADictionary
"""
synchronized (LOCK) {
if ( singletonDic == null ) {
... | java | public static ADictionary createSingletonDictionary(JcsegTaskConfig config, boolean loadDic)
{
synchronized (LOCK) {
if ( singletonDic == null ) {
singletonDic = createDefaultDictionary(config, loadDic);
}
}
return singletonDic;
} | [
"public",
"static",
"ADictionary",
"createSingletonDictionary",
"(",
"JcsegTaskConfig",
"config",
",",
"boolean",
"loadDic",
")",
"{",
"synchronized",
"(",
"LOCK",
")",
"{",
"if",
"(",
"singletonDic",
"==",
"null",
")",
"{",
"singletonDic",
"=",
"createDefaultDict... | create a singleton ADictionary object according to the JcsegTaskConfig
@param config
@param loadDic
@return ADictionary | [
"create",
"a",
"singleton",
"ADictionary",
"object",
"according",
"to",
"the",
"JcsegTaskConfig"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/core/DictionaryFactory.java#L147-L156 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java | ByteUtils.bytesToBool | public static final boolean bytesToBool( byte[] data, int[] offset ) {
"""
Return the <code>boolean</code> represented by the bytes in
<code>data</code> staring at offset <code>offset[0]</code>.
@param data the array from which to read
@param offset A single element array whose first element is the index in
... | java | public static final boolean bytesToBool( byte[] data, int[] offset ) {
boolean result = true;
if (data[offset[0]] == 0) {
result = false;
}
offset[0] += SIZE_BOOL;
return result;
} | [
"public",
"static",
"final",
"boolean",
"bytesToBool",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"[",
"]",
"offset",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"if",
"(",
"data",
"[",
"offset",
"[",
"0",
"]",
"]",
"==",
"0",
")",
"{",
"res... | Return the <code>boolean</code> represented by the bytes in
<code>data</code> staring at offset <code>offset[0]</code>.
@param data the array from which to read
@param offset A single element array whose first element is the index in
data from which to begin reading on function entry, and which
on function exit has b... | [
"Return",
"the",
"<code",
">",
"boolean<",
"/",
"code",
">",
"represented",
"by",
"the",
"bytes",
"in",
"<code",
">",
"data<",
"/",
"code",
">",
"staring",
"at",
"offset",
"<code",
">",
"offset",
"[",
"0",
"]",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L312-L322 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java | ExtendedListeningPoint.createContactHeader | public ContactHeader createContactHeader(String displayName, String userName, boolean usePublicAddress, String outboundInterface) {
"""
Create a Contact Header based on the host, port and transport of this listening point
@param usePublicAddress if true, the host will be the global ip address found by STUN otherw... | java | public ContactHeader createContactHeader(String displayName, String userName, boolean usePublicAddress, String outboundInterface) {
try {
// FIXME : the SIP URI can be cached to improve performance
String host = null;
if(outboundInterface!=null){
javax.sip.address.SipURI outboundInterfaceURI = (javax.si... | [
"public",
"ContactHeader",
"createContactHeader",
"(",
"String",
"displayName",
",",
"String",
"userName",
",",
"boolean",
"usePublicAddress",
",",
"String",
"outboundInterface",
")",
"{",
"try",
"{",
"// FIXME : the SIP URI can be cached to improve performance ",
"String",
... | Create a Contact Header based on the host, port and transport of this listening point
@param usePublicAddress if true, the host will be the global ip address found by STUN otherwise
it will be the local network interface ipaddress
@param displayName the display name to use
@param outboundInterface the outbound interfac... | [
"Create",
"a",
"Contact",
"Header",
"based",
"on",
"the",
"host",
"port",
"and",
"transport",
"of",
"this",
"listening",
"point"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java#L143-L174 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.unsetAsynchConsumerCallback | public void unsetAsynchConsumerCallback(int requestNumber, boolean stoppable) //SIB0115d.comms {
"""
This method will unset the asynch consumer callback. This means that the
client has requested that the session should be converted from asynchronous to
synchronous and so the sub consumer m... | java | public void unsetAsynchConsumerCallback(int requestNumber, boolean stoppable) //SIB0115d.comms
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unsetAsynchConsumerCallback", "requestNumber="+requestNumber+",stoppable="+stoppable);
checkNotB... | [
"public",
"void",
"unsetAsynchConsumerCallback",
"(",
"int",
"requestNumber",
",",
"boolean",
"stoppable",
")",
"//SIB0115d.comms",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
... | This method will unset the asynch consumer callback. This means that the
client has requested that the session should be converted from asynchronous to
synchronous and so the sub consumer must be changed
@param requestNumber | [
"This",
"method",
"will",
"unset",
"the",
"asynch",
"consumer",
"callback",
".",
"This",
"means",
"that",
"the",
"client",
"has",
"requested",
"that",
"the",
"session",
"should",
"be",
"converted",
"from",
"asynchronous",
"to",
"synchronous",
"and",
"so",
"the... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L594-L608 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getIterationPerformanceWithServiceResponseAsync | public Observable<ServiceResponse<IterationPerformance>> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) {
"""
Get detailed performance information about an iteration.
@param projectId The id of ... | java | public Observable<ServiceResponse<IterationPerformance>> getIterationPerformanceWithServiceResponseAsync(UUID projectId, UUID iterationId, GetIterationPerformanceOptionalParameter getIterationPerformanceOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter proje... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"IterationPerformance",
">",
">",
"getIterationPerformanceWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"iterationId",
",",
"GetIterationPerformanceOptionalParameter",
"getIterationPerformanceOptionalParameter... | Get detailed performance information about an iteration.
@param projectId The id of the project the iteration belongs to
@param iterationId The id of the iteration to get
@param getIterationPerformanceOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArg... | [
"Get",
"detailed",
"performance",
"information",
"about",
"an",
"iteration",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L1661-L1675 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.createStream | public CreateStreamResponse createStream(CreateStreamRequest request) {
"""
Create a domain stream in the live stream service.
@param request The request object containing all options for creating domain stream
@return the response
"""
checkNotNull(request, "The parameter request should NOT be null... | java | public CreateStreamResponse createStream(CreateStreamRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getPlayDomain(), "playDomain should NOT be empty.");
checkStringNotEmpty(request.getApp(), "app should NOT be empty.");
... | [
"public",
"CreateStreamResponse",
"createStream",
"(",
"CreateStreamRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getPlayDomain",
"(",
")",
",",
... | Create a domain stream in the live stream service.
@param request The request object containing all options for creating domain stream
@return the response | [
"Create",
"a",
"domain",
"stream",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1358-L1369 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java | CudaAffinityManager.tagLocation | @Override
public void tagLocation(INDArray array, Location location) {
"""
This method marks given INDArray as actual in specific location (either host, device, or both)
@param array
@param location
"""
if (location == Location.HOST)
AtomicAllocator.getInstance().getAllocationPoint(... | java | @Override
public void tagLocation(INDArray array, Location location) {
if (location == Location.HOST)
AtomicAllocator.getInstance().getAllocationPoint(array).tickHostWrite();
else if (location == Location.DEVICE)
AtomicAllocator.getInstance().getAllocationPoint(array).tickDev... | [
"@",
"Override",
"public",
"void",
"tagLocation",
"(",
"INDArray",
"array",
",",
"Location",
"location",
")",
"{",
"if",
"(",
"location",
"==",
"Location",
".",
"HOST",
")",
"AtomicAllocator",
".",
"getInstance",
"(",
")",
".",
"getAllocationPoint",
"(",
"ar... | This method marks given INDArray as actual in specific location (either host, device, or both)
@param array
@param location | [
"This",
"method",
"marks",
"given",
"INDArray",
"as",
"actual",
"in",
"specific",
"location",
"(",
"either",
"host",
"device",
"or",
"both",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java#L339-L349 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/ScriptUtils.java | ScriptUtils.readScript | public static String readScript(final String resourceName) throws IOException {
"""
Read a script into a single-line string suitable for use in a Redis <code>EVAL</code> statement.
@param resourceName the name of the script resource to read
@return the string form of the script
@throws IOException if something ... | java | public static String readScript(final String resourceName) throws IOException {
final StringBuilder buf = new StringBuilder();
try (final InputStream inputStream = ScriptUtils.class.getResourceAsStream(resourceName)) {
if (inputStream == null) {
throw new IOException("Could n... | [
"public",
"static",
"String",
"readScript",
"(",
"final",
"String",
"resourceName",
")",
"throws",
"IOException",
"{",
"final",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"(",
"final",
"InputStream",
"inputStream",
"=",
"ScriptUti... | Read a script into a single-line string suitable for use in a Redis <code>EVAL</code> statement.
@param resourceName the name of the script resource to read
@return the string form of the script
@throws IOException if something goes wrong | [
"Read",
"a",
"script",
"into",
"a",
"single",
"-",
"line",
"string",
"suitable",
"for",
"use",
"in",
"a",
"Redis",
"<code",
">",
"EVAL<",
"/",
"code",
">",
"statement",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/ScriptUtils.java#L35-L55 |
jpmml/jpmml-evaluator | pmml-evaluator/src/main/java/org/jpmml/evaluator/TypeUtil.java | TypeUtil.toDouble | static
private Double toDouble(Object value) {
"""
<p>
Casts the specified value to Double data type.
</p>
@see DataType#DOUBLE
"""
if(value instanceof Double){
return (Double)value;
} else
if((value instanceof Float) || (value instanceof Long) || (value instanceof Integer) || (value instanceo... | java | static
private Double toDouble(Object value){
if(value instanceof Double){
return (Double)value;
} else
if((value instanceof Float) || (value instanceof Long) || (value instanceof Integer) || (value instanceof Short) || (value instanceof Byte)){
Number number = (Number)value;
return toDouble(number.d... | [
"static",
"private",
"Double",
"toDouble",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Double",
")",
"{",
"return",
"(",
"Double",
")",
"value",
";",
"}",
"else",
"if",
"(",
"(",
"value",
"instanceof",
"Float",
")",
"||",
"(",
... | <p>
Casts the specified value to Double data type.
</p>
@see DataType#DOUBLE | [
"<p",
">",
"Casts",
"the",
"specified",
"value",
"to",
"Double",
"data",
"type",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/jpmml/jpmml-evaluator/blob/ac8a48775877b6fa9dbc5f259871f3278489cc61/pmml-evaluator/src/main/java/org/jpmml/evaluator/TypeUtil.java#L688-L714 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java | AbstractCachedGenerator.addLinkedResources | protected void addLinkedResources(String path, GeneratorContext context, FilePathMapping fMapping) {
"""
Adds the linked resource to the linked resource map
@param path
the resource path
@param context
the generator context
@param fMapping
the file path mapping linked to the resource
"""
addLinkedRes... | java | protected void addLinkedResources(String path, GeneratorContext context, FilePathMapping fMapping) {
addLinkedResources(path, context, Arrays.asList(fMapping));
} | [
"protected",
"void",
"addLinkedResources",
"(",
"String",
"path",
",",
"GeneratorContext",
"context",
",",
"FilePathMapping",
"fMapping",
")",
"{",
"addLinkedResources",
"(",
"path",
",",
"context",
",",
"Arrays",
".",
"asList",
"(",
"fMapping",
")",
")",
";",
... | Adds the linked resource to the linked resource map
@param path
the resource path
@param context
the generator context
@param fMapping
the file path mapping linked to the resource | [
"Adds",
"the",
"linked",
"resource",
"to",
"the",
"linked",
"resource",
"map"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java#L361-L363 |
optimaize/anythingworks | client/rest/src/main/java/com/optimaize/anythingworks/client/rest/http/HeaderParams.java | HeaderParams.put | public HeaderParams put(String name, String value) {
"""
Overwrites in case there is a value already associated with that name.
@return the same instance
"""
values.put(cleanAndValidate(name), cleanAndValidate(value));
return this;
} | java | public HeaderParams put(String name, String value) {
values.put(cleanAndValidate(name), cleanAndValidate(value));
return this;
} | [
"public",
"HeaderParams",
"put",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"values",
".",
"put",
"(",
"cleanAndValidate",
"(",
"name",
")",
",",
"cleanAndValidate",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Overwrites in case there is a value already associated with that name.
@return the same instance | [
"Overwrites",
"in",
"case",
"there",
"is",
"a",
"value",
"already",
"associated",
"with",
"that",
"name",
"."
] | train | https://github.com/optimaize/anythingworks/blob/23e5f1c63cd56d935afaac4ad033c7996b32a1f2/client/rest/src/main/java/com/optimaize/anythingworks/client/rest/http/HeaderParams.java#L47-L50 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.publishVideoReviewAsync | public Observable<Void> publishVideoReviewAsync(String teamName, String reviewId) {
"""
Publish video review to make it available for review.
@param teamName Your team name.
@param reviewId Id of the review.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceR... | java | public Observable<Void> publishVideoReviewAsync(String teamName, String reviewId) {
return publishVideoReviewWithServiceResponseAsync(teamName, reviewId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return res... | [
"public",
"Observable",
"<",
"Void",
">",
"publishVideoReviewAsync",
"(",
"String",
"teamName",
",",
"String",
"reviewId",
")",
"{",
"return",
"publishVideoReviewWithServiceResponseAsync",
"(",
"teamName",
",",
"reviewId",
")",
".",
"map",
"(",
"new",
"Func1",
"<"... | Publish video review to make it available for review.
@param teamName Your team name.
@param reviewId Id of the review.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Publish",
"video",
"review",
"to",
"make",
"it",
"available",
"for",
"review",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L1635-L1642 |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/ScalarizationUtils.java | ScalarizationUtils.weightedProduct | public static <S extends Solution<?>> void weightedProduct(List<S> solutionsList, double[] weights) {
"""
Objectives are exponentiated by a positive weight and afterwards
multiplied.
@param solutionsList A list of solutions.
@param weights Weights by objectives are exponentiated
"""
for (S solu... | java | public static <S extends Solution<?>> void weightedProduct(List<S> solutionsList, double[] weights) {
for (S solution : solutionsList) {
double product = Math.pow(solution.getObjective(0), weights[0]);
for (int i = 1; i < solution.getNumberOfObjectives(); i++) {
product *= Math.pow(solution.... | [
"public",
"static",
"<",
"S",
"extends",
"Solution",
"<",
"?",
">",
">",
"void",
"weightedProduct",
"(",
"List",
"<",
"S",
">",
"solutionsList",
",",
"double",
"[",
"]",
"weights",
")",
"{",
"for",
"(",
"S",
"solution",
":",
"solutionsList",
")",
"{",
... | Objectives are exponentiated by a positive weight and afterwards
multiplied.
@param solutionsList A list of solutions.
@param weights Weights by objectives are exponentiated | [
"Objectives",
"are",
"exponentiated",
"by",
"a",
"positive",
"weight",
"and",
"afterwards",
"multiplied",
"."
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/ScalarizationUtils.java#L161-L169 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listPreparationAndReleaseTaskStatusAsync | public ServiceFuture<List<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusAsync(final String jobId, final ListOperationCallback<JobPreparationAndReleaseTaskExecutionInformation> serviceCallback) {
"""
Lists the execution status of the Job Preparation and Job Release task for t... | java | public ServiceFuture<List<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusAsync(final String jobId, final ListOperationCallback<JobPreparationAndReleaseTaskExecutionInformation> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listPreparation... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"JobPreparationAndReleaseTaskExecutionInformation",
">",
">",
"listPreparationAndReleaseTaskStatusAsync",
"(",
"final",
"String",
"jobId",
",",
"final",
"ListOperationCallback",
"<",
"JobPreparationAndReleaseTaskExecutionInformation",
... | Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.
This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since b... | [
"Lists",
"the",
"execution",
"status",
"of",
"the",
"Job",
"Preparation",
"and",
"Job",
"Release",
"task",
"for",
"the",
"specified",
"job",
"across",
"the",
"compute",
"nodes",
"where",
"the",
"job",
"has",
"run",
".",
"This",
"API",
"returns",
"the",
"Jo... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L2833-L2843 |
google/gson | codegen/src/main/java/com/google/gson/codegen/JavaWriter.java | JavaWriter.beginType | public void beginType(String type, String kind, int modifiers) throws IOException {
"""
Emits a type declaration.
@param kind such as "class", "interface" or "enum".
"""
beginType(type, kind, modifiers, null);
} | java | public void beginType(String type, String kind, int modifiers) throws IOException {
beginType(type, kind, modifiers, null);
} | [
"public",
"void",
"beginType",
"(",
"String",
"type",
",",
"String",
"kind",
",",
"int",
"modifiers",
")",
"throws",
"IOException",
"{",
"beginType",
"(",
"type",
",",
"kind",
",",
"modifiers",
",",
"null",
")",
";",
"}"
] | Emits a type declaration.
@param kind such as "class", "interface" or "enum". | [
"Emits",
"a",
"type",
"declaration",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/codegen/src/main/java/com/google/gson/codegen/JavaWriter.java#L134-L136 |
FrodeRanders/java-vopn | src/main/java/org/gautelis/vopn/xml/XPath.java | XPath.getElementFrom | public OMElement getElementFrom(OMNode element, String expression) throws XmlException {
"""
/*
Upon failure to find element, the default behaviour is to throw an exception.
"""
return getElementFrom(element, namespaces, expression, /* accept failure? */ false);
} | java | public OMElement getElementFrom(OMNode element, String expression) throws XmlException {
return getElementFrom(element, namespaces, expression, /* accept failure? */ false);
} | [
"public",
"OMElement",
"getElementFrom",
"(",
"OMNode",
"element",
",",
"String",
"expression",
")",
"throws",
"XmlException",
"{",
"return",
"getElementFrom",
"(",
"element",
",",
"namespaces",
",",
"expression",
",",
"/* accept failure? */",
"false",
")",
";",
"... | /*
Upon failure to find element, the default behaviour is to throw an exception. | [
"/",
"*",
"Upon",
"failure",
"to",
"find",
"element",
"the",
"default",
"behaviour",
"is",
"to",
"throw",
"an",
"exception",
"."
] | train | https://github.com/FrodeRanders/java-vopn/blob/4c7b2f90201327af4eaa3cd46b3fee68f864e5cc/src/main/java/org/gautelis/vopn/xml/XPath.java#L95-L97 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/ResourceHandle.java | ResourceHandle.findUpwards | public ResourceHandle findUpwards(String basePath, Pattern namePattern, String childType) {
"""
Retrieves a child of this resource or a parent specified by its base path, name pattern and type; for example
findUpwards("jcr:content", Pattern.compile("^some.*$"), "sling:Folder").
"""
ResourceHandle curr... | java | public ResourceHandle findUpwards(String basePath, Pattern namePattern, String childType) {
ResourceHandle current = this;
while (current != null && current.isValid()) {
ResourceHandle base = ResourceHandle.use(current.getChild(basePath));
if (base.isValid()) {
fo... | [
"public",
"ResourceHandle",
"findUpwards",
"(",
"String",
"basePath",
",",
"Pattern",
"namePattern",
",",
"String",
"childType",
")",
"{",
"ResourceHandle",
"current",
"=",
"this",
";",
"while",
"(",
"current",
"!=",
"null",
"&&",
"current",
".",
"isValid",
"(... | Retrieves a child of this resource or a parent specified by its base path, name pattern and type; for example
findUpwards("jcr:content", Pattern.compile("^some.*$"), "sling:Folder"). | [
"Retrieves",
"a",
"child",
"of",
"this",
"resource",
"or",
"a",
"parent",
"specified",
"by",
"its",
"base",
"path",
"name",
"pattern",
"and",
"type",
";",
"for",
"example",
"findUpwards",
"(",
"jcr",
":",
"content",
"Pattern",
".",
"compile",
"(",
"^some",... | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/ResourceHandle.java#L426-L440 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/ser/bean/ObjectIdSerializer.java | ObjectIdSerializer.serializeId | public void serializeId( JsonWriter writer, JsonSerializationContext ctx ) {
"""
<p>serializeId</p>
@param writer a {@link com.github.nmorel.gwtjackson.client.stream.JsonWriter} object.
@param ctx a {@link com.github.nmorel.gwtjackson.client.JsonSerializationContext} object.
"""
serializer.serializ... | java | public void serializeId( JsonWriter writer, JsonSerializationContext ctx ) {
serializer.serialize( writer, id, ctx );
} | [
"public",
"void",
"serializeId",
"(",
"JsonWriter",
"writer",
",",
"JsonSerializationContext",
"ctx",
")",
"{",
"serializer",
".",
"serialize",
"(",
"writer",
",",
"id",
",",
"ctx",
")",
";",
"}"
] | <p>serializeId</p>
@param writer a {@link com.github.nmorel.gwtjackson.client.stream.JsonWriter} object.
@param ctx a {@link com.github.nmorel.gwtjackson.client.JsonSerializationContext} object. | [
"<p",
">",
"serializeId<",
"/",
"p",
">"
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/ser/bean/ObjectIdSerializer.java#L52-L54 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/Terminals.java | Terminals.caseSensitive | @Deprecated
public static Terminals caseSensitive(String[] ops, String[] keywords) {
"""
Returns a {@link Terminals} object for lexing and parsing the operators with names specified in
{@code ops}, and for lexing and parsing the keywords case sensitively. Parsers for operators
and keywords can be obtained thro... | java | @Deprecated
public static Terminals caseSensitive(String[] ops, String[] keywords) {
return operators(ops).words(Scanners.IDENTIFIER).keywords(asList(keywords)).build();
} | [
"@",
"Deprecated",
"public",
"static",
"Terminals",
"caseSensitive",
"(",
"String",
"[",
"]",
"ops",
",",
"String",
"[",
"]",
"keywords",
")",
"{",
"return",
"operators",
"(",
"ops",
")",
".",
"words",
"(",
"Scanners",
".",
"IDENTIFIER",
")",
".",
"keywo... | Returns a {@link Terminals} object for lexing and parsing the operators with names specified in
{@code ops}, and for lexing and parsing the keywords case sensitively. Parsers for operators
and keywords can be obtained through {@link #token}; parsers for identifiers through
{@link #identifier}.
<p>In detail, keywords a... | [
"Returns",
"a",
"{",
"@link",
"Terminals",
"}",
"object",
"for",
"lexing",
"and",
"parsing",
"the",
"operators",
"with",
"names",
"specified",
"in",
"{",
"@code",
"ops",
"}",
"and",
"for",
"lexing",
"and",
"parsing",
"the",
"keywords",
"case",
"sensitively",... | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Terminals.java#L267-L270 |
ykrasik/jaci | jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionUtils.java | ReflectionUtils.assertReturnValue | public static void assertReturnValue(ReflectionMethod method, Class<?> expectedReturnType) {
"""
Assert that the given method returns the expected return type.
@param method Method to assert.
@param expectedReturnType Expected return type of the method.
@throws IllegalArgumentException If the method's return ... | java | public static void assertReturnValue(ReflectionMethod method, Class<?> expectedReturnType) {
final Class<?> returnType = method.getReturnType();
if (returnType != expectedReturnType) {
final String message = "Class='"+method.getDeclaringClass()+"', method='"+method.getName()+"': Must return ... | [
"public",
"static",
"void",
"assertReturnValue",
"(",
"ReflectionMethod",
"method",
",",
"Class",
"<",
"?",
">",
"expectedReturnType",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"returnType",
"=",
"method",
".",
"getReturnType",
"(",
")",
";",
"if",
"(",
"... | Assert that the given method returns the expected return type.
@param method Method to assert.
@param expectedReturnType Expected return type of the method.
@throws IllegalArgumentException If the method's return type doesn't match the expected type. | [
"Assert",
"that",
"the",
"given",
"method",
"returns",
"the",
"expected",
"return",
"type",
"."
] | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionUtils.java#L207-L213 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.optionsAsync | public <T> CompletableFuture<T> optionsAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
"""
Executes an asynchronous OPTIONS request on the configured URI (asynchronous alias to the `options(Class,Closure)` method), with additional
configuration provided by the configuration clos... | java | public <T> CompletableFuture<T> optionsAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
return CompletableFuture.supplyAsync(() -> options(type, closure), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"optionsAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"@",
"DelegatesTo",
"(",
"HttpConfig",
".",
"class",
")",
"final",
"Closure",
"closure",
")",
"{",
"return",
"CompletableFuture"... | Executes an asynchronous OPTIONS request on the configured URI (asynchronous alias to the `options(Class,Closure)` method), with additional
configuration provided by the configuration closure. The result will be cast to the specified `type`. A response to a OPTIONS request contains no
data; however, the `response.when(... | [
"Executes",
"an",
"asynchronous",
"OPTIONS",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"the",
"options",
"(",
"Class",
"Closure",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configur... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1956-L1958 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/price/PriceGraduation.java | PriceGraduation.createSimple | @Nonnull
public static IMutablePriceGraduation createSimple (@Nonnull final IMutablePrice aPrice) {
"""
Create a simple price graduation that contains one item with the minimum
quantity of 1.
@param aPrice
The price to use. May not be <code>null</code>.
@return Never <code>null</code>.
"""
final Pr... | java | @Nonnull
public static IMutablePriceGraduation createSimple (@Nonnull final IMutablePrice aPrice)
{
final PriceGraduation ret = new PriceGraduation (aPrice.getCurrency ());
ret.addItem (new PriceGraduationItem (1, aPrice.getNetAmount ().getValue ()));
return ret;
} | [
"@",
"Nonnull",
"public",
"static",
"IMutablePriceGraduation",
"createSimple",
"(",
"@",
"Nonnull",
"final",
"IMutablePrice",
"aPrice",
")",
"{",
"final",
"PriceGraduation",
"ret",
"=",
"new",
"PriceGraduation",
"(",
"aPrice",
".",
"getCurrency",
"(",
")",
")",
... | Create a simple price graduation that contains one item with the minimum
quantity of 1.
@param aPrice
The price to use. May not be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"simple",
"price",
"graduation",
"that",
"contains",
"one",
"item",
"with",
"the",
"minimum",
"quantity",
"of",
"1",
"."
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/price/PriceGraduation.java#L218-L224 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Maps.java | Maps.removeIf | public static <K, V, E extends Exception> boolean removeIf(final Map<K, V> map, final Try.Predicate<? super Map.Entry<K, V>, E> filter) throws E {
"""
Removes entries from the specified {@code map} by the the specified {@code filter}.
@param map
@param filter
@return {@code true} if there are one or more than... | java | public static <K, V, E extends Exception> boolean removeIf(final Map<K, V> map, final Try.Predicate<? super Map.Entry<K, V>, E> filter) throws E {
List<K> keysToRemove = null;
for (Map.Entry<K, V> entry : map.entrySet()) {
if (filter.test(entry)) {
if (keysToRemove == n... | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"E",
"extends",
"Exception",
">",
"boolean",
"removeIf",
"(",
"final",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"Try",
".",
"Predicate",
"<",
"?",
"super",
"Map",
".",
"Entry",
"<",
"K",
",... | Removes entries from the specified {@code map} by the the specified {@code filter}.
@param map
@param filter
@return {@code true} if there are one or more than one entries removed from the specified map.
@throws E | [
"Removes",
"entries",
"from",
"the",
"specified",
"{",
"@code",
"map",
"}",
"by",
"the",
"the",
"specified",
"{",
"@code",
"filter",
"}",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Maps.java#L599-L621 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/SharedFlowController.java | SharedFlowController.getPreviousPageInfoLegacy | public PreviousPageInfo getPreviousPageInfoLegacy( PageFlowController curJpf, HttpServletRequest request ) {
"""
Get a legacy PreviousPageInfo.
@deprecated This method will be removed without replacement in a future release.
"""
assert curJpf != null;
return curJpf.getCurrentPageInfo(); ... | java | public PreviousPageInfo getPreviousPageInfoLegacy( PageFlowController curJpf, HttpServletRequest request )
{
assert curJpf != null;
return curJpf.getCurrentPageInfo();
} | [
"public",
"PreviousPageInfo",
"getPreviousPageInfoLegacy",
"(",
"PageFlowController",
"curJpf",
",",
"HttpServletRequest",
"request",
")",
"{",
"assert",
"curJpf",
"!=",
"null",
";",
"return",
"curJpf",
".",
"getCurrentPageInfo",
"(",
")",
";",
"}"
] | Get a legacy PreviousPageInfo.
@deprecated This method will be removed without replacement in a future release. | [
"Get",
"a",
"legacy",
"PreviousPageInfo",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/SharedFlowController.java#L172-L176 |
kuali/ojb-1.0.4 | src/jdori/org/apache/ojb/jdori/sql/OjbExtent.java | OjbExtent.provideStateManagers | protected Collection provideStateManagers(Collection pojos) {
"""
This methods enhances the objects loaded by a broker query
with a JDO StateManager an brings them under JDO control.
@param pojos the OJB pojos as obtained by the broker
@return the collection of JDO PersistenceCapable instances
"""
Per... | java | protected Collection provideStateManagers(Collection pojos)
{
PersistenceCapable pc;
int [] fieldNums;
Iterator iter = pojos.iterator();
Collection result = new ArrayList();
while (iter.hasNext())
{
// obtain a StateManager
pc = (PersistenceCapable) iter.nex... | [
"protected",
"Collection",
"provideStateManagers",
"(",
"Collection",
"pojos",
")",
"{",
"PersistenceCapable",
"pc",
";",
"int",
"[",
"]",
"fieldNums",
";",
"Iterator",
"iter",
"=",
"pojos",
".",
"iterator",
"(",
")",
";",
"Collection",
"result",
"=",
"new",
... | This methods enhances the objects loaded by a broker query
with a JDO StateManager an brings them under JDO control.
@param pojos the OJB pojos as obtained by the broker
@return the collection of JDO PersistenceCapable instances | [
"This",
"methods",
"enhances",
"the",
"objects",
"loaded",
"by",
"a",
"broker",
"query",
"with",
"a",
"JDO",
"StateManager",
"an",
"brings",
"them",
"under",
"JDO",
"control",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/jdori/org/apache/ojb/jdori/sql/OjbExtent.java#L120-L147 |
junit-team/junit4 | src/main/java/org/junit/runner/notification/RunNotifier.java | RunNotifier.wrapIfNotThreadSafe | RunListener wrapIfNotThreadSafe(RunListener listener) {
"""
Wraps the given listener with {@link SynchronizedRunListener} if
it is not annotated with {@link RunListener.ThreadSafe}.
"""
return listener.getClass().isAnnotationPresent(RunListener.ThreadSafe.class) ?
listener : new Synchr... | java | RunListener wrapIfNotThreadSafe(RunListener listener) {
return listener.getClass().isAnnotationPresent(RunListener.ThreadSafe.class) ?
listener : new SynchronizedRunListener(listener, this);
} | [
"RunListener",
"wrapIfNotThreadSafe",
"(",
"RunListener",
"listener",
")",
"{",
"return",
"listener",
".",
"getClass",
"(",
")",
".",
"isAnnotationPresent",
"(",
"RunListener",
".",
"ThreadSafe",
".",
"class",
")",
"?",
"listener",
":",
"new",
"SynchronizedRunList... | Wraps the given listener with {@link SynchronizedRunListener} if
it is not annotated with {@link RunListener.ThreadSafe}. | [
"Wraps",
"the",
"given",
"listener",
"with",
"{"
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runner/notification/RunNotifier.java#L49-L52 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/ChainedTransformationTools.java | ChainedTransformationTools.transformAddress | public static PathAddress transformAddress(final PathAddress original, final TransformationTarget target) {
"""
Transform a path address.
@param original the path address to be transformed
@param target the transformation target
@return the transformed path address
"""
return TransformersImpl.tran... | java | public static PathAddress transformAddress(final PathAddress original, final TransformationTarget target) {
return TransformersImpl.transformAddress(original, target);
} | [
"public",
"static",
"PathAddress",
"transformAddress",
"(",
"final",
"PathAddress",
"original",
",",
"final",
"TransformationTarget",
"target",
")",
"{",
"return",
"TransformersImpl",
".",
"transformAddress",
"(",
"original",
",",
"target",
")",
";",
"}"
] | Transform a path address.
@param original the path address to be transformed
@param target the transformation target
@return the transformed path address | [
"Transform",
"a",
"path",
"address",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/ChainedTransformationTools.java#L90-L92 |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseAJAXMoskitoUIAction.java | BaseAJAXMoskitoUIAction.writeTextToResponse | private static void writeTextToResponse(final HttpServletResponse res, final String text) throws IOException {
"""
Writes specified text to response and flushes the stream.
@param res
{@link HttpServletRequest}
@param text
{@link String}
@throws java.io.IOException
if an input or output exception occurred
... | java | private static void writeTextToResponse(final HttpServletResponse res, final String text) throws IOException {
res.setCharacterEncoding(UTF_8);
res.setContentType(TEXT_X_JSON);
PrintWriter writer = res.getWriter();
writer.write(text);
writer.flush();
} | [
"private",
"static",
"void",
"writeTextToResponse",
"(",
"final",
"HttpServletResponse",
"res",
",",
"final",
"String",
"text",
")",
"throws",
"IOException",
"{",
"res",
".",
"setCharacterEncoding",
"(",
"UTF_8",
")",
";",
"res",
".",
"setContentType",
"(",
"TEX... | Writes specified text to response and flushes the stream.
@param res
{@link HttpServletRequest}
@param text
{@link String}
@throws java.io.IOException
if an input or output exception occurred | [
"Writes",
"specified",
"text",
"to",
"response",
"and",
"flushes",
"the",
"stream",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/shared/action/BaseAJAXMoskitoUIAction.java#L112-L118 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.