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 |
|---|---|---|---|---|---|---|---|---|---|---|
att/AAF | authz/authz-core/src/main/java/com/att/cssa/rserv/Route.java | Route.contentRelatedTo | public String contentRelatedTo(HttpCode<TRANS, ?> code) {
"""
contentRelatedTo (For reporting) list routes that will end up at a specific Code
@return
"""
StringBuilder sb = new StringBuilder(path);
sb.append(' ');
content.relatedTo(code, sb);
return sb.toString();
} | java | public String contentRelatedTo(HttpCode<TRANS, ?> code) {
StringBuilder sb = new StringBuilder(path);
sb.append(' ');
content.relatedTo(code, sb);
return sb.toString();
} | [
"public",
"String",
"contentRelatedTo",
"(",
"HttpCode",
"<",
"TRANS",
",",
"?",
">",
"code",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"path",
")",
";",
"sb",
".",
"append",
"(",
"'",
"'",
")",
";",
"content",
".",
"relatedTo"... | contentRelatedTo (For reporting) list routes that will end up at a specific Code
@return | [
"contentRelatedTo",
"(",
"For",
"reporting",
")",
"list",
"routes",
"that",
"will",
"end",
"up",
"at",
"a",
"specific",
"Code"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-core/src/main/java/com/att/cssa/rserv/Route.java#L117-L122 |
facebookarchive/swift | swift-service/src/main/java/com/facebook/swift/service/ThriftClientManager.java | ThriftClientManager.getRequestChannel | public RequestChannel getRequestChannel(Object client) {
"""
Returns the {@link RequestChannel} backing a Swift client
@throws IllegalArgumentException if the client is not a Swift client
"""
try {
InvocationHandler genericHandler = Proxy.getInvocationHandler(client);
ThriftI... | java | public RequestChannel getRequestChannel(Object client)
{
try {
InvocationHandler genericHandler = Proxy.getInvocationHandler(client);
ThriftInvocationHandler thriftHandler = (ThriftInvocationHandler) genericHandler;
return thriftHandler.getChannel();
}
cat... | [
"public",
"RequestChannel",
"getRequestChannel",
"(",
"Object",
"client",
")",
"{",
"try",
"{",
"InvocationHandler",
"genericHandler",
"=",
"Proxy",
".",
"getInvocationHandler",
"(",
"client",
")",
";",
"ThriftInvocationHandler",
"thriftHandler",
"=",
"(",
"ThriftInvo... | Returns the {@link RequestChannel} backing a Swift client
@throws IllegalArgumentException if the client is not a Swift client | [
"Returns",
"the",
"{",
"@link",
"RequestChannel",
"}",
"backing",
"a",
"Swift",
"client"
] | train | https://github.com/facebookarchive/swift/blob/3f1f098a50d6106f50cd6fe1c361dd373ede0197/swift-service/src/main/java/com/facebook/swift/service/ThriftClientManager.java#L300-L310 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceMessages.java | CmsWorkplaceMessages.getNewResourceTitle | public static String getNewResourceTitle(CmsWorkplace wp, String name) {
"""
Returns the title for the "new resource" dialog.<p>
It will look up a key with the prefix {@link #GUI_NEW_RESOURCE_TITLE_PREFIX}
and the given name appended (converted to lower case).<p>
If this key is not found, the value of
{@li... | java | public static String getNewResourceTitle(CmsWorkplace wp, String name) {
// try to find the localized key
String title = wp.key(GUI_NEW_RESOURCE_TITLE_PREFIX + name.toLowerCase());
if (CmsMessages.isUnknownKey(title)) {
// still unknown - use default title
title = wp.key... | [
"public",
"static",
"String",
"getNewResourceTitle",
"(",
"CmsWorkplace",
"wp",
",",
"String",
"name",
")",
"{",
"// try to find the localized key",
"String",
"title",
"=",
"wp",
".",
"key",
"(",
"GUI_NEW_RESOURCE_TITLE_PREFIX",
"+",
"name",
".",
"toLowerCase",
"(",... | Returns the title for the "new resource" dialog.<p>
It will look up a key with the prefix {@link #GUI_NEW_RESOURCE_TITLE_PREFIX}
and the given name appended (converted to lower case).<p>
If this key is not found, the value of
{@link org.opencms.workplace.explorer.Messages#GUI_TITLE_NEWFILEOTHER_0} will be returned.<p... | [
"Returns",
"the",
"title",
"for",
"the",
"new",
"resource",
"dialog",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceMessages.java#L111-L120 |
m-m-m/util | cli/src/main/java/net/sf/mmm/util/cli/base/CliClassContainer.java | CliClassContainer.initializeModeRecursive | protected List<String> initializeModeRecursive(CliModeContainer mode) {
"""
This method initializes the given {@link CliModeContainer}.
@param mode is the {@link CliModeContainer} to initialize.
@return a {@link List} of {@link CliModeContainer#getId() CLI mode IDs} (in reverse order) of a cyclic dependency
t... | java | protected List<String> initializeModeRecursive(CliModeContainer mode) {
InitializationState state = mode.getState();
if (!state.isInitialized()) {
if (state.isInitializing()) {
// cycle detected
List<String> cycle = new ArrayList<>();
cycle.add(mode.getId());
return cycle;... | [
"protected",
"List",
"<",
"String",
">",
"initializeModeRecursive",
"(",
"CliModeContainer",
"mode",
")",
"{",
"InitializationState",
"state",
"=",
"mode",
".",
"getState",
"(",
")",
";",
"if",
"(",
"!",
"state",
".",
"isInitialized",
"(",
")",
")",
"{",
"... | This method initializes the given {@link CliModeContainer}.
@param mode is the {@link CliModeContainer} to initialize.
@return a {@link List} of {@link CliModeContainer#getId() CLI mode IDs} (in reverse order) of a cyclic dependency
that was detected, or {@code null} if the initialization was successful. | [
"This",
"method",
"initializes",
"the",
"given",
"{",
"@link",
"CliModeContainer",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/CliClassContainer.java#L123-L150 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java | WTabSet.addTab | public WTab addTab(final WComponent content, final WDecoratedLabel label, final TabMode mode) {
"""
Adds a tab to the tab set.
@param content the tab set content.
@param label the tab's label, which can contain rich content (images or other components).
@param mode the tab mode.
@return the tab which was add... | java | public WTab addTab(final WComponent content, final WDecoratedLabel label, final TabMode mode) {
return addTab(new WTab(content, label, mode, (char) 0));
} | [
"public",
"WTab",
"addTab",
"(",
"final",
"WComponent",
"content",
",",
"final",
"WDecoratedLabel",
"label",
",",
"final",
"TabMode",
"mode",
")",
"{",
"return",
"addTab",
"(",
"new",
"WTab",
"(",
"content",
",",
"label",
",",
"mode",
",",
"(",
"char",
"... | Adds a tab to the tab set.
@param content the tab set content.
@param label the tab's label, which can contain rich content (images or other components).
@param mode the tab mode.
@return the tab which was added to the tab set. | [
"Adds",
"a",
"tab",
"to",
"the",
"tab",
"set",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java#L275-L277 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java | RegistriesInner.regenerateCredentials | public RegistryCredentialsInner regenerateCredentials(String resourceGroupName, String registryName) {
"""
Regenerates the administrator login credentials for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName T... | java | public RegistryCredentialsInner regenerateCredentials(String resourceGroupName, String registryName) {
return regenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body();
} | [
"public",
"RegistryCredentialsInner",
"regenerateCredentials",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
")",
"{",
"return",
"regenerateCredentialsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
")",
".",
"toBlocking",
"(",
... | Regenerates the administrator login credentials for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@throw... | [
"Regenerates",
"the",
"administrator",
"login",
"credentials",
"for",
"the",
"specified",
"container",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java#L877-L879 |
trajano/caliper | caliper/src/main/java/com/google/caliper/runner/ServerSocketService.java | ServerSocketService.getInputStream | private static InputStream getInputStream(final Socket socket) throws IOException {
"""
Returns an {@link InputStream} for the socket, but unlike {@link Socket#getInputStream()}
when you call {@link InputStream#close() close} it only closes the input end of the socket
instead of the entire socket.
"""
fi... | java | private static InputStream getInputStream(final Socket socket) throws IOException {
final InputStream delegate = socket.getInputStream();
return new InputStream() {
@Override public void close() throws IOException {
synchronized (socket) {
socket.shutdownInput();
if (socket.isO... | [
"private",
"static",
"InputStream",
"getInputStream",
"(",
"final",
"Socket",
"socket",
")",
"throws",
"IOException",
"{",
"final",
"InputStream",
"delegate",
"=",
"socket",
".",
"getInputStream",
"(",
")",
";",
"return",
"new",
"InputStream",
"(",
")",
"{",
"... | Returns an {@link InputStream} for the socket, but unlike {@link Socket#getInputStream()}
when you call {@link InputStream#close() close} it only closes the input end of the socket
instead of the entire socket. | [
"Returns",
"an",
"{"
] | train | https://github.com/trajano/caliper/blob/a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658/caliper/src/main/java/com/google/caliper/runner/ServerSocketService.java#L293-L338 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/LongBitSet.java | LongBitSet.ensureCapacity | static LongBitSet ensureCapacity(LongBitSet bits, long numBits) {
"""
If the given {@link LongBitSet} is large enough to hold
{@code numBits+1}, returns the given bits, otherwise returns a new
{@link LongBitSet} which can hold the requested number of bits.
<p>
<b>NOTE:</b> the returned bitset reuses the underl... | java | static LongBitSet ensureCapacity(LongBitSet bits, long numBits) {
if (numBits < bits.numBits) {
return bits;
} else {
// Depends on the ghost bits being clear!
// (Otherwise, they may become visible in the new instance)
int numWords = bits2words(numBits);
long[] arr = bits.getBits();
if (n... | [
"static",
"LongBitSet",
"ensureCapacity",
"(",
"LongBitSet",
"bits",
",",
"long",
"numBits",
")",
"{",
"if",
"(",
"numBits",
"<",
"bits",
".",
"numBits",
")",
"{",
"return",
"bits",
";",
"}",
"else",
"{",
"// Depends on the ghost bits being clear!\r",
"// (Other... | If the given {@link LongBitSet} is large enough to hold
{@code numBits+1}, returns the given bits, otherwise returns a new
{@link LongBitSet} which can hold the requested number of bits.
<p>
<b>NOTE:</b> the returned bitset reuses the underlying {@code long[]} of
the given {@code bits} if possible. Also, calling {@link... | [
"If",
"the",
"given",
"{"
] | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/LongBitSet.java#L50-L63 |
alkacon/opencms-core | src/org/opencms/security/CmsPrincipal.java | CmsPrincipal.readPrincipal | public static I_CmsPrincipal readPrincipal(CmsObject cms, String name) throws CmsException {
"""
Utility function to read a principal by its id from the OpenCms database using the
provided OpenCms user context.<p>
@param cms the OpenCms user context to use when reading the principal
@param name the name of th... | java | public static I_CmsPrincipal readPrincipal(CmsObject cms, String name) throws CmsException {
try {
// first try to read the principal as a user
return cms.readUser(name);
} catch (CmsException exc) {
// assume user does not exist
}
try {
/... | [
"public",
"static",
"I_CmsPrincipal",
"readPrincipal",
"(",
"CmsObject",
"cms",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"try",
"{",
"// first try to read the principal as a user",
"return",
"cms",
".",
"readUser",
"(",
"name",
")",
";",
"}",
"ca... | Utility function to read a principal by its id from the OpenCms database using the
provided OpenCms user context.<p>
@param cms the OpenCms user context to use when reading the principal
@param name the name of the principal to read
@return the principal read from the OpenCms database
@throws CmsException in case th... | [
"Utility",
"function",
"to",
"read",
"a",
"principal",
"by",
"its",
"id",
"from",
"the",
"OpenCms",
"database",
"using",
"the",
"provided",
"OpenCms",
"user",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsPrincipal.java#L277-L293 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/jar/JarOutputStream.java | JarOutputStream.putNextEntry | public void putNextEntry(ZipEntry ze) throws IOException {
"""
Begins writing a new JAR file entry and positions the stream
to the start of the entry data. This method will also close
any previous entry. The default compression method will be
used if no compression method was specified for the entry.
The curre... | java | public void putNextEntry(ZipEntry ze) throws IOException {
if (firstEntry) {
// Make sure that extra field data for first JAR
// entry includes JAR magic number id.
byte[] edata = ze.getExtra();
if (edata == null || !hasMagic(edata)) {
if (edata ==... | [
"public",
"void",
"putNextEntry",
"(",
"ZipEntry",
"ze",
")",
"throws",
"IOException",
"{",
"if",
"(",
"firstEntry",
")",
"{",
"// Make sure that extra field data for first JAR",
"// entry includes JAR magic number id.",
"byte",
"[",
"]",
"edata",
"=",
"ze",
".",
"get... | Begins writing a new JAR file entry and positions the stream
to the start of the entry data. This method will also close
any previous entry. The default compression method will be
used if no compression method was specified for the entry.
The current time will be used if the entry has no set modification
time.
@param ... | [
"Begins",
"writing",
"a",
"new",
"JAR",
"file",
"entry",
"and",
"positions",
"the",
"stream",
"to",
"the",
"start",
"of",
"the",
"entry",
"data",
".",
"This",
"method",
"will",
"also",
"close",
"any",
"previous",
"entry",
".",
"The",
"default",
"compressio... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/jar/JarOutputStream.java#L89-L110 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/mapper/JBBPMapper.java | JBBPMapper.setFieldValue | private static void setFieldValue(final Object classInstance, final Field classField, final JBBPAbstractField binField, final Object value) {
"""
Set a value to a field of a class instance. Can't be used for static
fields!
@param classInstance a class instance
@param classField a mapping class field which ... | java | private static void setFieldValue(final Object classInstance, final Field classField, final JBBPAbstractField binField, final Object value) {
try {
classField.set(classInstance, value);
} catch (IllegalArgumentException ex) {
throw new JBBPMapperException("Can't set value to a mapping field", binFie... | [
"private",
"static",
"void",
"setFieldValue",
"(",
"final",
"Object",
"classInstance",
",",
"final",
"Field",
"classField",
",",
"final",
"JBBPAbstractField",
"binField",
",",
"final",
"Object",
"value",
")",
"{",
"try",
"{",
"classField",
".",
"set",
"(",
"cl... | Set a value to a field of a class instance. Can't be used for static
fields!
@param classInstance a class instance
@param classField a mapping class field which should be set by the value,
must not be null
@param binField a parsed bin field which value will be set, can be null
@param value a value to b... | [
"Set",
"a",
"value",
"to",
"a",
"field",
"of",
"a",
"class",
"instance",
".",
"Can",
"t",
"be",
"used",
"for",
"static",
"fields!"
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/mapper/JBBPMapper.java#L471-L479 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java | NodeSetDTM.addNodesInDocOrder | public void addNodesInDocOrder(DTMIterator iterator, XPathContext support) {
"""
Copy NodeList members into this nodelist, adding in
document order. If a node is null, don't add it.
@param iterator DTMIterator which yields the nodes to be added.
@param support The XPath runtime context.
@throws RuntimeExcep... | java | public void addNodesInDocOrder(DTMIterator iterator, XPathContext support)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
int node;
while (DTM.NULL != (node = iterator.nextNod... | [
"public",
"void",
"addNodesInDocOrder",
"(",
"DTMIterator",
"iterator",
",",
"XPathContext",
"support",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
... | Copy NodeList members into this nodelist, adding in
document order. If a node is null, don't add it.
@param iterator DTMIterator which yields the nodes to be added.
@param support The XPath runtime context.
@throws RuntimeException thrown if this NodeSetDTM is not of
a mutable type. | [
"Copy",
"NodeList",
"members",
"into",
"this",
"nodelist",
"adding",
"in",
"document",
"order",
".",
"If",
"a",
"node",
"is",
"null",
"don",
"t",
"add",
"it",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java#L703-L715 |
alibaba/java-dns-cache-manipulator | library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java | DnsCacheManipulator.setDnsCachePolicy | public static void setDnsCachePolicy(int cacheSeconds) {
"""
Set JVM DNS cache policy
<p>
NOTE: if Security Manage is turn on, JVM DNS cache policy set will not take effective. You can check by method {@link #getDnsCachePolicy()}.
@param cacheSeconds set default dns cache time. Special input case:
<ul>
<li>... | java | public static void setDnsCachePolicy(int cacheSeconds) {
try {
InetAddressCacheUtil.setDnsCachePolicy(cacheSeconds);
} catch (Exception e) {
throw new DnsCacheManipulatorException("Fail to setDnsCachePolicy, cause: " + e.toString(), e);
}
} | [
"public",
"static",
"void",
"setDnsCachePolicy",
"(",
"int",
"cacheSeconds",
")",
"{",
"try",
"{",
"InetAddressCacheUtil",
".",
"setDnsCachePolicy",
"(",
"cacheSeconds",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"DnsCacheManipulato... | Set JVM DNS cache policy
<p>
NOTE: if Security Manage is turn on, JVM DNS cache policy set will not take effective. You can check by method {@link #getDnsCachePolicy()}.
@param cacheSeconds set default dns cache time. Special input case:
<ul>
<li> {@code -1} means never expired.(In effect, all negative value)</li>
<li... | [
"Set",
"JVM",
"DNS",
"cache",
"policy",
"<p",
">",
"NOTE",
":",
"if",
"Security",
"Manage",
"is",
"turn",
"on",
"JVM",
"DNS",
"cache",
"policy",
"set",
"will",
"not",
"take",
"effective",
".",
"You",
"can",
"check",
"by",
"method",
"{",
"@link",
"#getD... | train | https://github.com/alibaba/java-dns-cache-manipulator/blob/eab50ee5c27671f9159b55458301f9429b2fcc47/library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java#L247-L253 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java | CPDefinitionLinkPersistenceImpl.removeByCP_T | @Override
public void removeByCP_T(long CProductId, String type) {
"""
Removes all the cp definition links where CProductId = ? and type = ? from the database.
@param CProductId the c product ID
@param type the type
"""
for (CPDefinitionLink cpDefinitionLink : findByCP_T(CProductId, type,
Qu... | java | @Override
public void removeByCP_T(long CProductId, String type) {
for (CPDefinitionLink cpDefinitionLink : findByCP_T(CProductId, type,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionLink);
}
} | [
"@",
"Override",
"public",
"void",
"removeByCP_T",
"(",
"long",
"CProductId",
",",
"String",
"type",
")",
"{",
"for",
"(",
"CPDefinitionLink",
"cpDefinitionLink",
":",
"findByCP_T",
"(",
"CProductId",
",",
"type",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryU... | Removes all the cp definition links where CProductId = ? and type = ? from the database.
@param CProductId the c product ID
@param type the type | [
"Removes",
"all",
"the",
"cp",
"definition",
"links",
"where",
"CProductId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L3612-L3618 |
geomajas/geomajas-project-server | api/src/main/java/org/geomajas/layer/feature/attribute/AssociationValue.java | AssociationValue.setDateAttribute | public void setDateAttribute(String name, Date value) {
"""
Sets the specified date attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0
"""
ensureAttributes();
Attribute attribute = new DateAttribute(value);
attribute.setEditable(isEdi... | java | public void setDateAttribute(String name, Date value) {
ensureAttributes();
Attribute attribute = new DateAttribute(value);
attribute.setEditable(isEditable(name));
getAllAttributes().put(name, attribute);
} | [
"public",
"void",
"setDateAttribute",
"(",
"String",
"name",
",",
"Date",
"value",
")",
"{",
"ensureAttributes",
"(",
")",
";",
"Attribute",
"attribute",
"=",
"new",
"DateAttribute",
"(",
"value",
")",
";",
"attribute",
".",
"setEditable",
"(",
"isEditable",
... | Sets the specified date attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0 | [
"Sets",
"the",
"specified",
"date",
"attribute",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/api/src/main/java/org/geomajas/layer/feature/attribute/AssociationValue.java#L246-L251 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/summary/TextRankSentence.java | TextRankSentence.getTopSentenceList | public static List<String> getTopSentenceList(String document, int size) {
"""
一句话调用接口
@param document 目标文档
@param size 需要的关键句的个数
@return 关键句列表
"""
return getTopSentenceList(document, size, default_sentence_separator);
} | java | public static List<String> getTopSentenceList(String document, int size)
{
return getTopSentenceList(document, size, default_sentence_separator);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getTopSentenceList",
"(",
"String",
"document",
",",
"int",
"size",
")",
"{",
"return",
"getTopSentenceList",
"(",
"document",
",",
"size",
",",
"default_sentence_separator",
")",
";",
"}"
] | 一句话调用接口
@param document 目标文档
@param size 需要的关键句的个数
@return 关键句列表 | [
"一句话调用接口"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/summary/TextRankSentence.java#L227-L230 |
guardtime/ksi-java-sdk | ksi-service-ha/src/main/java/com/guardtime/ksi/service/ha/HAConfUtil.java | HAConfUtil.isBefore | static boolean isBefore(Date a, Date b) {
"""
Is value of b before value of a.
@return True, if b is before a. Always true, if value of a is null.
"""
return a == null || (b != null && b.before(a));
} | java | static boolean isBefore(Date a, Date b) {
return a == null || (b != null && b.before(a));
} | [
"static",
"boolean",
"isBefore",
"(",
"Date",
"a",
",",
"Date",
"b",
")",
"{",
"return",
"a",
"==",
"null",
"||",
"(",
"b",
"!=",
"null",
"&&",
"b",
".",
"before",
"(",
"a",
")",
")",
";",
"}"
] | Is value of b before value of a.
@return True, if b is before a. Always true, if value of a is null. | [
"Is",
"value",
"of",
"b",
"before",
"value",
"of",
"a",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-service-ha/src/main/java/com/guardtime/ksi/service/ha/HAConfUtil.java#L61-L63 |
icode/ameba | src/main/java/ameba/db/ebean/EbeanUtils.java | EbeanUtils.checkQuery | public static void checkQuery(Query<?> query, InjectionManager manager) {
"""
<p>checkQuery.</p>
@param query a {@link io.ebean.Query} object.
@param manager a {@link InjectionManager} object.
"""
checkQuery(query, null, null, manager);
} | java | public static void checkQuery(Query<?> query, InjectionManager manager) {
checkQuery(query, null, null, manager);
} | [
"public",
"static",
"void",
"checkQuery",
"(",
"Query",
"<",
"?",
">",
"query",
",",
"InjectionManager",
"manager",
")",
"{",
"checkQuery",
"(",
"query",
",",
"null",
",",
"null",
",",
"manager",
")",
";",
"}"
] | <p>checkQuery.</p>
@param query a {@link io.ebean.Query} object.
@param manager a {@link InjectionManager} object. | [
"<p",
">",
"checkQuery",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/EbeanUtils.java#L132-L134 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java | Transactions.updateCache | public void updateCache( final WorkspaceCache workspace, final ChangeSet changes, Transaction transaction ) {
"""
Notify the workspace of the supplied changes, if and when the current transaction is completed. If the current thread is
not associated with a transaction when this method is called (e.g., the transac... | java | public void updateCache( final WorkspaceCache workspace, final ChangeSet changes, Transaction transaction ) {
if (changes == null || changes.isEmpty()) {
return;
}
if (transaction instanceof SynchronizedTransaction) {
// only issue the changes when the transaction is succ... | [
"public",
"void",
"updateCache",
"(",
"final",
"WorkspaceCache",
"workspace",
",",
"final",
"ChangeSet",
"changes",
",",
"Transaction",
"transaction",
")",
"{",
"if",
"(",
"changes",
"==",
"null",
"||",
"changes",
".",
"isEmpty",
"(",
")",
")",
"{",
"return"... | Notify the workspace of the supplied changes, if and when the current transaction is completed. If the current thread is
not associated with a transaction when this method is called (e.g., the transaction was started, changes were made, the
transaction was committed, and then this method was called), then the workspace... | [
"Notify",
"the",
"workspace",
"of",
"the",
"supplied",
"changes",
"if",
"and",
"when",
"the",
"current",
"transaction",
"is",
"completed",
".",
"If",
"the",
"current",
"thread",
"is",
"not",
"associated",
"with",
"a",
"transaction",
"when",
"this",
"method",
... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L291-L308 |
google/closure-templates | java/src/com/google/template/soy/data/SoyMapData.java | SoyMapData.putSingle | @Override
public void putSingle(String key, SoyData value) {
"""
Important: Do not use outside of Soy code (treat as superpackage-private).
<p>Puts data into this data object at the specified key.
@param key An individual key.
@param value The data to put at the specified key.
"""
map.put(key, val... | java | @Override
public void putSingle(String key, SoyData value) {
map.put(key, value);
} | [
"@",
"Override",
"public",
"void",
"putSingle",
"(",
"String",
"key",
",",
"SoyData",
"value",
")",
"{",
"map",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Important: Do not use outside of Soy code (treat as superpackage-private).
<p>Puts data into this data object at the specified key.
@param key An individual key.
@param value The data to put at the specified key. | [
"Important",
":",
"Do",
"not",
"use",
"outside",
"of",
"Soy",
"code",
"(",
"treat",
"as",
"superpackage",
"-",
"private",
")",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SoyMapData.java#L179-L182 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java | VecmathUtil.newUnitVector | static Vector2d newUnitVector(final IAtom atom, final IBond bond) {
"""
Create a unit vector for a bond with the start point being the specified atom.
@param atom start of vector
@param bond the bond used to create the vector
@return unit vector
"""
return newUnitVector(atom.getPoint2d(), bond.get... | java | static Vector2d newUnitVector(final IAtom atom, final IBond bond) {
return newUnitVector(atom.getPoint2d(), bond.getOther(atom).getPoint2d());
} | [
"static",
"Vector2d",
"newUnitVector",
"(",
"final",
"IAtom",
"atom",
",",
"final",
"IBond",
"bond",
")",
"{",
"return",
"newUnitVector",
"(",
"atom",
".",
"getPoint2d",
"(",
")",
",",
"bond",
".",
"getOther",
"(",
"atom",
")",
".",
"getPoint2d",
"(",
")... | Create a unit vector for a bond with the start point being the specified atom.
@param atom start of vector
@param bond the bond used to create the vector
@return unit vector | [
"Create",
"a",
"unit",
"vector",
"for",
"a",
"bond",
"with",
"the",
"start",
"point",
"being",
"the",
"specified",
"atom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L93-L95 |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.startOkConnection | AmqpClient startOkConnection(AmqpArguments clientProperties, String mechanism, String response, String locale, Continuation callback, ErrorHandler error) {
"""
Sends a StartOkConnection to server.
@param clientProperties
@param mechanism
@param response
@param locale
@param callback
@param error
@return A... | java | AmqpClient startOkConnection(AmqpArguments clientProperties, String mechanism, String response, String locale, Continuation callback, ErrorHandler error) {
Object[] args = {clientProperties, mechanism, response, locale};
AmqpBuffer bodyArg = null;
String methodName = "startOkConnection";
... | [
"AmqpClient",
"startOkConnection",
"(",
"AmqpArguments",
"clientProperties",
",",
"String",
"mechanism",
",",
"String",
"response",
",",
"String",
"locale",
",",
"Continuation",
"callback",
",",
"ErrorHandler",
"error",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
... | Sends a StartOkConnection to server.
@param clientProperties
@param mechanism
@param response
@param locale
@param callback
@param error
@return AmqpClient | [
"Sends",
"a",
"StartOkConnection",
"to",
"server",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L794-L804 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/Model.java | Model.findByIdLoadColumns | public M findByIdLoadColumns(Object[] idValues, String columns) {
"""
Find model by composite id values and load specific columns only.
<pre>
Example:
User user = User.dao.findByIdLoadColumns(new Object[]{123, 456}, "name, age");
</pre>
@param idValues the composite id values of the model
@param columns the ... | java | public M findByIdLoadColumns(Object[] idValues, String columns) {
Table table = _getTable();
if (table.getPrimaryKey().length != idValues.length)
throw new IllegalArgumentException("id values error, need " + table.getPrimaryKey().length + " id value");
Config config = _getConfig();
String sql = conf... | [
"public",
"M",
"findByIdLoadColumns",
"(",
"Object",
"[",
"]",
"idValues",
",",
"String",
"columns",
")",
"{",
"Table",
"table",
"=",
"_getTable",
"(",
")",
";",
"if",
"(",
"table",
".",
"getPrimaryKey",
"(",
")",
".",
"length",
"!=",
"idValues",
".",
... | Find model by composite id values and load specific columns only.
<pre>
Example:
User user = User.dao.findByIdLoadColumns(new Object[]{123, 456}, "name, age");
</pre>
@param idValues the composite id values of the model
@param columns the specific columns to load | [
"Find",
"model",
"by",
"composite",
"id",
"values",
"and",
"load",
"specific",
"columns",
"only",
".",
"<pre",
">",
"Example",
":",
"User",
"user",
"=",
"User",
".",
"dao",
".",
"findByIdLoadColumns",
"(",
"new",
"Object",
"[]",
"{",
"123",
"456",
"}",
... | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L784-L793 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.updateGalleryData | void updateGalleryData(final boolean viewChanged, final Runnable nextAction) {
"""
Updates the gallery data according to the current element view and the editable containers.<p>
This method should only be called from the gallery update timer to avoid unnecessary requests.<p>
@param viewChanged <code>true</code... | java | void updateGalleryData(final boolean viewChanged, final Runnable nextAction) {
CmsRpcAction<CmsContainerPageGalleryData> dataAction = new CmsRpcAction<CmsContainerPageGalleryData>() {
@Override
public void execute() {
getContainerpageService().getGalleryDataForPage(
... | [
"void",
"updateGalleryData",
"(",
"final",
"boolean",
"viewChanged",
",",
"final",
"Runnable",
"nextAction",
")",
"{",
"CmsRpcAction",
"<",
"CmsContainerPageGalleryData",
">",
"dataAction",
"=",
"new",
"CmsRpcAction",
"<",
"CmsContainerPageGalleryData",
">",
"(",
")",... | Updates the gallery data according to the current element view and the editable containers.<p>
This method should only be called from the gallery update timer to avoid unnecessary requests.<p>
@param viewChanged <code>true</code> in case the element view changed
@param nextAction the action to execute after updating t... | [
"Updates",
"the",
"gallery",
"data",
"according",
"to",
"the",
"current",
"element",
"view",
"and",
"the",
"editable",
"containers",
".",
"<p",
">",
"This",
"method",
"should",
"only",
"be",
"called",
"from",
"the",
"gallery",
"update",
"timer",
"to",
"avoid... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L3839-L3864 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/UrlUtilities.java | UrlUtilities.getContentFromUrl | public static byte[] getContentFromUrl(String url, Map inCookies, Map outCookies) {
"""
Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
byte[].
@param url URL to hit
@param inCookies Map of session cookies (or null... | java | public static byte[] getContentFromUrl(String url, Map inCookies, Map outCookies)
{
return getContentFromUrl(url, inCookies, outCookies, true);
} | [
"public",
"static",
"byte",
"[",
"]",
"getContentFromUrl",
"(",
"String",
"url",
",",
"Map",
"inCookies",
",",
"Map",
"outCookies",
")",
"{",
"return",
"getContentFromUrl",
"(",
"url",
",",
"inCookies",
",",
"outCookies",
",",
"true",
")",
";",
"}"
] | Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
byte[].
@param url URL to hit
@param inCookies Map of session cookies (or null if not needed)
@param outCookies Map of session cookies (or null if not needed)
@return byte[] of... | [
"Get",
"content",
"from",
"the",
"passed",
"in",
"URL",
".",
"This",
"code",
"will",
"open",
"a",
"connection",
"to",
"the",
"passed",
"in",
"server",
"fetch",
"the",
"requested",
"content",
"and",
"return",
"it",
"as",
"a",
"byte",
"[]",
"."
] | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L570-L573 |
bremersee/sms | src/main/java/org/bremersee/sms/GoyyaSmsService.java | GoyyaSmsService.createHttpURLConnection | protected HttpURLConnection createHttpURLConnection(final String url) throws IOException {
"""
Creates the URL connection.
@param url the URL
@return the URL connection
@throws IOException if creation of the URL connection fails
"""
URL sendUrl = new URL(url);
HttpURLConnection con;
if (Str... | java | protected HttpURLConnection createHttpURLConnection(final String url) throws IOException {
URL sendUrl = new URL(url);
HttpURLConnection con;
if (StringUtils.isNotBlank(proxyHost) && proxyPort != null) {
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
c... | [
"protected",
"HttpURLConnection",
"createHttpURLConnection",
"(",
"final",
"String",
"url",
")",
"throws",
"IOException",
"{",
"URL",
"sendUrl",
"=",
"new",
"URL",
"(",
"url",
")",
";",
"HttpURLConnection",
"con",
";",
"if",
"(",
"StringUtils",
".",
"isNotBlank"... | Creates the URL connection.
@param url the URL
@return the URL connection
@throws IOException if creation of the URL connection fails | [
"Creates",
"the",
"URL",
"connection",
"."
] | train | https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/GoyyaSmsService.java#L411-L448 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/alert/AlertAddDialog.java | AlertAddDialog.setHttpMessage | public void setHttpMessage(HttpMessage httpMessage, int historyType) {
"""
Sets the {@code HttpMessage} and the history type of the
{@code HistoryReference} that will be created if the user creates the
alert. The current session will be used to create the
{@code HistoryReference}. The alert created will be adde... | java | public void setHttpMessage(HttpMessage httpMessage, int historyType) {
this.historyRef = null;
this.httpMessage = httpMessage;
this.historyType = historyType;
alertViewPanel.setHttpMessage(httpMessage);
} | [
"public",
"void",
"setHttpMessage",
"(",
"HttpMessage",
"httpMessage",
",",
"int",
"historyType",
")",
"{",
"this",
".",
"historyRef",
"=",
"null",
";",
"this",
".",
"httpMessage",
"=",
"httpMessage",
";",
"this",
".",
"historyType",
"=",
"historyType",
";",
... | Sets the {@code HttpMessage} and the history type of the
{@code HistoryReference} that will be created if the user creates the
alert. The current session will be used to create the
{@code HistoryReference}. The alert created will be added to the newly
created {@code HistoryReference}.
<p>
Should be used when the alert ... | [
"Sets",
"the",
"{",
"@code",
"HttpMessage",
"}",
"and",
"the",
"history",
"type",
"of",
"the",
"{",
"@code",
"HistoryReference",
"}",
"that",
"will",
"be",
"created",
"if",
"the",
"user",
"creates",
"the",
"alert",
".",
"The",
"current",
"session",
"will",... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/alert/AlertAddDialog.java#L297-L302 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/commons/FileUtilsV2_2.java | FileUtilsV2_2.copyFile | public static void copyFile(File srcFile, File destFile) throws IOException {
"""
Copies a file to a new location preserving the file date.
<p>
This method copies the contents of the specified source file to the
specified destination file. The directory holding the destination file is
created if it does not ex... | java | public static void copyFile(File srcFile, File destFile) throws IOException {
copyFile(srcFile, destFile, true);
} | [
"public",
"static",
"void",
"copyFile",
"(",
"File",
"srcFile",
",",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"copyFile",
"(",
"srcFile",
",",
"destFile",
",",
"true",
")",
";",
"}"
] | Copies a file to a new location preserving the file date.
<p>
This method copies the contents of the specified source file to the
specified destination file. The directory holding the destination file is
created if it does not exist. If the destination file exists, then this
method will overwrite it.
<p>
<strong>Note:<... | [
"Copies",
"a",
"file",
"to",
"a",
"new",
"location",
"preserving",
"the",
"file",
"date",
".",
"<p",
">",
"This",
"method",
"copies",
"the",
"contents",
"of",
"the",
"specified",
"source",
"file",
"to",
"the",
"specified",
"destination",
"file",
".",
"The"... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/commons/FileUtilsV2_2.java#L352-L354 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/utils/ThresholdUtil.java | ThresholdUtil.isValueInRange | public static boolean isValueInRange(final String range, final Metric metric) throws BadThresholdException {
"""
Returns <code>true</code> if the metric value <code>metric</code>
falls into the passed in <code>range</code>.
@param range
The range
@param metric
The metric to be checked
@return <code>true<... | java | public static boolean isValueInRange(final String range, final Metric metric) throws BadThresholdException {
return new LegacyRange(range).isValueInside(metric);
} | [
"public",
"static",
"boolean",
"isValueInRange",
"(",
"final",
"String",
"range",
",",
"final",
"Metric",
"metric",
")",
"throws",
"BadThresholdException",
"{",
"return",
"new",
"LegacyRange",
"(",
"range",
")",
".",
"isValueInside",
"(",
"metric",
")",
";",
"... | Returns <code>true</code> if the metric value <code>metric</code>
falls into the passed in <code>range</code>.
@param range
The range
@param metric
The metric to be checked
@return <code>true</code> if the metric value <code>metric</code>
falls into the passed in <code>range</code>.
@throws BadThresholdException if a... | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"metric",
"value",
"<code",
">",
"metric<",
"/",
"code",
">",
"falls",
"into",
"the",
"passed",
"in",
"<code",
">",
"range<",
"/",
"code",
">",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/utils/ThresholdUtil.java#L69-L71 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java | AtomicLongFieldUpdater.getAndSet | public long getAndSet(T obj, long newValue) {
"""
Atomically sets the field of the given object managed by this updater
to the given value and returns the old value.
@param obj An object whose field to get and set
@param newValue the new value
@return the previous value
"""
long prev;
do ... | java | public long getAndSet(T obj, long newValue) {
long prev;
do {
prev = get(obj);
} while (!compareAndSet(obj, prev, newValue));
return prev;
} | [
"public",
"long",
"getAndSet",
"(",
"T",
"obj",
",",
"long",
"newValue",
")",
"{",
"long",
"prev",
";",
"do",
"{",
"prev",
"=",
"get",
"(",
"obj",
")",
";",
"}",
"while",
"(",
"!",
"compareAndSet",
"(",
"obj",
",",
"prev",
",",
"newValue",
")",
"... | Atomically sets the field of the given object managed by this updater
to the given value and returns the old value.
@param obj An object whose field to get and set
@param newValue the new value
@return the previous value | [
"Atomically",
"sets",
"the",
"field",
"of",
"the",
"given",
"object",
"managed",
"by",
"this",
"updater",
"to",
"the",
"given",
"value",
"and",
"returns",
"the",
"old",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java#L168-L174 |
unic/neba | core/src/main/java/io/neba/core/resourcemodels/mapping/FieldValueMappingCallback.java | FieldValueMappingCallback.resolvePropertyTypedValue | private <T> T resolvePropertyTypedValue(FieldData field, Class<T> propertyType) {
"""
Resolves a field's value using the field's {@link FieldValueMappingCallback.FieldData#path}.
{@link FieldData#isRelative() relative} or {@link FieldData#isAbsolute() absolute} paths
are interpreted as references to the propert... | java | private <T> T resolvePropertyTypedValue(FieldData field, Class<T> propertyType) {
if (field.isAbsolute() || field.isRelative()) {
return resolvePropertyTypedValueFromForeignResource(field, propertyType);
}
if (this.properties == null) {
throw new IllegalStateException("Tr... | [
"private",
"<",
"T",
">",
"T",
"resolvePropertyTypedValue",
"(",
"FieldData",
"field",
",",
"Class",
"<",
"T",
">",
"propertyType",
")",
"{",
"if",
"(",
"field",
".",
"isAbsolute",
"(",
")",
"||",
"field",
".",
"isRelative",
"(",
")",
")",
"{",
"return... | Resolves a field's value using the field's {@link FieldValueMappingCallback.FieldData#path}.
{@link FieldData#isRelative() relative} or {@link FieldData#isAbsolute() absolute} paths
are interpreted as references to the properties of another resource and are resolved
via {@link #resolvePropertyTypedValueFromForeignReso... | [
"Resolves",
"a",
"field",
"s",
"value",
"using",
"the",
"field",
"s",
"{",
"@link",
"FieldValueMappingCallback",
".",
"FieldData#path",
"}",
".",
"{",
"@link",
"FieldData#isRelative",
"()",
"relative",
"}",
"or",
"{",
"@link",
"FieldData#isAbsolute",
"()",
"abso... | train | https://github.com/unic/neba/blob/4d762e60112a1fcb850926a56a9843d5aa424c4b/core/src/main/java/io/neba/core/resourcemodels/mapping/FieldValueMappingCallback.java#L391-L400 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_cronAvailableLanguage_GET | public ArrayList<OvhLanguageEnum> serviceName_cronAvailableLanguage_GET(String serviceName) throws IOException {
"""
List available cron language
REST: GET /hosting/web/{serviceName}/cronAvailableLanguage
@param serviceName [required] The internal name of your hosting
"""
String qPath = "/hosting/web/{se... | java | public ArrayList<OvhLanguageEnum> serviceName_cronAvailableLanguage_GET(String serviceName) throws IOException {
String qPath = "/hosting/web/{serviceName}/cronAvailableLanguage";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t8);
} | [
"public",
"ArrayList",
"<",
"OvhLanguageEnum",
">",
"serviceName_cronAvailableLanguage_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/cronAvailableLanguage\"",
";",
"StringBuilder",
"sb",
"=",
"pa... | List available cron language
REST: GET /hosting/web/{serviceName}/cronAvailableLanguage
@param serviceName [required] The internal name of your hosting | [
"List",
"available",
"cron",
"language"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1368-L1373 |
alkacon/opencms-core | src/org/opencms/workplace/tools/CmsToolManager.java | CmsToolManager.setBaseToolPath | public void setBaseToolPath(CmsWorkplace wp, String baseToolPath) {
"""
Sets the base tool path.<p>
@param wp the workplace object
@param baseToolPath the base tool path to set
"""
// use last used base if param empty
if (CmsStringUtil.isEmpty(baseToolPath) || baseToolPath.trim().equals("n... | java | public void setBaseToolPath(CmsWorkplace wp, String baseToolPath) {
// use last used base if param empty
if (CmsStringUtil.isEmpty(baseToolPath) || baseToolPath.trim().equals("null")) {
baseToolPath = getBaseToolPath(wp);
}
baseToolPath = repairPath(wp, baseToolPath);
... | [
"public",
"void",
"setBaseToolPath",
"(",
"CmsWorkplace",
"wp",
",",
"String",
"baseToolPath",
")",
"{",
"// use last used base if param empty",
"if",
"(",
"CmsStringUtil",
".",
"isEmpty",
"(",
"baseToolPath",
")",
"||",
"baseToolPath",
".",
"trim",
"(",
")",
".",... | Sets the base tool path.<p>
@param wp the workplace object
@param baseToolPath the base tool path to set | [
"Sets",
"the",
"base",
"tool",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsToolManager.java#L535-L545 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.getFrameSource | public String getFrameSource(String frameName, String uri) {
"""
Returns the html for the frame name and source and stores this information in the workplace settings.<p>
@param frameName the name of the frame
@param uri the absolute path of the frame
@return the html for the frame name and source
"""
... | java | public String getFrameSource(String frameName, String uri) {
String frameString = "name=\"" + frameName + "\" src=\"" + uri + "\"";
int paramIndex = uri.indexOf("?");
if (paramIndex != -1) {
// remove request parameters from URI before putting it to Map
uri = uri.substri... | [
"public",
"String",
"getFrameSource",
"(",
"String",
"frameName",
",",
"String",
"uri",
")",
"{",
"String",
"frameString",
"=",
"\"name=\\\"\"",
"+",
"frameName",
"+",
"\"\\\" src=\\\"\"",
"+",
"uri",
"+",
"\"\\\"\"",
";",
"int",
"paramIndex",
"=",
"uri",
".",... | Returns the html for the frame name and source and stores this information in the workplace settings.<p>
@param frameName the name of the frame
@param uri the absolute path of the frame
@return the html for the frame name and source | [
"Returns",
"the",
"html",
"for",
"the",
"frame",
"name",
"and",
"source",
"and",
"stores",
"this",
"information",
"in",
"the",
"workplace",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1638-L1648 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobClient.java | JobClient.isJobDirValid | public static boolean isJobDirValid(Path jobDirPath, FileSystem fs)
throws IOException {
"""
Checks if the job directory is clean and has all the required components
for (re) starting the job
"""
FileStatus[] contents = fs.listStatus(jobDirPath);
int matchCount = 0;
if (contents != null && conte... | java | public static boolean isJobDirValid(Path jobDirPath, FileSystem fs)
throws IOException {
FileStatus[] contents = fs.listStatus(jobDirPath);
int matchCount = 0;
if (contents != null && contents.length >=2) {
for (FileStatus status : contents) {
if ("job.xml".equals(status.getPath().getName())... | [
"public",
"static",
"boolean",
"isJobDirValid",
"(",
"Path",
"jobDirPath",
",",
"FileSystem",
"fs",
")",
"throws",
"IOException",
"{",
"FileStatus",
"[",
"]",
"contents",
"=",
"fs",
".",
"listStatus",
"(",
"jobDirPath",
")",
";",
"int",
"matchCount",
"=",
"0... | Checks if the job directory is clean and has all the required components
for (re) starting the job | [
"Checks",
"if",
"the",
"job",
"directory",
"is",
"clean",
"and",
"has",
"all",
"the",
"required",
"components",
"for",
"(",
"re",
")",
"starting",
"the",
"job"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobClient.java#L1409-L1427 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.readFileContentQuietly | public static String readFileContentQuietly( File file, Logger logger ) {
"""
Reads a text file content and returns it as a string.
<p>
The file is tried to be read with UTF-8 encoding.
If it fails, the default system encoding is used.
</p>
@param file the file whose content must be loaded (can be null)
@p... | java | public static String readFileContentQuietly( File file, Logger logger ) {
String result = "";
try {
if( file != null && file.exists())
result = readFileContent( file );
} catch( Exception e ) {
logger.severe( "File " + file + " could not be read." );
logException( logger, e );
}
return result;... | [
"public",
"static",
"String",
"readFileContentQuietly",
"(",
"File",
"file",
",",
"Logger",
"logger",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"try",
"{",
"if",
"(",
"file",
"!=",
"null",
"&&",
"file",
".",
"exists",
"(",
")",
")",
"result",
"="... | Reads a text file content and returns it as a string.
<p>
The file is tried to be read with UTF-8 encoding.
If it fails, the default system encoding is used.
</p>
@param file the file whose content must be loaded (can be null)
@param logger a logger (not null)
@return the file content or the empty string if an error o... | [
"Reads",
"a",
"text",
"file",
"content",
"and",
"returns",
"it",
"as",
"a",
"string",
".",
"<p",
">",
"The",
"file",
"is",
"tried",
"to",
"be",
"read",
"with",
"UTF",
"-",
"8",
"encoding",
".",
"If",
"it",
"fails",
"the",
"default",
"system",
"encodi... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L464-L477 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.relativeMoveTo | public SVGPath relativeMoveTo(double x, double y) {
"""
Move to the given relative coordinates.
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax.
"""
return append(PATH_MOVE_RELATIVE).append(x).append(y);
} | java | public SVGPath relativeMoveTo(double x, double y) {
return append(PATH_MOVE_RELATIVE).append(x).append(y);
} | [
"public",
"SVGPath",
"relativeMoveTo",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"append",
"(",
"PATH_MOVE_RELATIVE",
")",
".",
"append",
"(",
"x",
")",
".",
"append",
"(",
"y",
")",
";",
"}"
] | Move to the given relative coordinates.
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax. | [
"Move",
"to",
"the",
"given",
"relative",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L332-L334 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java | Configuration.getFile | public File getFile(String dirsProp, String path) throws IOException {
"""
Get a local file name under a directory named in <i>dirsProp</i> with
the given <i>path</i>. If <i>dirsProp</i> contains multiple directories,
then one is chosen based on <i>path</i>'s hash code. If the selected
directory does not exis... | java | public File getFile(String dirsProp, String path) throws IOException {
String[] dirs = getStrings(dirsProp);
int hashCode = path.hashCode();
for (int i = 0; i < dirs.length; i++) { // try each local dir
int index = (hashCode + i & Integer.MAX_VALUE) % dirs.length;
File fi... | [
"public",
"File",
"getFile",
"(",
"String",
"dirsProp",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"dirs",
"=",
"getStrings",
"(",
"dirsProp",
")",
";",
"int",
"hashCode",
"=",
"path",
".",
"hashCode",
"(",
")",
";",
... | Get a local file name under a directory named in <i>dirsProp</i> with
the given <i>path</i>. If <i>dirsProp</i> contains multiple directories,
then one is chosen based on <i>path</i>'s hash code. If the selected
directory does not exist, an attempt is made to create it.
@param dirsProp directory in which to locate t... | [
"Get",
"a",
"local",
"file",
"name",
"under",
"a",
"directory",
"named",
"in",
"<i",
">",
"dirsProp<",
"/",
"i",
">",
"with",
"the",
"given",
"<i",
">",
"path<",
"/",
"i",
">",
".",
"If",
"<i",
">",
"dirsProp<",
"/",
"i",
">",
"contains",
"multiple... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java#L1032-L1044 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | protected XExpression _generate(XIfExpression ifStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param ifStatement the if-then-else statement.
@param it the target for the generated content.
@param context the context.
@return the statement.
"""
it.ap... | java | protected XExpression _generate(XIfExpression ifStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
it.append("if "); //$NON-NLS-1$
generate(ifStatement.getIf(), it, context);
it.append(":"); //$NON-NLS-1$
it.increaseIndentation().newLine();
if (ifStatement.getThen() != null) {
generate(if... | [
"protected",
"XExpression",
"_generate",
"(",
"XIfExpression",
"ifStatement",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"it",
".",
"append",
"(",
"\"if \"",
")",
";",
"//$NON-NLS-1$",
"generate",
"(",
"ifStatement",
".",
... | Generate the given object.
@param ifStatement the if-then-else statement.
@param it the target for the generated content.
@param context the context.
@return the statement. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L745-L770 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/MapperFactory.java | MapperFactory.createCustomMapper | private Mapper createCustomMapper(Field field, PropertyMapper propertyMapperAnnotation) {
"""
Creates and returns a custom mapper for the given field.
@param field
the field
@param propertyMapperAnnotation
property mapper annotation that specifies the mapper class
@return custom mapper for the given field
... | java | private Mapper createCustomMapper(Field field, PropertyMapper propertyMapperAnnotation) {
Class<? extends Mapper> mapperClass = propertyMapperAnnotation.value();
Constructor<? extends Mapper> constructor = IntrospectionUtils.getConstructor(mapperClass,
Field.class);
if (constructor != null) {
... | [
"private",
"Mapper",
"createCustomMapper",
"(",
"Field",
"field",
",",
"PropertyMapper",
"propertyMapperAnnotation",
")",
"{",
"Class",
"<",
"?",
"extends",
"Mapper",
">",
"mapperClass",
"=",
"propertyMapperAnnotation",
".",
"value",
"(",
")",
";",
"Constructor",
... | Creates and returns a custom mapper for the given field.
@param field
the field
@param propertyMapperAnnotation
property mapper annotation that specifies the mapper class
@return custom mapper for the given field | [
"Creates",
"and",
"returns",
"a",
"custom",
"mapper",
"for",
"the",
"given",
"field",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/MapperFactory.java#L297-L312 |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java | CommerceWishListPersistenceImpl.findByU_LtC | @Override
public List<CommerceWishList> findByU_LtC(long userId, Date createDate,
int start, int end) {
"""
Returns a range of all the commerce wish lists where userId = ? and createDate < ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start<... | java | @Override
public List<CommerceWishList> findByU_LtC(long userId, Date createDate,
int start, int end) {
return findByU_LtC(userId, createDate, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWishList",
">",
"findByU_LtC",
"(",
"long",
"userId",
",",
"Date",
"createDate",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByU_LtC",
"(",
"userId",
",",
"createDate",
",",
"start",
","... | Returns a range of all the commerce wish lists where userId = ? and createDate < ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to th... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"wish",
"lists",
"where",
"userId",
"=",
"?",
";",
"and",
"createDate",
"<",
";",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java#L3088-L3092 |
zamrokk/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Peer.java | Peer.sendTransaction | public Response sendTransaction(Transaction transaction) throws PeerException {
"""
Send a transaction to this peer.
@param transaction A transaction
@throws PeerException
"""
logger.debug("peer.sendTransaction");
// Send the transaction to the peer node via grpc
// The rpc specific... | java | public Response sendTransaction(Transaction transaction) throws PeerException {
logger.debug("peer.sendTransaction");
// Send the transaction to the peer node via grpc
// The rpc specification on the peer side is:
// rpc ProcessTransaction(Transaction) returns (Response) {}
... | [
"public",
"Response",
"sendTransaction",
"(",
"Transaction",
"transaction",
")",
"throws",
"PeerException",
"{",
"logger",
".",
"debug",
"(",
"\"peer.sendTransaction\"",
")",
";",
"// Send the transaction to the peer node via grpc",
"// The rpc specification on the peer side is:"... | Send a transaction to this peer.
@param transaction A transaction
@throws PeerException | [
"Send",
"a",
"transaction",
"to",
"this",
"peer",
"."
] | train | https://github.com/zamrokk/fabric-sdk-java/blob/d4993ca602f72d412cd682e1b92e805e48b27afa/src/main/java/org/hyperledger/fabric/sdk/Peer.java#L70-L117 |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java | RequestParam.getLong | public static long getLong(@NotNull ServletRequest request, @NotNull String param, long defaultValue) {
"""
Returns a request parameter as long.
@param request Request.
@param param Parameter name.
@param defaultValue Default value.
@return Parameter value or default value if it does not exist or is not a numb... | java | public static long getLong(@NotNull ServletRequest request, @NotNull String param, long defaultValue) {
String value = request.getParameter(param);
return NumberUtils.toLong(value, defaultValue);
} | [
"public",
"static",
"long",
"getLong",
"(",
"@",
"NotNull",
"ServletRequest",
"request",
",",
"@",
"NotNull",
"String",
"param",
",",
"long",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"request",
".",
"getParameter",
"(",
"param",
")",
";",
"return",
... | Returns a request parameter as long.
@param request Request.
@param param Parameter name.
@param defaultValue Default value.
@return Parameter value or default value if it does not exist or is not a number. | [
"Returns",
"a",
"request",
"parameter",
"as",
"long",
"."
] | train | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java#L178-L181 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Transform.java | Transform.createRotateTransform | public static Transform createRotateTransform(float angle, float x, float y) {
"""
Create a new rotation Transform around the specified point
@param angle The angle in radians to set the transform.
@param x The x coordinate around which to rotate.
@param y The y coordinate around which to rotate.
@return The... | java | public static Transform createRotateTransform(float angle, float x, float y) {
Transform temp = Transform.createRotateTransform(angle);
float sinAngle = temp.matrixPosition[3];
float oneMinusCosAngle = 1.0f - temp.matrixPosition[4];
temp.matrixPosition[2] = x * oneMinusCosAngle + ... | [
"public",
"static",
"Transform",
"createRotateTransform",
"(",
"float",
"angle",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"Transform",
"temp",
"=",
"Transform",
".",
"createRotateTransform",
"(",
"angle",
")",
";",
"float",
"sinAngle",
"=",
"temp",
".... | Create a new rotation Transform around the specified point
@param angle The angle in radians to set the transform.
@param x The x coordinate around which to rotate.
@param y The y coordinate around which to rotate.
@return The resulting Transform | [
"Create",
"a",
"new",
"rotation",
"Transform",
"around",
"the",
"specified",
"point"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Transform.java#L184-L192 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java | DTMDefaultBase.indexNode | protected void indexNode(int expandedTypeID, int identity) {
"""
Add a node to the element indexes. The node will not be added unless
it's an element.
@param expandedTypeID The expanded type ID of the node.
@param identity The node identity index.
"""
ExpandedNameTable ent = m_expandedNameTable;
... | java | protected void indexNode(int expandedTypeID, int identity)
{
ExpandedNameTable ent = m_expandedNameTable;
short type = ent.getType(expandedTypeID);
if (DTM.ELEMENT_NODE == type)
{
int namespaceID = ent.getNamespaceID(expandedTypeID);
int localNameID = ent.getLocalNameID(expandedTypeID);
... | [
"protected",
"void",
"indexNode",
"(",
"int",
"expandedTypeID",
",",
"int",
"identity",
")",
"{",
"ExpandedNameTable",
"ent",
"=",
"m_expandedNameTable",
";",
"short",
"type",
"=",
"ent",
".",
"getType",
"(",
"expandedTypeID",
")",
";",
"if",
"(",
"DTM",
"."... | Add a node to the element indexes. The node will not be added unless
it's an element.
@param expandedTypeID The expanded type ID of the node.
@param identity The node identity index. | [
"Add",
"a",
"node",
"to",
"the",
"element",
"indexes",
".",
"The",
"node",
"will",
"not",
"be",
"added",
"unless",
"it",
"s",
"an",
"element",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java#L317-L336 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/session/InMemoryDocumentSessionOperations.java | InMemoryDocumentSessionOperations.trackEntity | @SuppressWarnings("unchecked")
public <T> T trackEntity(Class<T> clazz, DocumentInfo documentFound) {
"""
Tracks the entity inside the unit of work
@param <T> entity class
@param clazz entity class
@param documentFound Document info
@return tracked entity
"""
return (T) trac... | java | @SuppressWarnings("unchecked")
public <T> T trackEntity(Class<T> clazz, DocumentInfo documentFound) {
return (T) trackEntity(clazz, documentFound.getId(), documentFound.getDocument(), documentFound.getMetadata(), noTracking);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"trackEntity",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"DocumentInfo",
"documentFound",
")",
"{",
"return",
"(",
"T",
")",
"trackEntity",
"(",
"clazz",
",",
"documentFound... | Tracks the entity inside the unit of work
@param <T> entity class
@param clazz entity class
@param documentFound Document info
@return tracked entity | [
"Tracks",
"the",
"entity",
"inside",
"the",
"unit",
"of",
"work"
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/session/InMemoryDocumentSessionOperations.java#L501-L504 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addConstraintsMod11CheckMessage | public FessMessages addConstraintsMod11CheckMessage(String property, String value) {
"""
Add the created action message for the key 'constraints.Mod11Check.message' with parameters.
<pre>
message: The check digit for ${value} is invalid, Modulo 11 checksum failed.
</pre>
@param property The property name for t... | java | public FessMessages addConstraintsMod11CheckMessage(String property, String value) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_Mod11Check_MESSAGE, value));
return this;
} | [
"public",
"FessMessages",
"addConstraintsMod11CheckMessage",
"(",
"String",
"property",
",",
"String",
"value",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"CONSTRAINTS_Mod11Check_MESSAGE",
",",... | Add the created action message for the key 'constraints.Mod11Check.message' with parameters.
<pre>
message: The check digit for ${value} is invalid, Modulo 11 checksum failed.
</pre>
@param property The property name for the message. (NotNull)
@param value The parameter value for message. (NotNull)
@return this. (NotNu... | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"constraints",
".",
"Mod11Check",
".",
"message",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"The",
"check",
"digit",
"for",
"$",
"{",
"value",
"}",
"is",
"invalid",
"Modulo",
... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L889-L893 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameAndTextQualifier.java | ElementNameAndTextQualifier.qualifyForComparison | public boolean qualifyForComparison(Element control, Element test) {
"""
Determine whether two elements qualify for further Difference comparison.
@param control
@param test
@return true if the two elements qualify for further comparison based on
both the superclass qualification (namespace URI and non- namesp... | java | public boolean qualifyForComparison(Element control, Element test) {
return ElementSelectors.byNameAndText.canBeCompared(control, test);
} | [
"public",
"boolean",
"qualifyForComparison",
"(",
"Element",
"control",
",",
"Element",
"test",
")",
"{",
"return",
"ElementSelectors",
".",
"byNameAndText",
".",
"canBeCompared",
"(",
"control",
",",
"test",
")",
";",
"}"
] | Determine whether two elements qualify for further Difference comparison.
@param control
@param test
@return true if the two elements qualify for further comparison based on
both the superclass qualification (namespace URI and non- namespaced tag
name), and the qualification of the text nodes contained within the
eleme... | [
"Determine",
"whether",
"two",
"elements",
"qualify",
"for",
"further",
"Difference",
"comparison",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameAndTextQualifier.java#L61-L63 |
tehuti-io/tehuti | src/main/java/io/tehuti/metrics/stats/SampledStat.java | SampledStat.checkInit | private void checkInit(MetricConfig config, long now) {
"""
Checks that the sample windows are properly initialized.
In case there are no initialized sample yet, this creates two windows: one that begins now, as well as the
previous window before that. This ensures that any measurement won't be calculated over... | java | private void checkInit(MetricConfig config, long now) {
if (samples.size() == 0) {
this.samples.add(newSample(now));
this.samples.add(newSample(now - config.timeWindowMs()));
}
} | [
"private",
"void",
"checkInit",
"(",
"MetricConfig",
"config",
",",
"long",
"now",
")",
"{",
"if",
"(",
"samples",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"this",
".",
"samples",
".",
"add",
"(",
"newSample",
"(",
"now",
")",
")",
";",
"this",
... | Checks that the sample windows are properly initialized.
In case there are no initialized sample yet, this creates two windows: one that begins now, as well as the
previous window before that. This ensures that any measurement won't be calculated over an elapsed time of zero
or few milliseconds. This is particularly s... | [
"Checks",
"that",
"the",
"sample",
"windows",
"are",
"properly",
"initialized",
"."
] | train | https://github.com/tehuti-io/tehuti/blob/c28a2f838eac775660efb270aafd2a464d712948/src/main/java/io/tehuti/metrics/stats/SampledStat.java#L111-L116 |
unic/neba | core/src/main/java/io/neba/core/resourcemodels/mapping/FieldValueMappingCallback.java | FieldValueMappingCallback.resolveResource | private <T> T resolveResource(final String resourcePath, final Class<T> targetType) {
"""
Uses the current resource's {@link org.apache.sling.api.resource.ResourceResolver}
to obtain the resource with the given path.
The path can be absolute or relative to the current resource.
{@link #convert(org.apache.sling.... | java | private <T> T resolveResource(final String resourcePath, final Class<T> targetType) {
Resource absoluteResource = this.resource.getResourceResolver().getResource(this.resource, resourcePath);
return convert(absoluteResource, targetType);
} | [
"private",
"<",
"T",
">",
"T",
"resolveResource",
"(",
"final",
"String",
"resourcePath",
",",
"final",
"Class",
"<",
"T",
">",
"targetType",
")",
"{",
"Resource",
"absoluteResource",
"=",
"this",
".",
"resource",
".",
"getResourceResolver",
"(",
")",
".",
... | Uses the current resource's {@link org.apache.sling.api.resource.ResourceResolver}
to obtain the resource with the given path.
The path can be absolute or relative to the current resource.
{@link #convert(org.apache.sling.api.resource.Resource, Class) Converts} the resolved resource
to the given field type if necessary... | [
"Uses",
"the",
"current",
"resource",
"s",
"{",
"@link",
"org",
".",
"apache",
".",
"sling",
".",
"api",
".",
"resource",
".",
"ResourceResolver",
"}",
"to",
"obtain",
"the",
"resource",
"with",
"the",
"given",
"path",
".",
"The",
"path",
"can",
"be",
... | train | https://github.com/unic/neba/blob/4d762e60112a1fcb850926a56a9843d5aa424c4b/core/src/main/java/io/neba/core/resourcemodels/mapping/FieldValueMappingCallback.java#L411-L414 |
atomix/copycat | server/src/main/java/io/atomix/copycat/server/storage/SegmentFile.java | SegmentFile.createSegmentFile | static File createSegmentFile(String name, File directory, long id, long version) {
"""
Creates a segment file for the given directory, log name, segment ID, and segment version.
"""
return new File(directory, String.format("%s-%d-%d.log", Assert.notNull(name, "name"), id, version));
} | java | static File createSegmentFile(String name, File directory, long id, long version) {
return new File(directory, String.format("%s-%d-%d.log", Assert.notNull(name, "name"), id, version));
} | [
"static",
"File",
"createSegmentFile",
"(",
"String",
"name",
",",
"File",
"directory",
",",
"long",
"id",
",",
"long",
"version",
")",
"{",
"return",
"new",
"File",
"(",
"directory",
",",
"String",
".",
"format",
"(",
"\"%s-%d-%d.log\"",
",",
"Assert",
".... | Creates a segment file for the given directory, log name, segment ID, and segment version. | [
"Creates",
"a",
"segment",
"file",
"for",
"the",
"given",
"directory",
"log",
"name",
"segment",
"ID",
"and",
"segment",
"version",
"."
] | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/storage/SegmentFile.java#L66-L68 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java | MavenProjectScannerPlugin.scanArtifact | private JavaArtifactFileDescriptor scanArtifact(MavenProjectDirectoryDescriptor projectDescriptor, ArtifactFileDescriptor artifactDescriptor, File file,
String path, Scanner scanner) {
"""
Scan a {@link File} that represents a Java artifact.
@param projectDescriptor
The maven project descriptor.
@... | java | private JavaArtifactFileDescriptor scanArtifact(MavenProjectDirectoryDescriptor projectDescriptor, ArtifactFileDescriptor artifactDescriptor, File file,
String path, Scanner scanner) {
JavaArtifactFileDescriptor javaArtifactFileDescriptor = scanner.getContext().getStore().addDescriptorType(artifactD... | [
"private",
"JavaArtifactFileDescriptor",
"scanArtifact",
"(",
"MavenProjectDirectoryDescriptor",
"projectDescriptor",
",",
"ArtifactFileDescriptor",
"artifactDescriptor",
",",
"File",
"file",
",",
"String",
"path",
",",
"Scanner",
"scanner",
")",
"{",
"JavaArtifactFileDescrip... | Scan a {@link File} that represents a Java artifact.
@param projectDescriptor
The maven project descriptor.
@param artifactDescriptor
The resolved {@link MavenArtifactDescriptor}.
@param file
The {@link File}.
@param path
The path of the file.
@param scanner
The {@link Scanner}. | [
"Scan",
"a",
"{",
"@link",
"File",
"}",
"that",
"represents",
"a",
"Java",
"artifact",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L304-L315 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/ActorSDK.java | ActorSDK.startAuthActivity | public void startAuthActivity(Context context, Bundle extras) {
"""
Method is used internally for starting default activity or activity added in delegate
@param context current context
@param extras activity extras
"""
if (!startDelegateActivity(context, delegate.getAuthStartIntent(), extras)) {
... | java | public void startAuthActivity(Context context, Bundle extras) {
if (!startDelegateActivity(context, delegate.getAuthStartIntent(), extras)) {
startActivity(context, extras, AuthActivity.class);
}
} | [
"public",
"void",
"startAuthActivity",
"(",
"Context",
"context",
",",
"Bundle",
"extras",
")",
"{",
"if",
"(",
"!",
"startDelegateActivity",
"(",
"context",
",",
"delegate",
".",
"getAuthStartIntent",
"(",
")",
",",
"extras",
")",
")",
"{",
"startActivity",
... | Method is used internally for starting default activity or activity added in delegate
@param context current context
@param extras activity extras | [
"Method",
"is",
"used",
"internally",
"for",
"starting",
"default",
"activity",
"or",
"activity",
"added",
"in",
"delegate"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/ActorSDK.java#L891-L895 |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/MiscUtil.java | MiscUtil.convertStreamToString | public static String convertStreamToString(InputStream is, String charset) {
"""
To convert an InputStream to a String we use the BufferedReader.readLine()
method. We iterate until the BufferedReader return null which means
there's no more data to read. Each line will appended to a StringBuilder
and returned as... | java | public static String convertStreamToString(InputStream is, String charset) {
if (is == null) return null;
StringBuilder sb = new StringBuilder();
String line;
try {
// TODO: Can this be a performance killer if many many lines or is BufferedReader handling that in a good way?
... | [
"public",
"static",
"String",
"convertStreamToString",
"(",
"InputStream",
"is",
",",
"String",
"charset",
")",
"{",
"if",
"(",
"is",
"==",
"null",
")",
"return",
"null",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"li... | To convert an InputStream to a String we use the BufferedReader.readLine()
method. We iterate until the BufferedReader return null which means
there's no more data to read. Each line will appended to a StringBuilder
and returned as String.
@param is
@return | [
"To",
"convert",
"an",
"InputStream",
"to",
"a",
"String",
"we",
"use",
"the",
"BufferedReader",
".",
"readLine",
"()",
"method",
".",
"We",
"iterate",
"until",
"the",
"BufferedReader",
"return",
"null",
"which",
"means",
"there",
"s",
"no",
"more",
"data",
... | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/MiscUtil.java#L47-L67 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/collections/list/FastArrayList.java | FastArrayList.set | public E set(int index, E element) {
"""
Replaces the element at the specified position in this list with the
specified element.
@param index
index of the element to replace
@param element
element to be stored at the specified position
@return the element previously at the specified position
@throws Index... | java | public E set(int index, E element) {
hashCodeUpToDate = false;
E oldValue = elementData(index);
elementData[index] = element;
return oldValue;
} | [
"public",
"E",
"set",
"(",
"int",
"index",
",",
"E",
"element",
")",
"{",
"hashCodeUpToDate",
"=",
"false",
";",
"E",
"oldValue",
"=",
"elementData",
"(",
"index",
")",
";",
"elementData",
"[",
"index",
"]",
"=",
"element",
";",
"return",
"oldValue",
"... | Replaces the element at the specified position in this list with the
specified element.
@param index
index of the element to replace
@param element
element to be stored at the specified position
@return the element previously at the specified position
@throws IndexOutOfBoundsException
{@inheritDoc} | [
"Replaces",
"the",
"element",
"at",
"the",
"specified",
"position",
"in",
"this",
"list",
"with",
"the",
"specified",
"element",
"."
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/collections/list/FastArrayList.java#L455-L460 |
fabric8io/fabric8-forge | addons/fabric8-camel-maven-plugin/src/main/java/io/fabric8/forge/camel/maven/EndpointHelper.java | EndpointHelper.matchPattern | public static boolean matchPattern(String name, String pattern) {
"""
Matches the name with the given pattern.
<p/>
The match rules are applied in this order:
<ul>
<li>exact match, returns true</li>
<li>wildcard match (pattern ends with a * and the name starts with the pattern), returns true</li>
<li>regular... | java | public static boolean matchPattern(String name, String pattern) {
if (name == null || pattern == null) {
return false;
}
if (name.equals(pattern)) {
// exact match
return true;
}
if (matchWildcard(name, pattern)) {
return true;
... | [
"public",
"static",
"boolean",
"matchPattern",
"(",
"String",
"name",
",",
"String",
"pattern",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"pattern",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"name",
".",
"equals",
"(",
"p... | Matches the name with the given pattern.
<p/>
The match rules are applied in this order:
<ul>
<li>exact match, returns true</li>
<li>wildcard match (pattern ends with a * and the name starts with the pattern), returns true</li>
<li>regular expression match, returns true</li>
<li>otherwise returns false</li>
</ul>
@par... | [
"Matches",
"the",
"name",
"with",
"the",
"given",
"pattern",
".",
"<p",
"/",
">",
"The",
"match",
"rules",
"are",
"applied",
"in",
"this",
"order",
":",
"<ul",
">",
"<li",
">",
"exact",
"match",
"returns",
"true<",
"/",
"li",
">",
"<li",
">",
"wildca... | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/fabric8-camel-maven-plugin/src/main/java/io/fabric8/forge/camel/maven/EndpointHelper.java#L37-L57 |
grails/grails-core | grails-core/src/main/groovy/grails/util/GrailsClassUtils.java | GrailsClassUtils.isGetter | public static boolean isGetter(String name, Class returnType, Class<?>[] args) {
"""
Returns true if the name of the method specified and the number of arguments make it a javabean property getter.
The name is assumed to be a valid Java method name, that is not verified.
@param name The name of the method
@pa... | java | public static boolean isGetter(String name, Class returnType, Class<?>[] args) {
return GrailsNameUtils.isGetter(name, returnType, args);
} | [
"public",
"static",
"boolean",
"isGetter",
"(",
"String",
"name",
",",
"Class",
"returnType",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"args",
")",
"{",
"return",
"GrailsNameUtils",
".",
"isGetter",
"(",
"name",
",",
"returnType",
",",
"args",
")",
";",
... | Returns true if the name of the method specified and the number of arguments make it a javabean property getter.
The name is assumed to be a valid Java method name, that is not verified.
@param name The name of the method
@param returnType The return type of the method
@param args The arguments
@return true if it is a... | [
"Returns",
"true",
"if",
"the",
"name",
"of",
"the",
"method",
"specified",
"and",
"the",
"number",
"of",
"arguments",
"make",
"it",
"a",
"javabean",
"property",
"getter",
".",
"The",
"name",
"is",
"assumed",
"to",
"be",
"a",
"valid",
"Java",
"method",
"... | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L893-L895 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.findAll | @Override
public List<CPAttachmentFileEntry> findAll(int start, int end) {
"""
Returns a range of all the cp attachment file entries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in t... | java | @Override
public List<CPAttachmentFileEntry> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPAttachmentFileEntry",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp attachment file entries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"attachment",
"file",
"entries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L5788-L5791 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/Settings.java | Settings.setOverscrollDistance | public Settings setOverscrollDistance(Context context, float distanceXDp, float distanceYDp) {
"""
Same as {@link #setOverscrollDistance(float, float)} but accepts distance in DP.
@param context Context
@param distanceXDp Horizontal overscroll distance in dp
@param distanceYDp Vertical overscroll distance in ... | java | public Settings setOverscrollDistance(Context context, float distanceXDp, float distanceYDp) {
return setOverscrollDistance(
UnitsUtils.toPixels(context, distanceXDp),
UnitsUtils.toPixels(context, distanceYDp));
} | [
"public",
"Settings",
"setOverscrollDistance",
"(",
"Context",
"context",
",",
"float",
"distanceXDp",
",",
"float",
"distanceYDp",
")",
"{",
"return",
"setOverscrollDistance",
"(",
"UnitsUtils",
".",
"toPixels",
"(",
"context",
",",
"distanceXDp",
")",
",",
"Unit... | Same as {@link #setOverscrollDistance(float, float)} but accepts distance in DP.
@param context Context
@param distanceXDp Horizontal overscroll distance in dp
@param distanceYDp Vertical overscroll distance in dp
@return Current settings object for calls chaining | [
"Same",
"as",
"{",
"@link",
"#setOverscrollDistance",
"(",
"float",
"float",
")",
"}",
"but",
"accepts",
"distance",
"in",
"DP",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/Settings.java#L348-L352 |
qiniu/java-sdk | src/main/java/com/qiniu/storage/BucketManager.java | BucketManager.changeStatus | public Response changeStatus(String bucket, String key, int status)
throws QiniuException {
"""
修改文件的状态(禁用或者正常)
@param bucket 空间名称
@param key 文件名称
@param status 0表示启用;1表示禁用。
@throws QiniuException
"""
String resource = encodedEntry(bucket, key);
String path = String.format(... | java | public Response changeStatus(String bucket, String key, int status)
throws QiniuException {
String resource = encodedEntry(bucket, key);
String path = String.format("/chstatus/%s/status/%d", resource, status);
return rsPost(bucket, path, null);
} | [
"public",
"Response",
"changeStatus",
"(",
"String",
"bucket",
",",
"String",
"key",
",",
"int",
"status",
")",
"throws",
"QiniuException",
"{",
"String",
"resource",
"=",
"encodedEntry",
"(",
"bucket",
",",
"key",
")",
";",
"String",
"path",
"=",
"String",
... | 修改文件的状态(禁用或者正常)
@param bucket 空间名称
@param key 文件名称
@param status 0表示启用;1表示禁用。
@throws QiniuException | [
"修改文件的状态(禁用或者正常)"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/storage/BucketManager.java#L324-L329 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java | MappingUtils.objectExtends | public static boolean objectExtends(Object object, String superClassName) {
"""
Checks if Instance extends specified Class
{@link Class#isAssignableFrom(Class)} is not used as Class might not be available
and String representation can only be used
@param object Instance which would be checked
@param ... | java | public static boolean objectExtends(Object object, String superClassName) {
AssertUtils.assertNotNull(object);
boolean result = false;
Class superClass = object.getClass().getSuperclass();
if (superClass.getName().equals(superClassName) == true) {
result = true;
... | [
"public",
"static",
"boolean",
"objectExtends",
"(",
"Object",
"object",
",",
"String",
"superClassName",
")",
"{",
"AssertUtils",
".",
"assertNotNull",
"(",
"object",
")",
";",
"boolean",
"result",
"=",
"false",
";",
"Class",
"superClass",
"=",
"object",
".",... | Checks if Instance extends specified Class
{@link Class#isAssignableFrom(Class)} is not used as Class might not be available
and String representation can only be used
@param object Instance which would be checked
@param superClassName Class with which it would be checked
@return true if Instance extends speci... | [
"Checks",
"if",
"Instance",
"extends",
"specified",
"Class",
"{",
"@link",
"Class#isAssignableFrom",
"(",
"Class",
")",
"}",
"is",
"not",
"used",
"as",
"Class",
"might",
"not",
"be",
"available",
"and",
"String",
"representation",
"can",
"only",
"be",
"used"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L357-L369 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/AbstractSetEnable.java | AbstractSetEnable.applyEnableAction | private void applyEnableAction(final WComponent target, final boolean enabled) {
"""
Apply the enable action against the target and its children.
@param target the target of this action
@param enabled is the evaluated value
"""
// Found Disableable component
if (target instanceof Disableable) {
targ... | java | private void applyEnableAction(final WComponent target, final boolean enabled) {
// Found Disableable component
if (target instanceof Disableable) {
target.setValidate(enabled);
((Disableable) target).setDisabled(!enabled);
} else if (target instanceof Container) { // Apply to any Disableable children
C... | [
"private",
"void",
"applyEnableAction",
"(",
"final",
"WComponent",
"target",
",",
"final",
"boolean",
"enabled",
")",
"{",
"// Found Disableable component",
"if",
"(",
"target",
"instanceof",
"Disableable",
")",
"{",
"target",
".",
"setValidate",
"(",
"enabled",
... | Apply the enable action against the target and its children.
@param target the target of this action
@param enabled is the evaluated value | [
"Apply",
"the",
"enable",
"action",
"against",
"the",
"target",
"and",
"its",
"children",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/AbstractSetEnable.java#L47-L61 |
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.deleteEntityRole | public OperationStatus deleteEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if paramet... | java | public OperationStatus deleteEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
return deleteEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"deleteEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"entityId",
",",
... | Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeE... | [
"Delete",
"an",
"entity",
"role",
"."
] | 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#L11047-L11049 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.writeToStream | public static void writeToStream(String fullFilePath, OutputStream out) throws IORuntimeException {
"""
将流的内容写入文件<br>
@param fullFilePath 文件绝对路径
@param out 输出流
@throws IORuntimeException IO异常
"""
writeToStream(touch(fullFilePath), out);
} | java | public static void writeToStream(String fullFilePath, OutputStream out) throws IORuntimeException {
writeToStream(touch(fullFilePath), out);
} | [
"public",
"static",
"void",
"writeToStream",
"(",
"String",
"fullFilePath",
",",
"OutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"writeToStream",
"(",
"touch",
"(",
"fullFilePath",
")",
",",
"out",
")",
";",
"}"
] | 将流的内容写入文件<br>
@param fullFilePath 文件绝对路径
@param out 输出流
@throws IORuntimeException IO异常 | [
"将流的内容写入文件<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3188-L3190 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.ensureTableIfNecessary | private void ensureTableIfNecessary(ClassDescriptorDef classDef, String checkLevel) {
"""
Makes sure that the class descriptor has a table attribute if it requires it (i.e. it is
relevant for the repository descriptor).
@param classDef The class descriptor
@param checkLevel The current check level (this con... | java | private void ensureTableIfNecessary(ClassDescriptorDef classDef, String checkLevel)
{
if (classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_OJB_PERSISTENT, false))
{
if (!classDef.hasProperty(PropertyHelper.OJB_PROPERTY_TABLE))
{
classDef.setProper... | [
"private",
"void",
"ensureTableIfNecessary",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"{",
"if",
"(",
"classDef",
".",
"getBooleanProperty",
"(",
"PropertyHelper",
".",
"OJB_PROPERTY_OJB_PERSISTENT",
",",
"false",
")",
")",
"{",
"if",... | Makes sure that the class descriptor has a table attribute if it requires it (i.e. it is
relevant for the repository descriptor).
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is checked in all levels) | [
"Makes",
"sure",
"that",
"the",
"class",
"descriptor",
"has",
"a",
"table",
"attribute",
"if",
"it",
"requires",
"it",
"(",
"i",
".",
"e",
".",
"it",
"is",
"relevant",
"for",
"the",
"repository",
"descriptor",
")",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L206-L215 |
square/dagger | core/src/main/java/dagger/internal/Linker.java | Linker.createBinding | private Binding<?> createBinding(String key, Object requiredBy, ClassLoader classLoader,
boolean mustHaveInjections) {
"""
Returns a binding for the key in {@code deferred}. The type of binding
to be created depends on the key's type:
<ul>
<li>Injections of {@code Provider<Foo>}, {@code MembersInjector<Ba... | java | private Binding<?> createBinding(String key, Object requiredBy, ClassLoader classLoader,
boolean mustHaveInjections) {
String builtInBindingsKey = Keys.getBuiltInBindingsKey(key);
if (builtInBindingsKey != null) {
return new BuiltInBinding<Object>(key, requiredBy, classLoader, builtInBindingsKey);
... | [
"private",
"Binding",
"<",
"?",
">",
"createBinding",
"(",
"String",
"key",
",",
"Object",
"requiredBy",
",",
"ClassLoader",
"classLoader",
",",
"boolean",
"mustHaveInjections",
")",
"{",
"String",
"builtInBindingsKey",
"=",
"Keys",
".",
"getBuiltInBindingsKey",
"... | Returns a binding for the key in {@code deferred}. The type of binding
to be created depends on the key's type:
<ul>
<li>Injections of {@code Provider<Foo>}, {@code MembersInjector<Bar>}, and
{@code Lazy<Blah>} will delegate to the bindings of {@code Foo}, {@code Bar}, and
{@code Blah} respectively.
<li>Injections of r... | [
"Returns",
"a",
"binding",
"for",
"the",
"key",
"in",
"{"
] | train | https://github.com/square/dagger/blob/572cdd2fe97fc3c148fb3d8e1b2ce7beb4dcbcde/core/src/main/java/dagger/internal/Linker.java#L208-L235 |
wonderpush/wonderpush-android-sdk | sdk/src/main/java/com/wonderpush/sdk/WonderPushRestClient.java | WonderPushRestClient.fetchAnonymousAccessTokenAndRunRequest | protected static void fetchAnonymousAccessTokenAndRunRequest(final Request request) {
"""
Fetches an anonymous access token and run the given request with that token.
Retries when access token cannot be fetched.
@param request
The request to be run
"""
fetchAnonymousAccessToken(request.getUserId()... | java | protected static void fetchAnonymousAccessTokenAndRunRequest(final Request request) {
fetchAnonymousAccessToken(request.getUserId(), new ResponseHandler() {
@Override
public void onSuccess(Response response) {
requestAuthenticated(request);
}
@Ove... | [
"protected",
"static",
"void",
"fetchAnonymousAccessTokenAndRunRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"fetchAnonymousAccessToken",
"(",
"request",
".",
"getUserId",
"(",
")",
",",
"new",
"ResponseHandler",
"(",
")",
"{",
"@",
"Override",
"public",
... | Fetches an anonymous access token and run the given request with that token.
Retries when access token cannot be fetched.
@param request
The request to be run | [
"Fetches",
"an",
"anonymous",
"access",
"token",
"and",
"run",
"the",
"given",
"request",
"with",
"that",
"token",
".",
"Retries",
"when",
"access",
"token",
"cannot",
"be",
"fetched",
"."
] | train | https://github.com/wonderpush/wonderpush-android-sdk/blob/ba0a1568f705cdd6206639bfab1e5cf529084b59/sdk/src/main/java/com/wonderpush/sdk/WonderPushRestClient.java#L530-L541 |
Red5/red5-server-common | src/main/java/org/red5/server/stream/AbstractStream.java | AbstractStream.fireStateChange | protected void fireStateChange(StreamState oldState, StreamState newState) {
"""
Creates a new {@link PropertyChangeEvent} and delivers it to all currently registered state listeners.
@param oldState
the {@link StreamState} we had before the change
@param newState
the {@link StreamState} we had after the cha... | java | protected void fireStateChange(StreamState oldState, StreamState newState) {
final PropertyChangeEvent evt = new PropertyChangeEvent(this, "StreamState", oldState, newState);
for (PropertyChangeListener listener : stateListeners) {
listener.propertyChange(evt);
}
} | [
"protected",
"void",
"fireStateChange",
"(",
"StreamState",
"oldState",
",",
"StreamState",
"newState",
")",
"{",
"final",
"PropertyChangeEvent",
"evt",
"=",
"new",
"PropertyChangeEvent",
"(",
"this",
",",
"\"StreamState\"",
",",
"oldState",
",",
"newState",
")",
... | Creates a new {@link PropertyChangeEvent} and delivers it to all currently registered state listeners.
@param oldState
the {@link StreamState} we had before the change
@param newState
the {@link StreamState} we had after the change | [
"Creates",
"a",
"new",
"{",
"@link",
"PropertyChangeEvent",
"}",
"and",
"delivers",
"it",
"to",
"all",
"currently",
"registered",
"state",
"listeners",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/AbstractStream.java#L91-L96 |
keenlabs/KeenClient-Java | query/src/main/java/io/keen/client/java/Percentile.java | Percentile.createStrict | public static Percentile createStrict(double percentile) {
"""
Creates a Percentile instance with a Double value if in the valid range as described in the
<a href="https://keen.io/docs/api/#percentile">Keen APIs</a>. This factory will throw
if the given percentile does not strictly satisfy the rules in those API... | java | public static Percentile createStrict(double percentile) {
if (MIN_PERCENTILE > percentile || MAX_PERCENTILE < percentile) {
throw new IllegalArgumentException("The 'percentile' must be in the range (0, 100].");
}
if (getNumDecimalPlaces(percentile) > 2) {
throw new Ille... | [
"public",
"static",
"Percentile",
"createStrict",
"(",
"double",
"percentile",
")",
"{",
"if",
"(",
"MIN_PERCENTILE",
">",
"percentile",
"||",
"MAX_PERCENTILE",
"<",
"percentile",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The 'percentile' must be i... | Creates a Percentile instance with a Double value if in the valid range as described in the
<a href="https://keen.io/docs/api/#percentile">Keen APIs</a>. This factory will throw
if the given percentile does not strictly satisfy the rules in those API docs. Use
{@link #createCoerced(double)} if clamping and rounding is ... | [
"Creates",
"a",
"Percentile",
"instance",
"with",
"a",
"Double",
"value",
"if",
"in",
"the",
"valid",
"range",
"as",
"described",
"in",
"the",
"<a",
"href",
"=",
"https",
":",
"//",
"keen",
".",
"io",
"/",
"docs",
"/",
"api",
"/",
"#percentile",
">",
... | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/query/src/main/java/io/keen/client/java/Percentile.java#L42-L52 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.fetchByUUID_G | @Override
public CPAttachmentFileEntry fetchByUUID_G(String uuid, long groupId) {
"""
Returns the cp attachment file entry where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching... | java | @Override
public CPAttachmentFileEntry fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CPAttachmentFileEntry",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the cp attachment file entry where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching cp attachment file entry, or <code>null</code> if a matching cp attachment file entry could not... | [
"Returns",
"the",
"cp",
"attachment",
"file",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"fi... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L709-L712 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.findGetter | @SuppressWarnings("unchecked")
public static Method findGetter(String propertyName, Class entityClass) {
"""
Resolves the getter name for the property whose name is 'propertyName' whose type is 'valueType'
in the entity bean whose class is 'entityClass'.
If we don't find a setter following Java's naming conv... | java | @SuppressWarnings("unchecked")
public static Method findGetter(String propertyName, Class entityClass) {
Method getter;
String getterName = "get" + propertyName.substring(0, 1).toUpperCase() +
propertyName.substring(1);
try {
getter = entityClass.getMethod(getter... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Method",
"findGetter",
"(",
"String",
"propertyName",
",",
"Class",
"entityClass",
")",
"{",
"Method",
"getter",
";",
"String",
"getterName",
"=",
"\"get\"",
"+",
"propertyName",
".",
"subs... | Resolves the getter name for the property whose name is 'propertyName' whose type is 'valueType'
in the entity bean whose class is 'entityClass'.
If we don't find a setter following Java's naming conventions, before throwing an exception we try to
resolve the setter following Scala's naming conventions.
@param propert... | [
"Resolves",
"the",
"getter",
"name",
"for",
"the",
"property",
"whose",
"name",
"is",
"propertyName",
"whose",
"type",
"is",
"valueType",
"in",
"the",
"entity",
"bean",
"whose",
"class",
"is",
"entityClass",
".",
"If",
"we",
"don",
"t",
"find",
"a",
"sette... | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L267-L285 |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/views/Hits.java | Hits.getFinalAttributeValue | protected
@Nullable
Spannable getFinalAttributeValue(@NonNull JSONObject hit, @NonNull View view, @NonNull String attribute, @Nullable String attributeValue) {
"""
Returns the attribute's value, {@link RenderingHelper#shouldHighlight(View, String) highlighted} and {@link RenderingHelper#shouldSnippet(View,... | java | protected
@Nullable
Spannable getFinalAttributeValue(@NonNull JSONObject hit, @NonNull View view, @NonNull String attribute, @Nullable String attributeValue) {
Spannable attributeText = null;
if (attributeValue != null) {
if (RenderingHelper.getDefault().shouldHighlight(view, attribu... | [
"protected",
"@",
"Nullable",
"Spannable",
"getFinalAttributeValue",
"(",
"@",
"NonNull",
"JSONObject",
"hit",
",",
"@",
"NonNull",
"View",
"view",
",",
"@",
"NonNull",
"String",
"attribute",
",",
"@",
"Nullable",
"String",
"attributeValue",
")",
"{",
"Spannable... | Returns the attribute's value, {@link RenderingHelper#shouldHighlight(View, String) highlighted} and {@link RenderingHelper#shouldSnippet(View, String) snippetted} if required to. | [
"Returns",
"the",
"attribute",
"s",
"value",
"{"
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/views/Hits.java#L279-L296 |
aws/aws-sdk-java | aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/GetEndpointAttributesResult.java | GetEndpointAttributesResult.withAttributes | public GetEndpointAttributesResult withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
Attributes include the following:
</p>
<ul>
<li>
<p>
<code>CustomUserData</code> – arbitrary user data to associate with the endpoint. Amazon SNS does not use this
data. The data must be in UTF-8 format and... | java | public GetEndpointAttributesResult withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"GetEndpointAttributesResult",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Attributes include the following:
</p>
<ul>
<li>
<p>
<code>CustomUserData</code> – arbitrary user data to associate with the endpoint. Amazon SNS does not use this
data. The data must be in UTF-8 format and less than 2KB.
</p>
</li>
<li>
<p>
<code>Enabled</code> – flag that enables/disables delivery to the endpoint... | [
"<p",
">",
"Attributes",
"include",
"the",
"following",
":",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"<p",
">",
"<code",
">",
"CustomUserData<",
"/",
"code",
">",
"–",
"arbitrary",
"user",
"data",
"to",
"associate",
"with",
"the",
"endpoint",
".",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/GetEndpointAttributesResult.java#L225-L228 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.HEADING | public static HtmlTree HEADING(HtmlTag headingTag, Content body) {
"""
Generates a heading tag (h1 to h6) with some content.
@param headingTag the heading tag to be generated
@param body content for the tag
@return an HtmlTree object for the tag
"""
return HEADING(headingTag, false, null, body);
... | java | public static HtmlTree HEADING(HtmlTag headingTag, Content body) {
return HEADING(headingTag, false, null, body);
} | [
"public",
"static",
"HtmlTree",
"HEADING",
"(",
"HtmlTag",
"headingTag",
",",
"Content",
"body",
")",
"{",
"return",
"HEADING",
"(",
"headingTag",
",",
"false",
",",
"null",
",",
"body",
")",
";",
"}"
] | Generates a heading tag (h1 to h6) with some content.
@param headingTag the heading tag to be generated
@param body content for the tag
@return an HtmlTree object for the tag | [
"Generates",
"a",
"heading",
"tag",
"(",
"h1",
"to",
"h6",
")",
"with",
"some",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L437-L439 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parseAndClose | public final <T> T parseAndClose(Class<T> destinationClass) throws IOException {
"""
Parse a JSON object, array, or value into a new instance of the given destination class, and
then closes the parser.
@param <T> destination class
@param destinationClass destination class that has a public default constructor... | java | public final <T> T parseAndClose(Class<T> destinationClass) throws IOException {
return parseAndClose(destinationClass, null);
} | [
"public",
"final",
"<",
"T",
">",
"T",
"parseAndClose",
"(",
"Class",
"<",
"T",
">",
"destinationClass",
")",
"throws",
"IOException",
"{",
"return",
"parseAndClose",
"(",
"destinationClass",
",",
"null",
")",
";",
"}"
] | Parse a JSON object, array, or value into a new instance of the given destination class, and
then closes the parser.
@param <T> destination class
@param destinationClass destination class that has a public default constructor to use to
create a new instance
@return new instance of the parsed destination class
@since 1... | [
"Parse",
"a",
"JSON",
"object",
"array",
"or",
"value",
"into",
"a",
"new",
"instance",
"of",
"the",
"given",
"destination",
"class",
"and",
"then",
"closes",
"the",
"parser",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L145-L147 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/api/PalDB.java | PalDB.createReader | public static StoreReader createReader(InputStream stream, Configuration config) {
"""
Creates a store reader from the specified <code>stream</code>.
<p>
The reader will read the stream and write its content to a temporary file when this method is called. This is
specifically suited for stream coming from the J... | java | public static StoreReader createReader(InputStream stream, Configuration config) {
return StoreImpl.createReader(stream, config);
} | [
"public",
"static",
"StoreReader",
"createReader",
"(",
"InputStream",
"stream",
",",
"Configuration",
"config",
")",
"{",
"return",
"StoreImpl",
".",
"createReader",
"(",
"stream",
",",
"config",
")",
";",
"}"
] | Creates a store reader from the specified <code>stream</code>.
<p>
The reader will read the stream and write its content to a temporary file when this method is called. This is
specifically suited for stream coming from the JAR as a resource. The stream will be closed by this method.
@param stream an input stream on a... | [
"Creates",
"a",
"store",
"reader",
"from",
"the",
"specified",
"<code",
">",
"stream<",
"/",
"code",
">",
".",
"<p",
">",
"The",
"reader",
"will",
"read",
"the",
"stream",
"and",
"write",
"its",
"content",
"to",
"a",
"temporary",
"file",
"when",
"this",
... | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/api/PalDB.java#L72-L74 |
msgpack/msgpack-java | msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java | MessageUnpacker.readPayload | public void readPayload(byte[] dst, int off, int len)
throws IOException {
"""
Reads payload bytes of binary, extension, or raw string types.
This consumes specified amount of bytes into the specified byte array.
@param dst the byte array into which the data is read
@param off the offset in the ... | java | public void readPayload(byte[] dst, int off, int len)
throws IOException
{
while (true) {
int bufferRemaining = buffer.size() - position;
if (bufferRemaining >= len) {
buffer.getBytes(position, dst, off, len);
position += len;
... | [
"public",
"void",
"readPayload",
"(",
"byte",
"[",
"]",
"dst",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"int",
"bufferRemaining",
"=",
"buffer",
".",
"size",
"(",
")",
"-",
"position",
"... | Reads payload bytes of binary, extension, or raw string types.
This consumes specified amount of bytes into the specified byte array.
@param dst the byte array into which the data is read
@param off the offset in the dst array
@param len the number of bytes to read
@throws IOException when underlying input throws IOE... | [
"Reads",
"payload",
"bytes",
"of",
"binary",
"extension",
"or",
"raw",
"string",
"types",
"."
] | train | https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java#L1597-L1614 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/support/Characters.java | Characters.allBut | public static Characters allBut(char... chars) {
"""
Creates a new Characters instance containing all characters minus the given ones.
@param chars the chars to NOT include
@return a new Characters object
"""
return chars.length == 0 ? Characters.ALL : new Characters(true, chars.clone());
} | java | public static Characters allBut(char... chars) {
return chars.length == 0 ? Characters.ALL : new Characters(true, chars.clone());
} | [
"public",
"static",
"Characters",
"allBut",
"(",
"char",
"...",
"chars",
")",
"{",
"return",
"chars",
".",
"length",
"==",
"0",
"?",
"Characters",
".",
"ALL",
":",
"new",
"Characters",
"(",
"true",
",",
"chars",
".",
"clone",
"(",
")",
")",
";",
"}"
... | Creates a new Characters instance containing all characters minus the given ones.
@param chars the chars to NOT include
@return a new Characters object | [
"Creates",
"a",
"new",
"Characters",
"instance",
"containing",
"all",
"characters",
"minus",
"the",
"given",
"ones",
"."
] | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/support/Characters.java#L277-L279 |
voldemort/voldemort | src/java/voldemort/tools/admin/command/AdminCommandOther.java | AdminCommandOther.executeHelp | public static void executeHelp(String[] args, PrintStream stream) throws Exception {
"""
Parses command-line input and prints help menu.
@throws Exception
"""
String subCmd = (args.length > 0) ? args[0] : "";
if(subCmd.equals("native-backup")) {
SubCommandNativeBackup.printHelp(s... | java | public static void executeHelp(String[] args, PrintStream stream) throws Exception {
String subCmd = (args.length > 0) ? args[0] : "";
if(subCmd.equals("native-backup")) {
SubCommandNativeBackup.printHelp(stream);
} else if(subCmd.equals("restore-from-replica")) {
SubComm... | [
"public",
"static",
"void",
"executeHelp",
"(",
"String",
"[",
"]",
"args",
",",
"PrintStream",
"stream",
")",
"throws",
"Exception",
"{",
"String",
"subCmd",
"=",
"(",
"args",
".",
"length",
">",
"0",
")",
"?",
"args",
"[",
"0",
"]",
":",
"\"\"",
";... | Parses command-line input and prints help menu.
@throws Exception | [
"Parses",
"command",
"-",
"line",
"input",
"and",
"prints",
"help",
"menu",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/command/AdminCommandOther.java#L59-L68 |
mapsforge/mapsforge | mapsforge-map-awt/src/main/java/org/mapsforge/map/awt/graphics/AwtPaint.java | AwtPaint.setBitmapShaderShift | @Override
public void setBitmapShaderShift(Point origin) {
"""
Shifts the bitmap pattern so that it will always start at a multiple of
itself for any tile the pattern is used. This ensures that regardless of
size of the pattern it tiles correctly.
@param origin the reference point
"""
if (this... | java | @Override
public void setBitmapShaderShift(Point origin) {
if (this.texturePaint != null) {
int relativeDx = ((int) -origin.x) % this.shaderWidth;
int relativeDy = ((int) -origin.y) % this.shaderHeight;
Rectangle rectangle = new Rectangle(relativeDx, relativeDy, this.sha... | [
"@",
"Override",
"public",
"void",
"setBitmapShaderShift",
"(",
"Point",
"origin",
")",
"{",
"if",
"(",
"this",
".",
"texturePaint",
"!=",
"null",
")",
"{",
"int",
"relativeDx",
"=",
"(",
"(",
"int",
")",
"-",
"origin",
".",
"x",
")",
"%",
"this",
".... | Shifts the bitmap pattern so that it will always start at a multiple of
itself for any tile the pattern is used. This ensures that regardless of
size of the pattern it tiles correctly.
@param origin the reference point | [
"Shifts",
"the",
"bitmap",
"pattern",
"so",
"that",
"it",
"will",
"always",
"start",
"at",
"a",
"multiple",
"of",
"itself",
"for",
"any",
"tile",
"the",
"pattern",
"is",
"used",
".",
"This",
"ensures",
"that",
"regardless",
"of",
"size",
"of",
"the",
"pa... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-awt/src/main/java/org/mapsforge/map/awt/graphics/AwtPaint.java#L197-L206 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/webapp/PerfWritingHttpServletResponse.java | PerfWritingHttpServletResponse.writePerfStats | public void writePerfStats() {
"""
Write performance metrics to HTTP header field and Cookie.
You don't need to call this method explicitly. It is called
implicitly by calls to {@link #sendError(int)}, {@link #sendRedirect(String)},
{@link #getWriter()} or {@link #getOutputStream()}.
2014-11-17 Now it doesn't ... | java | public void writePerfStats() {
if (hasWritten) {
return;
}
// call timeEnd only if it's not already called, so as
// not to change its value.
long elapsed = PerfStats.getTotal(perfStat);
if (elapsed <= 0) {
elapsed = PerfStats.timeEnd(perfStat);
}
if (perfStatsHeader != null) {
httpResponse.... | [
"public",
"void",
"writePerfStats",
"(",
")",
"{",
"if",
"(",
"hasWritten",
")",
"{",
"return",
";",
"}",
"// call timeEnd only if it's not already called, so as",
"// not to change its value. ",
"long",
"elapsed",
"=",
"PerfStats",
".",
"getTotal",
"(",
"perfStat",
"... | Write performance metrics to HTTP header field and Cookie.
You don't need to call this method explicitly. It is called
implicitly by calls to {@link #sendError(int)}, {@link #sendRedirect(String)},
{@link #getWriter()} or {@link #getOutputStream()}.
2014-11-17 Now it doesn't call {@code timeEnd} for
{@code perfStat}. B... | [
"Write",
"performance",
"metrics",
"to",
"HTTP",
"header",
"field",
"and",
"Cookie",
".",
"You",
"don",
"t",
"need",
"to",
"call",
"this",
"method",
"explicitly",
".",
"It",
"is",
"called",
"implicitly",
"by",
"calls",
"to",
"{"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/webapp/PerfWritingHttpServletResponse.java#L68-L99 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/OAuth20HandlerInterceptorAdapter.java | OAuth20HandlerInterceptorAdapter.isAuthorizationRequest | protected boolean isAuthorizationRequest(final HttpServletRequest request, final HttpServletResponse response) {
"""
Is authorization request.
@param request the request
@param response the response
@return the boolean
"""
val requestPath = request.getRequestURI();
return doesUriMatchPatt... | java | protected boolean isAuthorizationRequest(final HttpServletRequest request, final HttpServletResponse response) {
val requestPath = request.getRequestURI();
return doesUriMatchPattern(requestPath, OAuth20Constants.AUTHORIZE_URL);
} | [
"protected",
"boolean",
"isAuthorizationRequest",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"{",
"val",
"requestPath",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"return",
"doesUriMatchPattern",
"(",... | Is authorization request.
@param request the request
@param response the response
@return the boolean | [
"Is",
"authorization",
"request",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/OAuth20HandlerInterceptorAdapter.java#L120-L123 |
netty/netty | common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java | ResourceLeakDetectorFactory.newResourceLeakDetector | @SuppressWarnings("deprecation")
public <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval) {
"""
Returns a new instance of a {@link ResourceLeakDetector} with the given resource class.
@param resource the resource class used to initialize the {@link ResourceLeakDete... | java | @SuppressWarnings("deprecation")
public <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval) {
return newResourceLeakDetector(resource, ResourceLeakDetector.SAMPLING_INTERVAL, Long.MAX_VALUE);
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"<",
"T",
">",
"ResourceLeakDetector",
"<",
"T",
">",
"newResourceLeakDetector",
"(",
"Class",
"<",
"T",
">",
"resource",
",",
"int",
"samplingInterval",
")",
"{",
"return",
"newResourceLeakDetector",... | Returns a new instance of a {@link ResourceLeakDetector} with the given resource class.
@param resource the resource class used to initialize the {@link ResourceLeakDetector}
@param samplingInterval the interval on which sampling takes place
@param <T> the type of the resource class
@return a new instance of {@link Re... | [
"Returns",
"a",
"new",
"instance",
"of",
"a",
"{",
"@link",
"ResourceLeakDetector",
"}",
"with",
"the",
"given",
"resource",
"class",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/ResourceLeakDetectorFactory.java#L91-L94 |
minio/minio-java | api/src/main/java/io/minio/ServerSideEncryption.java | ServerSideEncryption.withCustomerKey | public static ServerSideEncryption withCustomerKey(SecretKey key)
throws InvalidKeyException, NoSuchAlgorithmException {
"""
Create a new server-side-encryption object for encryption with customer
provided keys (a.k.a. SSE-C).
@param key The secret AES-256 key.
@return An instance of ServerSideEncryption... | java | public static ServerSideEncryption withCustomerKey(SecretKey key)
throws InvalidKeyException, NoSuchAlgorithmException {
if (!isCustomerKeyValid(key)) {
throw new InvalidKeyException("The secret key is not a 256 bit AES key");
}
return new ServerSideEncryptionWithCustomerKey(key, MessageDigest.ge... | [
"public",
"static",
"ServerSideEncryption",
"withCustomerKey",
"(",
"SecretKey",
"key",
")",
"throws",
"InvalidKeyException",
",",
"NoSuchAlgorithmException",
"{",
"if",
"(",
"!",
"isCustomerKeyValid",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"InvalidKeyException",
... | Create a new server-side-encryption object for encryption with customer
provided keys (a.k.a. SSE-C).
@param key The secret AES-256 key.
@return An instance of ServerSideEncryption implementing SSE-C.
@throws InvalidKeyException if the provided secret key is not a 256 bit AES key.
@throws NoSuchAlgorithmException if t... | [
"Create",
"a",
"new",
"server",
"-",
"side",
"-",
"encryption",
"object",
"for",
"encryption",
"with",
"customer",
"provided",
"keys",
"(",
"a",
".",
"k",
".",
"a",
".",
"SSE",
"-",
"C",
")",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/ServerSideEncryption.java#L100-L106 |
azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java | AbstractAzkabanServlet.setSuccessMessageInCookie | protected void setSuccessMessageInCookie(final HttpServletResponse response,
final String message) {
"""
Sets a message in azkaban.success.message in the cookie. This will be used by the web client
javascript to somehow display the message
"""
final Cookie cookie = new Cookie(AZKABAN_SUCCESS_MESSAGE... | java | protected void setSuccessMessageInCookie(final HttpServletResponse response,
final String message) {
final Cookie cookie = new Cookie(AZKABAN_SUCCESS_MESSAGE, message);
cookie.setPath("/");
response.addCookie(cookie);
} | [
"protected",
"void",
"setSuccessMessageInCookie",
"(",
"final",
"HttpServletResponse",
"response",
",",
"final",
"String",
"message",
")",
"{",
"final",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"AZKABAN_SUCCESS_MESSAGE",
",",
"message",
")",
";",
"cookie",
"... | Sets a message in azkaban.success.message in the cookie. This will be used by the web client
javascript to somehow display the message | [
"Sets",
"a",
"message",
"in",
"azkaban",
".",
"success",
".",
"message",
"in",
"the",
"cookie",
".",
"This",
"will",
"be",
"used",
"by",
"the",
"web",
"client",
"javascript",
"to",
"somehow",
"display",
"the",
"message"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java#L219-L224 |
EsotericSoftware/kryo | src/com/esotericsoftware/kryo/serializers/ExternalizableSerializer.java | ExternalizableSerializer.hasInheritableReplaceMethod | static private boolean hasInheritableReplaceMethod (Class type, String methodName) {
"""
/* find out if there are any pesky serialization extras on this class
"""
Method method = null;
Class current = type;
while (current != null) {
try {
method = current.getDeclaredMethod(methodName);
break;
... | java | static private boolean hasInheritableReplaceMethod (Class type, String methodName) {
Method method = null;
Class current = type;
while (current != null) {
try {
method = current.getDeclaredMethod(methodName);
break;
} catch (NoSuchMethodException ex) {
current = current.getSuperclass();
}
}... | [
"static",
"private",
"boolean",
"hasInheritableReplaceMethod",
"(",
"Class",
"type",
",",
"String",
"methodName",
")",
"{",
"Method",
"method",
"=",
"null",
";",
"Class",
"current",
"=",
"type",
";",
"while",
"(",
"current",
"!=",
"null",
")",
"{",
"try",
... | /* find out if there are any pesky serialization extras on this class | [
"/",
"*",
"find",
"out",
"if",
"there",
"are",
"any",
"pesky",
"serialization",
"extras",
"on",
"this",
"class"
] | train | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/serializers/ExternalizableSerializer.java#L121-L133 |
apache/groovy | src/main/java/org/apache/groovy/ast/tools/ExpressionUtils.java | ExpressionUtils.isTypeOrArrayOfType | public static boolean isTypeOrArrayOfType(ClassNode targetType, ClassNode type, boolean recurse) {
"""
Determine if a type matches another type (or array thereof).
@param targetType the candidate type
@param type the type we are checking against
@param recurse true if we can have multi-dimension arrays; shoul... | java | public static boolean isTypeOrArrayOfType(ClassNode targetType, ClassNode type, boolean recurse) {
if (targetType == null) return false;
return type.equals(targetType) ||
(targetType.isArray() && recurse
? isTypeOrArrayOfType(targetType.getComponentType(), type, recurse)
... | [
"public",
"static",
"boolean",
"isTypeOrArrayOfType",
"(",
"ClassNode",
"targetType",
",",
"ClassNode",
"type",
",",
"boolean",
"recurse",
")",
"{",
"if",
"(",
"targetType",
"==",
"null",
")",
"return",
"false",
";",
"return",
"type",
".",
"equals",
"(",
"ta... | Determine if a type matches another type (or array thereof).
@param targetType the candidate type
@param type the type we are checking against
@param recurse true if we can have multi-dimension arrays; should be false for annotation member types
@return true if the type equals the targetType or array thereof | [
"Determine",
"if",
"a",
"type",
"matches",
"another",
"type",
"(",
"or",
"array",
"thereof",
")",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/ast/tools/ExpressionUtils.java#L181-L187 |
hypercube1024/firefly | firefly-wechat/src/main/java/com/firefly/wechat/utils/WXBizMsgCrypt.java | WXBizMsgCrypt.encryptMsg | public String encryptMsg(String replyMsg, String timeStamp, String nonce) throws AesException, IOException {
"""
将公众平台回复用户的消息加密打包.
<ol>
<li>对要发送的消息进行AES-CBC加密</li>
<li>生成安全签名</li>
<li>将消息密文和安全签名打包成xml格式</li>
</ol>
@param replyMsg 公众平台待回复用户的消息,xml格式的字符串
@param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
@pa... | java | public String encryptMsg(String replyMsg, String timeStamp, String nonce) throws AesException, IOException {
// 加密
String encrypt = encrypt(getRandomStr(), replyMsg);
// 生成安全签名
if (timeStamp.equals("")) {
timeStamp = Long.toString(System.currentTimeMillis());
}
... | [
"public",
"String",
"encryptMsg",
"(",
"String",
"replyMsg",
",",
"String",
"timeStamp",
",",
"String",
"nonce",
")",
"throws",
"AesException",
",",
"IOException",
"{",
"// 加密",
"String",
"encrypt",
"=",
"encrypt",
"(",
"getRandomStr",
"(",
")",
",",
"replyMsg... | 将公众平台回复用户的消息加密打包.
<ol>
<li>对要发送的消息进行AES-CBC加密</li>
<li>生成安全签名</li>
<li>将消息密文和安全签名打包成xml格式</li>
</ol>
@param replyMsg 公众平台待回复用户的消息,xml格式的字符串
@param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
@param nonce 随机串,可以自己生成,也可以用URL参数的nonce
@return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串
@throws A... | [
"将公众平台回复用户的消息加密打包",
".",
"<ol",
">",
"<li",
">",
"对要发送的消息进行AES",
"-",
"CBC加密<",
"/",
"li",
">",
"<li",
">",
"生成安全签名<",
"/",
"li",
">",
"<li",
">",
"将消息密文和安全签名打包成xml格式<",
"/",
"li",
">",
"<",
"/",
"ol",
">"
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-wechat/src/main/java/com/firefly/wechat/utils/WXBizMsgCrypt.java#L196-L207 |
marklogic/marklogic-contentpump | mlcp/src/main/java/com/marklogic/contentpump/MultithreadedMapper.java | MultithreadedMapper.setNumberOfThreads | public static void setNumberOfThreads(Job job, int threads) {
"""
Set the number of threads in the pool for running maps.
@param job
the job to modify
@param threads
the new number of threads
"""
job.getConfiguration().setInt(ConfigConstants.CONF_THREADS_PER_SPLIT,
threads);
} | java | public static void setNumberOfThreads(Job job, int threads) {
job.getConfiguration().setInt(ConfigConstants.CONF_THREADS_PER_SPLIT,
threads);
} | [
"public",
"static",
"void",
"setNumberOfThreads",
"(",
"Job",
"job",
",",
"int",
"threads",
")",
"{",
"job",
".",
"getConfiguration",
"(",
")",
".",
"setInt",
"(",
"ConfigConstants",
".",
"CONF_THREADS_PER_SPLIT",
",",
"threads",
")",
";",
"}"
] | Set the number of threads in the pool for running maps.
@param job
the job to modify
@param threads
the new number of threads | [
"Set",
"the",
"number",
"of",
"threads",
"in",
"the",
"pool",
"for",
"running",
"maps",
"."
] | train | https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mlcp/src/main/java/com/marklogic/contentpump/MultithreadedMapper.java#L115-L118 |
crawljax/crawljax | core/src/main/java/com/crawljax/stateabstractions/dom/RTED/RTEDUtils.java | RTEDUtils.getRobustTreeEditDistance | public static double getRobustTreeEditDistance(String dom1, String dom2) {
"""
Get a scalar value for the DOM diversity using the Robust Tree Edit Distance
@param dom1
@param dom2
@return
"""
LblTree domTree1 = null, domTree2 = null;
try {
domTree1 = getDomTree(dom1);
domTree2 = getDomTree(dom2... | java | public static double getRobustTreeEditDistance(String dom1, String dom2) {
LblTree domTree1 = null, domTree2 = null;
try {
domTree1 = getDomTree(dom1);
domTree2 = getDomTree(dom2);
} catch (IOException e) {
e.printStackTrace();
}
double DD = 0.0;
RTED_InfoTree_Opt rted;
double ted;
rted = ne... | [
"public",
"static",
"double",
"getRobustTreeEditDistance",
"(",
"String",
"dom1",
",",
"String",
"dom2",
")",
"{",
"LblTree",
"domTree1",
"=",
"null",
",",
"domTree2",
"=",
"null",
";",
"try",
"{",
"domTree1",
"=",
"getDomTree",
"(",
"dom1",
")",
";",
"dom... | Get a scalar value for the DOM diversity using the Robust Tree Edit Distance
@param dom1
@param dom2
@return | [
"Get",
"a",
"scalar",
"value",
"for",
"the",
"DOM",
"diversity",
"using",
"the",
"Robust",
"Tree",
"Edit",
"Distance"
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/core/src/main/java/com/crawljax/stateabstractions/dom/RTED/RTEDUtils.java#L20-L47 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/connection/Connection.java | Connection.getSessionObject | public <T> T getSessionObject(Class<T> type, String name) {
"""
Recovered a object from the session.
@param type the object type.
@param name the object name.
@param <T> the object type.
@return the object.
"""
T value = (T) session.get(name);
if (logger.isDebugEnabled()) {
... | java | public <T> T getSessionObject(Class<T> type, String name) {
T value = (T) session.get(name);
if (logger.isDebugEnabled()) {
logger.debug("Recovering object [" + name + "] from session with value [" + value + "]");
}
return value;
} | [
"public",
"<",
"T",
">",
"T",
"getSessionObject",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"name",
")",
"{",
"T",
"value",
"=",
"(",
"T",
")",
"session",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(... | Recovered a object from the session.
@param type the object type.
@param name the object name.
@param <T> the object type.
@return the object. | [
"Recovered",
"a",
"object",
"from",
"the",
"session",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/connection/Connection.java#L65-L72 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.addBlock | private long addBlock(Block block, List<BlockWithLocations> results) {
"""
Get all valid locations of the block & add the block to results
return the length of the added block; 0 if the block is not added
"""
ArrayList<String> machineSet =
new ArrayList<String>(blocksMap.numNodes(block));
for (I... | java | private long addBlock(Block block, List<BlockWithLocations> results) {
ArrayList<String> machineSet =
new ArrayList<String>(blocksMap.numNodes(block));
for (Iterator<DatanodeDescriptor> it =
blocksMap.nodeIterator(block); it.hasNext();) {
String storageID = it.next().getStorageID();
// f... | [
"private",
"long",
"addBlock",
"(",
"Block",
"block",
",",
"List",
"<",
"BlockWithLocations",
">",
"results",
")",
"{",
"ArrayList",
"<",
"String",
">",
"machineSet",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"blocksMap",
".",
"numNodes",
"(",
"blo... | Get all valid locations of the block & add the block to results
return the length of the added block; 0 if the block is not added | [
"Get",
"all",
"valid",
"locations",
"of",
"the",
"block",
"&",
"add",
"the",
"block",
"to",
"results",
"return",
"the",
"length",
"of",
"the",
"added",
"block",
";",
"0",
"if",
"the",
"block",
"is",
"not",
"added"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L1185-L1204 |
elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arraylike/ArrayLikeUtil.java | ArrayLikeUtil.getIndexOfMaximum | public static <A> int getIndexOfMaximum(A array, NumberArrayAdapter<?, A> adapter) throws IndexOutOfBoundsException {
"""
Returns the index of the maximum of the given values. If no value is bigger
than the first, the index of the first entry is returned.
@param <A> array type
@param array Array to inspect
@... | java | public static <A> int getIndexOfMaximum(A array, NumberArrayAdapter<?, A> adapter) throws IndexOutOfBoundsException {
final int size = adapter.size(array);
int index = 0;
double max = adapter.getDouble(array, 0);
for (int i = 1; i < size; i++) {
double val = adapter.getDouble(array, i);
if (... | [
"public",
"static",
"<",
"A",
">",
"int",
"getIndexOfMaximum",
"(",
"A",
"array",
",",
"NumberArrayAdapter",
"<",
"?",
",",
"A",
">",
"adapter",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"final",
"int",
"size",
"=",
"adapter",
".",
"size",
"(",
"arr... | Returns the index of the maximum of the given values. If no value is bigger
than the first, the index of the first entry is returned.
@param <A> array type
@param array Array to inspect
@param adapter API adapter class
@return the index of the maximum in the given values
@throws IndexOutOfBoundsException if the length... | [
"Returns",
"the",
"index",
"of",
"the",
"maximum",
"of",
"the",
"given",
"values",
".",
"If",
"no",
"value",
"is",
"bigger",
"than",
"the",
"first",
"the",
"index",
"of",
"the",
"first",
"entry",
"is",
"returned",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arraylike/ArrayLikeUtil.java#L120-L132 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/CreateJobRequest.java | CreateJobRequest.withDefaultArguments | public CreateJobRequest withDefaultArguments(java.util.Map<String, String> defaultArguments) {
"""
<p>
The default arguments for this job.
</p>
<p>
You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue
itself consumes.
</p>
<p>
For information about ... | java | public CreateJobRequest withDefaultArguments(java.util.Map<String, String> defaultArguments) {
setDefaultArguments(defaultArguments);
return this;
} | [
"public",
"CreateJobRequest",
"withDefaultArguments",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"defaultArguments",
")",
"{",
"setDefaultArguments",
"(",
"defaultArguments",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The default arguments for this job.
</p>
<p>
You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue
itself consumes.
</p>
<p>
For information about how to specify and consume your own Job arguments, see the <a
href="http://docs.aws.amazon.com/glue/latest/dg/aw... | [
"<p",
">",
"The",
"default",
"arguments",
"for",
"this",
"job",
".",
"<",
"/",
"p",
">",
"<p",
">",
"You",
"can",
"specify",
"arguments",
"here",
"that",
"your",
"own",
"job",
"-",
"execution",
"script",
"consumes",
"as",
"well",
"as",
"arguments",
"th... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/CreateJobRequest.java#L557-L560 |
m-m-m/util | exception/src/main/java/net/sf/mmm/util/exception/api/ValueOutOfRangeException.java | ValueOutOfRangeException.createMessage | public static <V> NlsMessage createMessage(V value, V minimum, V maximum, Object valueSource) {
"""
Creates a new error {@link NlsMessage} that the given {@code value} is not in the range from
{@code minimum} to {@code maximum}.
@param <V> is the generic type of the values. Needs to be an instance of {@link Nu... | java | public static <V> NlsMessage createMessage(V value, V minimum, V maximum, Object valueSource) {
return createBundle(NlsBundleUtilExceptionRoot.class).errorValueOutOfRange(value,
(minimum == null) ? "\u2212\u221E" : minimum, (maximum == null) ? "+\u221E" : maximum, valueSource);
} | [
"public",
"static",
"<",
"V",
">",
"NlsMessage",
"createMessage",
"(",
"V",
"value",
",",
"V",
"minimum",
",",
"V",
"maximum",
",",
"Object",
"valueSource",
")",
"{",
"return",
"createBundle",
"(",
"NlsBundleUtilExceptionRoot",
".",
"class",
")",
".",
"error... | Creates a new error {@link NlsMessage} that the given {@code value} is not in the range from
{@code minimum} to {@code maximum}.
@param <V> is the generic type of the values. Needs to be an instance of {@link Number} or
{@link Comparable}.
@param value is the invalid value.
@param minimum is the minimum value or {@cod... | [
"Creates",
"a",
"new",
"error",
"{",
"@link",
"NlsMessage",
"}",
"that",
"the",
"given",
"{",
"@code",
"value",
"}",
"is",
"not",
"in",
"the",
"range",
"from",
"{",
"@code",
"minimum",
"}",
"to",
"{",
"@code",
"maximum",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/exception/src/main/java/net/sf/mmm/util/exception/api/ValueOutOfRangeException.java#L182-L186 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/SessionProtocolNegotiationCache.java | SessionProtocolNegotiationCache.setUnsupported | public static void setUnsupported(SocketAddress remoteAddress, SessionProtocol protocol) {
"""
Updates the cache with the information that the specified {@code remoteAddress} does not support
the specified {@link SessionProtocol}.
"""
final String key = key(remoteAddress);
final CacheEntry e =... | java | public static void setUnsupported(SocketAddress remoteAddress, SessionProtocol protocol) {
final String key = key(remoteAddress);
final CacheEntry e = getOrCreate(key);
if (e.addUnsupported(protocol)) {
logger.debug("Updated: '{}' does not support {}", key, e);
}
} | [
"public",
"static",
"void",
"setUnsupported",
"(",
"SocketAddress",
"remoteAddress",
",",
"SessionProtocol",
"protocol",
")",
"{",
"final",
"String",
"key",
"=",
"key",
"(",
"remoteAddress",
")",
";",
"final",
"CacheEntry",
"e",
"=",
"getOrCreate",
"(",
"key",
... | Updates the cache with the information that the specified {@code remoteAddress} does not support
the specified {@link SessionProtocol}. | [
"Updates",
"the",
"cache",
"with",
"the",
"information",
"that",
"the",
"specified",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/SessionProtocolNegotiationCache.java#L85-L92 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TileGroup.java | TileGroup.contains | public boolean contains(Integer sheet, int number) {
"""
Check if tile is contained by the group.
@param sheet The sheet number.
@param number The tile number.
@return <code>true</code> if part of the group, <code>false</code> else.
"""
for (final TileRef current : tiles)
{
... | java | public boolean contains(Integer sheet, int number)
{
for (final TileRef current : tiles)
{
if (current.getSheet().equals(sheet) && current.getNumber() == number)
{
return true;
}
}
return false;
} | [
"public",
"boolean",
"contains",
"(",
"Integer",
"sheet",
",",
"int",
"number",
")",
"{",
"for",
"(",
"final",
"TileRef",
"current",
":",
"tiles",
")",
"{",
"if",
"(",
"current",
".",
"getSheet",
"(",
")",
".",
"equals",
"(",
"sheet",
")",
"&&",
"cur... | Check if tile is contained by the group.
@param sheet The sheet number.
@param number The tile number.
@return <code>true</code> if part of the group, <code>false</code> else. | [
"Check",
"if",
"tile",
"is",
"contained",
"by",
"the",
"group",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TileGroup.java#L87-L97 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.setInt | public void setInt(Element el, String key, int value) {
"""
sets a int value to a XML Element
@param el Element to set value on it
@param key key to set
@param value value to set
"""
el.setAttribute(key, String.valueOf(value));
} | java | public void setInt(Element el, String key, int value) {
el.setAttribute(key, String.valueOf(value));
} | [
"public",
"void",
"setInt",
"(",
"Element",
"el",
",",
"String",
"key",
",",
"int",
"value",
")",
"{",
"el",
".",
"setAttribute",
"(",
"key",
",",
"String",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"}"
] | sets a int value to a XML Element
@param el Element to set value on it
@param key key to set
@param value value to set | [
"sets",
"a",
"int",
"value",
"to",
"a",
"XML",
"Element"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L401-L403 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.getInstance | static final public DateFormat getInstance(Calendar cal, ULocale locale) {
"""
Returns a date/time formatter that uses the SHORT style
for both the date and the time.
@param cal The calendar system for which a date/time format is desired.
@param locale The locale for which the date/time format is desired.
... | java | static final public DateFormat getInstance(Calendar cal, ULocale locale) {
return getDateTimeInstance(cal, SHORT, SHORT, locale);
} | [
"static",
"final",
"public",
"DateFormat",
"getInstance",
"(",
"Calendar",
"cal",
",",
"ULocale",
"locale",
")",
"{",
"return",
"getDateTimeInstance",
"(",
"cal",
",",
"SHORT",
",",
"SHORT",
",",
"locale",
")",
";",
"}"
] | Returns a date/time formatter that uses the SHORT style
for both the date and the time.
@param cal The calendar system for which a date/time format is desired.
@param locale The locale for which the date/time format is desired.
@hide draft / provisional / internal are hidden on Android | [
"Returns",
"a",
"date",
"/",
"time",
"formatter",
"that",
"uses",
"the",
"SHORT",
"style",
"for",
"both",
"the",
"date",
"and",
"the",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1879-L1881 |
google/closure-compiler | src/com/google/javascript/jscomp/ClosureCodingConvention.java | ClosureCodingConvention.extractClassNameIfRequire | @Override
public String extractClassNameIfRequire(Node node, Node parent) {
"""
Extracts X from goog.require('X'), if the applied Node is goog.
@return The extracted class name, or null.
"""
return extractClassNameIfGoog(node, parent, "goog.require");
} | java | @Override
public String extractClassNameIfRequire(Node node, Node parent) {
return extractClassNameIfGoog(node, parent, "goog.require");
} | [
"@",
"Override",
"public",
"String",
"extractClassNameIfRequire",
"(",
"Node",
"node",
",",
"Node",
"parent",
")",
"{",
"return",
"extractClassNameIfGoog",
"(",
"node",
",",
"parent",
",",
"\"goog.require\"",
")",
";",
"}"
] | Extracts X from goog.require('X'), if the applied Node is goog.
@return The extracted class name, or null. | [
"Extracts",
"X",
"from",
"goog",
".",
"require",
"(",
"X",
")",
"if",
"the",
"applied",
"Node",
"is",
"goog",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ClosureCodingConvention.java#L225-L228 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.