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 |
|---|---|---|---|---|---|---|---|---|---|---|
alexa/alexa-skills-kit-sdk-for-java | ask-sdk-core/src/com/amazon/ask/attributes/AttributesManager.java | AttributesManager.setSessionAttributes | public void setSessionAttributes(Map<String, Object> sessionAttributes) {
"""
Sets session attributes, replacing any existing attributes already present in the session. An exception is thrown
if this method is called while processing an out of session request. Use this method when bulk replacing attributes
is de... | java | public void setSessionAttributes(Map<String, Object> sessionAttributes) {
if (requestEnvelope.getSession() == null) {
throw new IllegalStateException("Attempting to set session attributes for out of session request");
}
this.sessionAttributes = sessionAttributes;
} | [
"public",
"void",
"setSessionAttributes",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"sessionAttributes",
")",
"{",
"if",
"(",
"requestEnvelope",
".",
"getSession",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Attempti... | Sets session attributes, replacing any existing attributes already present in the session. An exception is thrown
if this method is called while processing an out of session request. Use this method when bulk replacing attributes
is desired.
@param sessionAttributes session attributes to set
@throws IllegalStateExcept... | [
"Sets",
"session",
"attributes",
"replacing",
"any",
"existing",
"attributes",
"already",
"present",
"in",
"the",
"session",
".",
"An",
"exception",
"is",
"thrown",
"if",
"this",
"method",
"is",
"called",
"while",
"processing",
"an",
"out",
"of",
"session",
"r... | train | https://github.com/alexa/alexa-skills-kit-sdk-for-java/blob/c49194da0693898c70f3f2c4a372f5a12da04e3e/ask-sdk-core/src/com/amazon/ask/attributes/AttributesManager.java#L105-L110 |
wildfly/wildfly-build-tools | provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java | ZipFileSubsystemInputStreamSources.addSubsystemFileSourceFromZipFile | public boolean addSubsystemFileSourceFromZipFile(String subsystem, File file) throws IOException {
"""
Adds the file source for the specified subsystem, from the specified zip file.
@param subsystem
@param file
@return true if such subsystem file source was found and added; false otherwise
@throws IOException
... | java | public boolean addSubsystemFileSourceFromZipFile(String subsystem, File file) throws IOException {
try (ZipFile zip = new ZipFile(file)) {
String entryName = "subsystem-templates/"+subsystem;
ZipEntry entry = zip.getEntry(entryName);
if (entry != null) {
addSu... | [
"public",
"boolean",
"addSubsystemFileSourceFromZipFile",
"(",
"String",
"subsystem",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"ZipFile",
"zip",
"=",
"new",
"ZipFile",
"(",
"file",
")",
")",
"{",
"String",
"entryName",
"=",
"\"subsys... | Adds the file source for the specified subsystem, from the specified zip file.
@param subsystem
@param file
@return true if such subsystem file source was found and added; false otherwise
@throws IOException | [
"Adds",
"the",
"file",
"source",
"for",
"the",
"specified",
"subsystem",
"from",
"the",
"specified",
"zip",
"file",
"."
] | train | https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java#L91-L101 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.debugSendAsync | public Observable<DebugSendResponseInner> debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) {
"""
test send a push notification.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notificatio... | java | public Observable<DebugSendResponseInner> debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) {
return debugSendWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1<ServiceResponse<DebugSendResponseInner>, DebugSendResponseInner>() ... | [
"public",
"Observable",
"<",
"DebugSendResponseInner",
">",
"debugSendAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
")",
"{",
"return",
"debugSendWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | test send a push notification.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the DebugSendResponseInner object | [
"test",
"send",
"a",
"push",
"notification",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L742-L749 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/WorstFit.java | WorstFit.canStay | private boolean canStay(VM vm) {
"""
Check if a VM can stay on its current node.
@param vm the VM
@return {@code true} iff the VM can stay
"""
Mapping m = rp.getSourceModel().getMapping();
if (m.isRunning(vm)) {
int curPos = rp.getNode(m.getVMLocation(vm));
if (!rp.g... | java | private boolean canStay(VM vm) {
Mapping m = rp.getSourceModel().getMapping();
if (m.isRunning(vm)) {
int curPos = rp.getNode(m.getVMLocation(vm));
if (!rp.getVMAction(vm).getDSlice().getHoster().contains(curPos)) {
return false;
}
IStateIn... | [
"private",
"boolean",
"canStay",
"(",
"VM",
"vm",
")",
"{",
"Mapping",
"m",
"=",
"rp",
".",
"getSourceModel",
"(",
")",
".",
"getMapping",
"(",
")",
";",
"if",
"(",
"m",
".",
"isRunning",
"(",
"vm",
")",
")",
"{",
"int",
"curPos",
"=",
"rp",
".",... | Check if a VM can stay on its current node.
@param vm the VM
@return {@code true} iff the VM can stay | [
"Check",
"if",
"a",
"VM",
"can",
"stay",
"on",
"its",
"current",
"node",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/WorstFit.java#L170-L181 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Project.java | Project.createIssue | public Issue createIssue(String name, Map<String, Object> attributes) {
"""
Create a new Issue in this Project.
@param name The initial name of the Issue.
@param attributes additional attributes for the Issue.
@return A new Issue.
"""
return getInstance().create().issue(name, this, attribute... | java | public Issue createIssue(String name, Map<String, Object> attributes) {
return getInstance().create().issue(name, this, attributes);
} | [
"public",
"Issue",
"createIssue",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"issue",
"(",
"name",
",",
"this",
",",
"attributes",
")",
... | Create a new Issue in this Project.
@param name The initial name of the Issue.
@param attributes additional attributes for the Issue.
@return A new Issue. | [
"Create",
"a",
"new",
"Issue",
"in",
"this",
"Project",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L314-L316 |
iipc/openwayback | wayback-cdx-server-core/src/main/java/org/archive/cdxserver/CDXServer.java | CDXServer.findLastCapture | public CDXLine findLastCapture(String url, String digest, boolean ignoreRobots) {
"""
Look up the latest (non-revisit) capture of {@code url} in the
CDX database.
If {@code digest} is non-{@code null}, return only a capture with
identical digest.
@param url URL (in regular form) to look for
@param digest cont... | java | public CDXLine findLastCapture(String url, String digest, boolean ignoreRobots) {
final String WARC_REVISIT = "warc/revisit";
final String REVISIT_FILTER = "!mimetype:" + WARC_REVISIT;
CDXListWriter listWriter = new CDXListWriter();
CDXQuery query = new CDXQuery(url);
query.setFilter(new String[] {
CDXFi... | [
"public",
"CDXLine",
"findLastCapture",
"(",
"String",
"url",
",",
"String",
"digest",
",",
"boolean",
"ignoreRobots",
")",
"{",
"final",
"String",
"WARC_REVISIT",
"=",
"\"warc/revisit\"",
";",
"final",
"String",
"REVISIT_FILTER",
"=",
"\"!mimetype:\"",
"+",
"WARC... | Look up the latest (non-revisit) capture of {@code url} in the
CDX database.
If {@code digest} is non-{@code null}, return only a capture with
identical digest.
@param url URL (in regular form) to look for
@param digest content digest in the same format as CDX database,
or {@code null} if any version qualifies.
@param ... | [
"Look",
"up",
"the",
"latest",
"(",
"non",
"-",
"revisit",
")",
"capture",
"of",
"{"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-cdx-server-core/src/main/java/org/archive/cdxserver/CDXServer.java#L638-L686 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/BlockDrawingHelper.java | BlockDrawingHelper.DrawPrimitive | private void DrawPrimitive( DrawBlock b, World w ) throws Exception {
"""
Draw a single Minecraft block.
@param b Contains information about the block to be drawn.
@param w The world in which to draw.
@throws Exception Throws an exception if the block type is not recognised.
"""
XMLBlockState blockT... | java | private void DrawPrimitive( DrawBlock b, World w ) throws Exception
{
XMLBlockState blockType = new XMLBlockState(b.getType(), b.getColour(), b.getFace(), b.getVariant());
if (!blockType.isValid())
throw new Exception("Unrecogised item type: " + b.getType().value());
BlockPos po... | [
"private",
"void",
"DrawPrimitive",
"(",
"DrawBlock",
"b",
",",
"World",
"w",
")",
"throws",
"Exception",
"{",
"XMLBlockState",
"blockType",
"=",
"new",
"XMLBlockState",
"(",
"b",
".",
"getType",
"(",
")",
",",
"b",
".",
"getColour",
"(",
")",
",",
"b",
... | Draw a single Minecraft block.
@param b Contains information about the block to be drawn.
@param w The world in which to draw.
@throws Exception Throws an exception if the block type is not recognised. | [
"Draw",
"a",
"single",
"Minecraft",
"block",
"."
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/BlockDrawingHelper.java#L217-L225 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.getStaticQuiet | public MethodHandle getStaticQuiet(MethodHandles.Lookup lookup, Class<?> target, String name) {
"""
Apply the chain of transforms and bind them to a static field retrieval specified
using the end signature plus the given class and name. The field must
match the end signature's return value and the end signature ... | java | public MethodHandle getStaticQuiet(MethodHandles.Lookup lookup, Class<?> target, String name) {
try {
return getStatic(lookup, target, name);
} catch (IllegalAccessException | NoSuchFieldException e) {
throw new InvalidTransformException(e);
}
} | [
"public",
"MethodHandle",
"getStaticQuiet",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"Class",
"<",
"?",
">",
"target",
",",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"getStatic",
"(",
"lookup",
",",
"target",
",",
"name",
")",
";",
"}"... | Apply the chain of transforms and bind them to a static field retrieval specified
using the end signature plus the given class and name. The field must
match the end signature's return value and the end signature must take
no arguments.
If the final handle's type does not exactly match the initial type for
this Binder... | [
"Apply",
"the",
"chain",
"of",
"transforms",
"and",
"bind",
"them",
"to",
"a",
"static",
"field",
"retrieval",
"specified",
"using",
"the",
"end",
"signature",
"plus",
"the",
"given",
"class",
"and",
"name",
".",
"The",
"field",
"must",
"match",
"the",
"en... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1452-L1458 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.isInstanceOf | public static void isInstanceOf(Object obj, Class<?> type) {
"""
Asserts that the given {@link Object} is an instance of the specified {@link Class type}.
The assertion holds if and only if the {@link Object} is not {@literal null} and is an instance of
the specified {@link Class type}. This assertion functio... | java | public static void isInstanceOf(Object obj, Class<?> type) {
isInstanceOf(obj, type, "[%1$s] is not an instance of [%2$s]", obj, type);
} | [
"public",
"static",
"void",
"isInstanceOf",
"(",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"isInstanceOf",
"(",
"obj",
",",
"type",
",",
"\"[%1$s] is not an instance of [%2$s]\"",
",",
"obj",
",",
"type",
")",
";",
"}"
] | Asserts that the given {@link Object} is an instance of the specified {@link Class type}.
The assertion holds if and only if the {@link Object} is not {@literal null} and is an instance of
the specified {@link Class type}. This assertion functions exactly the same as
the Java {@literal instanceof} operator.
@param o... | [
"Asserts",
"that",
"the",
"given",
"{",
"@link",
"Object",
"}",
"is",
"an",
"instance",
"of",
"the",
"specified",
"{",
"@link",
"Class",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L697-L699 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.removeToPreviousSeparator | public boolean removeToPreviousSeparator(Issue issue, IXtextDocument document, String separator)
throws BadLocationException {
"""
Remove the element related to the issue, and the whitespaces before the element until the given separator.
@param issue the issue.
@param document the document.
@param separato... | java | public boolean removeToPreviousSeparator(Issue issue, IXtextDocument document, String separator)
throws BadLocationException {
return removeToPreviousSeparator(issue.getOffset(), issue.getLength(), document, separator);
} | [
"public",
"boolean",
"removeToPreviousSeparator",
"(",
"Issue",
"issue",
",",
"IXtextDocument",
"document",
",",
"String",
"separator",
")",
"throws",
"BadLocationException",
"{",
"return",
"removeToPreviousSeparator",
"(",
"issue",
".",
"getOffset",
"(",
")",
",",
... | Remove the element related to the issue, and the whitespaces before the element until the given separator.
@param issue the issue.
@param document the document.
@param separator the separator to consider.
@return <code>true</code> if the separator was found, <code>false</code> if not.
@throws BadLocationException if t... | [
"Remove",
"the",
"element",
"related",
"to",
"the",
"issue",
"and",
"the",
"whitespaces",
"before",
"the",
"element",
"until",
"the",
"given",
"separator",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L315-L318 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.reimageAsync | public Observable<OperationStatusResponseInner> reimageAsync(String resourceGroupName, String vmScaleSetName) {
"""
Reimages (upgrade the operating system) one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set... | java | public Observable<OperationStatusResponseInner> reimageAsync(String resourceGroupName, String vmScaleSetName) {
return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"reimageAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"reimageWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".",
"map",
... | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Reimages",
"(",
"upgrade",
"the",
"operating",
"system",
")",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L2914-L2921 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java | ServiceDiscoveryManager.discoverInfo | public DiscoverInfo discoverInfo(Jid entityID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Returns the discovered information of a given XMPP entity addressed by its JID.
Use null as entityID to query the server
@param entityID the address of the XMPP entit... | java | public DiscoverInfo discoverInfo(Jid entityID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
if (entityID == null)
return discoverInfo(null, null);
synchronized (discoInfoLookupShortcutMechanisms) {
for (DiscoInfoLookupShortcutMech... | [
"public",
"DiscoverInfo",
"discoverInfo",
"(",
"Jid",
"entityID",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"if",
"(",
"entityID",
"==",
"null",
")",
"return",
"discoverInfo",
"(",
... | Returns the discovered information of a given XMPP entity addressed by its JID.
Use null as entityID to query the server
@param entityID the address of the XMPP entity or null.
@return the discovered information.
@throws XMPPErrorException
@throws NoResponseException
@throws NotConnectedException
@throws InterruptedEx... | [
"Returns",
"the",
"discovered",
"information",
"of",
"a",
"given",
"XMPP",
"entity",
"addressed",
"by",
"its",
"JID",
".",
"Use",
"null",
"as",
"entityID",
"to",
"query",
"the",
"server"
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java#L489-L506 |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/patricia/MutableNode.java | MutableNode.splitKey | MutableNode splitKey(final int prefixLength, final byte nextByte) {
"""
Splits current node onto two ones: prefix defined by prefix length and suffix linked with suffix via nextByte.
@param prefixLength length of the prefix.
@param nextByte next byte after prefix linking it with suffix.
@return the prefix... | java | MutableNode splitKey(final int prefixLength, final byte nextByte) {
final byte[] keyBytes = keySequence.getBytesUnsafe();
final ByteIterable prefixKey;
if (prefixLength == 0) {
prefixKey = ByteIterable.EMPTY;
} else if (prefixLength == 1) {
prefixKey = SingleByteI... | [
"MutableNode",
"splitKey",
"(",
"final",
"int",
"prefixLength",
",",
"final",
"byte",
"nextByte",
")",
"{",
"final",
"byte",
"[",
"]",
"keyBytes",
"=",
"keySequence",
".",
"getBytesUnsafe",
"(",
")",
";",
"final",
"ByteIterable",
"prefixKey",
";",
"if",
"(",... | Splits current node onto two ones: prefix defined by prefix length and suffix linked with suffix via nextByte.
@param prefixLength length of the prefix.
@param nextByte next byte after prefix linking it with suffix.
@return the prefix node. | [
"Splits",
"current",
"node",
"onto",
"two",
"ones",
":",
"prefix",
"defined",
"by",
"prefix",
"length",
"and",
"suffix",
"linked",
"with",
"suffix",
"via",
"nextByte",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/patricia/MutableNode.java#L209-L234 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java | SoapClient.setHeader | public SoapClient setHeader(QName name, String actorURI, String roleUri, Boolean mustUnderstand, Boolean relay) {
"""
设置头信息
@param name 头信息标签名
@param actorURI 中间的消息接收者
@param roleUri Role的URI
@param mustUnderstand 标题项对于要对其进行处理的接收者来说是强制的还是可选的
@param relay relay属性
@return this
"""
SOAPHeader header;
... | java | public SoapClient setHeader(QName name, String actorURI, String roleUri, Boolean mustUnderstand, Boolean relay) {
SOAPHeader header;
SOAPHeaderElement ele;
try {
header = this.message.getSOAPHeader();
ele = header.addHeaderElement(name);
if (StrUtil.isNotBlank(roleUri)) {
ele.setRole(roleUri);... | [
"public",
"SoapClient",
"setHeader",
"(",
"QName",
"name",
",",
"String",
"actorURI",
",",
"String",
"roleUri",
",",
"Boolean",
"mustUnderstand",
",",
"Boolean",
"relay",
")",
"{",
"SOAPHeader",
"header",
";",
"SOAPHeaderElement",
"ele",
";",
"try",
"{",
"head... | 设置头信息
@param name 头信息标签名
@param actorURI 中间的消息接收者
@param roleUri Role的URI
@param mustUnderstand 标题项对于要对其进行处理的接收者来说是强制的还是可选的
@param relay relay属性
@return this | [
"设置头信息"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java#L190-L214 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ConsumedCapacity.java | ConsumedCapacity.withGlobalSecondaryIndexes | public ConsumedCapacity withGlobalSecondaryIndexes(java.util.Map<String, Capacity> globalSecondaryIndexes) {
"""
<p>
The amount of throughput consumed on each global index affected by the operation.
</p>
@param globalSecondaryIndexes
The amount of throughput consumed on each global index affected by the oper... | java | public ConsumedCapacity withGlobalSecondaryIndexes(java.util.Map<String, Capacity> globalSecondaryIndexes) {
setGlobalSecondaryIndexes(globalSecondaryIndexes);
return this;
} | [
"public",
"ConsumedCapacity",
"withGlobalSecondaryIndexes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Capacity",
">",
"globalSecondaryIndexes",
")",
"{",
"setGlobalSecondaryIndexes",
"(",
"globalSecondaryIndexes",
")",
";",
"return",
"this",
";",
"}... | <p>
The amount of throughput consumed on each global index affected by the operation.
</p>
@param globalSecondaryIndexes
The amount of throughput consumed on each global index affected by the operation.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"amount",
"of",
"throughput",
"consumed",
"on",
"each",
"global",
"index",
"affected",
"by",
"the",
"operation",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ConsumedCapacity.java#L374-L377 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.addMapMetadataShape | public void addMapMetadataShape(GoogleMapShape mapShape, long featureId, String database, String table) {
"""
Add a map metadata shape with the feature id, database, and table
@param mapShape map metadata shape
@param featureId feature id
@param database GeoPackage database
@param table table name
@si... | java | public void addMapMetadataShape(GoogleMapShape mapShape, long featureId, String database, String table) {
FeatureShape featureShape = getFeatureShape(database, table, featureId);
featureShape.addMetadataShape(mapShape);
} | [
"public",
"void",
"addMapMetadataShape",
"(",
"GoogleMapShape",
"mapShape",
",",
"long",
"featureId",
",",
"String",
"database",
",",
"String",
"table",
")",
"{",
"FeatureShape",
"featureShape",
"=",
"getFeatureShape",
"(",
"database",
",",
"table",
",",
"featureI... | Add a map metadata shape with the feature id, database, and table
@param mapShape map metadata shape
@param featureId feature id
@param database GeoPackage database
@param table table name
@since 3.2.0 | [
"Add",
"a",
"map",
"metadata",
"shape",
"with",
"the",
"feature",
"id",
"database",
"and",
"table"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L194-L197 |
rampatra/jbot | jbot-example/src/main/java/example/jbot/slack/SlackBot.java | SlackBot.askTimeForMeeting | @Controller(next = "askWhetherToRepeat")
public void askTimeForMeeting(WebSocketSession session, Event event) {
"""
This method will be invoked after {@link SlackBot#confirmTiming(WebSocketSession, Event)}.
@param session
@param event
"""
if (event.getText().contains("yes")) {
reply... | java | @Controller(next = "askWhetherToRepeat")
public void askTimeForMeeting(WebSocketSession session, Event event) {
if (event.getText().contains("yes")) {
reply(session, event, "Okay. Would you like me to set a reminder for you?");
nextConversation(event); // jump to next question in ... | [
"@",
"Controller",
"(",
"next",
"=",
"\"askWhetherToRepeat\"",
")",
"public",
"void",
"askTimeForMeeting",
"(",
"WebSocketSession",
"session",
",",
"Event",
"event",
")",
"{",
"if",
"(",
"event",
".",
"getText",
"(",
")",
".",
"contains",
"(",
"\"yes\"",
")"... | This method will be invoked after {@link SlackBot#confirmTiming(WebSocketSession, Event)}.
@param session
@param event | [
"This",
"method",
"will",
"be",
"invoked",
"after",
"{",
"@link",
"SlackBot#confirmTiming",
"(",
"WebSocketSession",
"Event",
")",
"}",
"."
] | train | https://github.com/rampatra/jbot/blob/0f42e1a6ec4dcbc5d1257e1307704903e771f7b5/jbot-example/src/main/java/example/jbot/slack/SlackBot.java#L138-L147 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/CassandraClientBase.java | CassandraClientBase.composeColumnValue | private Object composeColumnValue(CqlMetadata cqlMetadata, byte[] thriftColumnValue, byte[] thriftColumnName) {
"""
Compose column value.
@param cqlMetadata
the cql metadata
@param thriftColumnValue
the thrift column value
@param thriftColumnName
the thrift column name
@return the object
"""
M... | java | private Object composeColumnValue(CqlMetadata cqlMetadata, byte[] thriftColumnValue, byte[] thriftColumnName) {
Map<ByteBuffer, String> schemaTypes = cqlMetadata.getValue_types();
AbstractType<?> type = null;
try {
type = TypeParser.parse(schemaTypes.get(ByteBuffer.wrap(thriftColumnN... | [
"private",
"Object",
"composeColumnValue",
"(",
"CqlMetadata",
"cqlMetadata",
",",
"byte",
"[",
"]",
"thriftColumnValue",
",",
"byte",
"[",
"]",
"thriftColumnName",
")",
"{",
"Map",
"<",
"ByteBuffer",
",",
"String",
">",
"schemaTypes",
"=",
"cqlMetadata",
".",
... | Compose column value.
@param cqlMetadata
the cql metadata
@param thriftColumnValue
the thrift column value
@param thriftColumnName
the thrift column name
@return the object | [
"Compose",
"column",
"value",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/CassandraClientBase.java#L902-L916 |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java | SeleniumGridListener.filterOutputDirectory | public static String filterOutputDirectory(String base, String suiteName) {
"""
Generates and returns output directory string path
@param base
String shows path to the suiteName
@param suiteName
String suiteName specified by config file
@return String - path to output directory for that particular suite
... | java | public static String filterOutputDirectory(String base, String suiteName) {
logger.entering(new Object[] { base, suiteName });
int index = base.lastIndexOf(suiteName);
String outputFolderWithoutName = base.substring(0, index);
logger.exiting(outputFolderWithoutName + File.separator);
... | [
"public",
"static",
"String",
"filterOutputDirectory",
"(",
"String",
"base",
",",
"String",
"suiteName",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"base",
",",
"suiteName",
"}",
")",
";",
"int",
"index",
"=",
"base",
".",... | Generates and returns output directory string path
@param base
String shows path to the suiteName
@param suiteName
String suiteName specified by config file
@return String - path to output directory for that particular suite | [
"Generates",
"and",
"returns",
"output",
"directory",
"string",
"path"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/platform/grid/SeleniumGridListener.java#L405-L411 |
jwtk/jjwt | api/src/main/java/io/jsonwebtoken/lang/Strings.java | Strings.substringMatch | public static boolean substringMatch(CharSequence str, int index, CharSequence substring) {
"""
Test whether the given string matches the given substring
at the given index.
@param str the original string (or StringBuilder)
@param index the index in the original string to start matching against
@param substrin... | java | public static boolean substringMatch(CharSequence str, int index, CharSequence substring) {
for (int j = 0; j < substring.length(); j++) {
int i = index + j;
if (i >= str.length() || str.charAt(i) != substring.charAt(j)) {
return false;
}
}
ret... | [
"public",
"static",
"boolean",
"substringMatch",
"(",
"CharSequence",
"str",
",",
"int",
"index",
",",
"CharSequence",
"substring",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"substring",
".",
"length",
"(",
")",
";",
"j",
"++",
")",
... | Test whether the given string matches the given substring
at the given index.
@param str the original string (or StringBuilder)
@param index the index in the original string to start matching against
@param substring the substring to match at the given index | [
"Test",
"whether",
"the",
"given",
"string",
"matches",
"the",
"given",
"substring",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Strings.java#L342-L350 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/time/APSPSolver.java | APSPSolver.getConstraint | public SimpleDistanceConstraint getConstraint(TimePoint tpFrom, TimePoint tpTo) {
"""
Get active constraint between two {@link TimePoint}s.
@param tpFrom The source {@link TimePoint}.
@param tpTo The destination {@link TimePoint}.
@return The active {@link SimpleDistanceConstraint} between the
two {@link TimeP... | java | public SimpleDistanceConstraint getConstraint(TimePoint tpFrom, TimePoint tpTo) {
if (this.distance[tpFrom.getID()][tpTo.getID()] != INF)
return tPoints[tpFrom.getID()].getOut(tpTo.getID());
return null;
} | [
"public",
"SimpleDistanceConstraint",
"getConstraint",
"(",
"TimePoint",
"tpFrom",
",",
"TimePoint",
"tpTo",
")",
"{",
"if",
"(",
"this",
".",
"distance",
"[",
"tpFrom",
".",
"getID",
"(",
")",
"]",
"[",
"tpTo",
".",
"getID",
"(",
")",
"]",
"!=",
"INF",
... | Get active constraint between two {@link TimePoint}s.
@param tpFrom The source {@link TimePoint}.
@param tpTo The destination {@link TimePoint}.
@return The active {@link SimpleDistanceConstraint} between the
two {@link TimePoint}s (<code>null</code> if none exists). | [
"Get",
"active",
"constraint",
"between",
"two",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/time/APSPSolver.java#L1023-L1027 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/stats/collector/WordNumberCollectorBundle.java | WordNumberCollectorBundle.addNumber | public WordNumberCollectorBundle addNumber(String key, Number number) {
"""
Add number word number collector bundle.
@param key the key
@param number the number
@return the word number collector bundle
"""
numberCollector.add(key, number);
return this;
} | java | public WordNumberCollectorBundle addNumber(String key, Number number) {
numberCollector.add(key, number);
return this;
} | [
"public",
"WordNumberCollectorBundle",
"addNumber",
"(",
"String",
"key",
",",
"Number",
"number",
")",
"{",
"numberCollector",
".",
"add",
"(",
"key",
",",
"number",
")",
";",
"return",
"this",
";",
"}"
] | Add number word number collector bundle.
@param key the key
@param number the number
@return the word number collector bundle | [
"Add",
"number",
"word",
"number",
"collector",
"bundle",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/stats/collector/WordNumberCollectorBundle.java#L79-L82 |
Red5/red5-server-common | src/main/java/org/red5/server/stream/PlayEngine.java | PlayEngine.sendOnPlayStatus | private void sendOnPlayStatus(String code, int duration, long bytes) {
"""
Sends an onPlayStatus message.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetDataEvent.html
@param code
@param duration
@param bytes
"""
if (log.isDebugEnabled()) {
log.de... | java | private void sendOnPlayStatus(String code, int duration, long bytes) {
if (log.isDebugEnabled()) {
log.debug("Sending onPlayStatus - code: {} duration: {} bytes: {}", code, duration, bytes);
}
// create the buffer
IoBuffer buf = IoBuffer.allocate(102);
buf.setAutoExpa... | [
"private",
"void",
"sendOnPlayStatus",
"(",
"String",
"code",
",",
"int",
"duration",
",",
"long",
"bytes",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Sending onPlayStatus - code: {} duration: {} bytes: {}... | Sends an onPlayStatus message.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetDataEvent.html
@param code
@param duration
@param bytes | [
"Sends",
"an",
"onPlayStatus",
"message",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlayEngine.java#L1163-L1194 |
demidenko05/beigesoft-bcommon | src/main/java/org/beigesoft/holder/HldGets.java | HldGets.getFor | @Override
public final Method getFor(final Class<?> pClass, final String pFieldName) {
"""
<p>Get thing for given class and thing name.</p>
@param pClass a Class
@param pFieldName Thing Name
@return a thing
"""
Method rz = null;
try {
rz = getUtlReflection().retrieveGetterForField(pClass, pF... | java | @Override
public final Method getFor(final Class<?> pClass, final String pFieldName) {
Method rz = null;
try {
rz = getUtlReflection().retrieveGetterForField(pClass, pFieldName);
} catch (Exception e) {
e.printStackTrace();
}
return rz;
} | [
"@",
"Override",
"public",
"final",
"Method",
"getFor",
"(",
"final",
"Class",
"<",
"?",
">",
"pClass",
",",
"final",
"String",
"pFieldName",
")",
"{",
"Method",
"rz",
"=",
"null",
";",
"try",
"{",
"rz",
"=",
"getUtlReflection",
"(",
")",
".",
"retriev... | <p>Get thing for given class and thing name.</p>
@param pClass a Class
@param pFieldName Thing Name
@return a thing | [
"<p",
">",
"Get",
"thing",
"for",
"given",
"class",
"and",
"thing",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-bcommon/blob/bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf/src/main/java/org/beigesoft/holder/HldGets.java#L40-L49 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java | PersistentContext.doWithUser | public <T> T doWithUser(final String user, final SpecificUserAction<T> action) {
"""
Execute logic with specific user. Changes user only inside transaction.
Used, for example, to force security checks.
<p>
See {@link ru.vyarus.guice.persist.orient.db.user.UserManager#executeWithTxUser(
String, ru.vyarus.guice.... | java | public <T> T doWithUser(final String user, final SpecificUserAction<T> action) {
return userManager.executeWithTxUser(user, action);
} | [
"public",
"<",
"T",
">",
"T",
"doWithUser",
"(",
"final",
"String",
"user",
",",
"final",
"SpecificUserAction",
"<",
"T",
">",
"action",
")",
"{",
"return",
"userManager",
".",
"executeWithTxUser",
"(",
"user",
",",
"action",
")",
";",
"}"
] | Execute logic with specific user. Changes user only inside transaction.
Used, for example, to force security checks.
<p>
See {@link ru.vyarus.guice.persist.orient.db.user.UserManager#executeWithTxUser(
String, ru.vyarus.guice.persist.orient.db.user.SpecificUserAction)}.
<p>
Use {@link ru.vyarus.guice.persist.orient.db.... | [
"Execute",
"logic",
"with",
"specific",
"user",
".",
"Changes",
"user",
"only",
"inside",
"transaction",
".",
"Used",
"for",
"example",
"to",
"force",
"security",
"checks",
".",
"<p",
">",
"See",
"{",
"@link",
"ru",
".",
"vyarus",
".",
"guice",
".",
"per... | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java#L183-L185 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/RedisAdvancedClusterReactiveCommandsImpl.java | RedisAdvancedClusterReactiveCommandsImpl.executeOnMasters | protected <T> Map<String, Publisher<T>> executeOnMasters(
Function<RedisClusterReactiveCommands<K, V>, ? extends Publisher<T>> function) {
"""
Run a command on all available masters,
@param function function producing the command
@param <T> result type
@return map of a key (counter) and commands.
... | java | protected <T> Map<String, Publisher<T>> executeOnMasters(
Function<RedisClusterReactiveCommands<K, V>, ? extends Publisher<T>> function) {
return executeOnNodes(function, redisClusterNode -> redisClusterNode.is(MASTER));
} | [
"protected",
"<",
"T",
">",
"Map",
"<",
"String",
",",
"Publisher",
"<",
"T",
">",
">",
"executeOnMasters",
"(",
"Function",
"<",
"RedisClusterReactiveCommands",
"<",
"K",
",",
"V",
">",
",",
"?",
"extends",
"Publisher",
"<",
"T",
">",
">",
"function",
... | Run a command on all available masters,
@param function function producing the command
@param <T> result type
@return map of a key (counter) and commands. | [
"Run",
"a",
"command",
"on",
"all",
"available",
"masters"
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/RedisAdvancedClusterReactiveCommandsImpl.java#L521-L524 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.checkArgNotNullOrEmpty | public static <T extends CharSequence> T checkArgNotNullOrEmpty(final T arg, final String argNameOrErrorMsg) {
"""
Checks if the specified {@code arg} is {@code null} or empty, and throws {@code IllegalArgumentException} if it is.
@param arg
@param argNameOrErrorMsg
@throws IllegalArgumentException if the spe... | java | public static <T extends CharSequence> T checkArgNotNullOrEmpty(final T arg, final String argNameOrErrorMsg) {
if (N.isNullOrEmpty(arg)) {
if (argNameOrErrorMsg.indexOf(' ') == N.INDEX_NOT_FOUND) {
throw new IllegalArgumentException("'" + argNameOrErrorMsg + "' can not be null or ... | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"checkArgNotNullOrEmpty",
"(",
"final",
"T",
"arg",
",",
"final",
"String",
"argNameOrErrorMsg",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"arg",
")",
")",
"{",
"if",
"(",
"arg... | Checks if the specified {@code arg} is {@code null} or empty, and throws {@code IllegalArgumentException} if it is.
@param arg
@param argNameOrErrorMsg
@throws IllegalArgumentException if the specified {@code arg} is {@code null} or empty. | [
"Checks",
"if",
"the",
"specified",
"{",
"@code",
"arg",
"}",
"is",
"{",
"@code",
"null",
"}",
"or",
"empty",
"and",
"throws",
"{",
"@code",
"IllegalArgumentException",
"}",
"if",
"it",
"is",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L5578-L5588 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java | ID3v2Tag.updateFrameData | public void updateFrameData(String id, byte[] data) {
"""
Updates the data for the frame specified by id. If no frame exists for
the id specified, a new frame with that id is created.
@param id the id of the frame to update
@param data the data for the frame
"""
if (frames.containsKey(id))
{
((ID3... | java | public void updateFrameData(String id, byte[] data)
{
if (frames.containsKey(id))
{
((ID3v2Frame) frames.get(id)).setFrameData(data);
}
else
{
ID3v2Frame frame = new ID3v2Frame(id, data);
frames.put(id, frame);
}
updateSize();
} | [
"public",
"void",
"updateFrameData",
"(",
"String",
"id",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"frames",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"(",
"(",
"ID3v2Frame",
")",
"frames",
".",
"get",
"(",
"id",
")",
")",
".",
"se... | Updates the data for the frame specified by id. If no frame exists for
the id specified, a new frame with that id is created.
@param id the id of the frame to update
@param data the data for the frame | [
"Updates",
"the",
"data",
"for",
"the",
"frame",
"specified",
"by",
"id",
".",
"If",
"no",
"frame",
"exists",
"for",
"the",
"id",
"specified",
"a",
"new",
"frame",
"with",
"that",
"id",
"is",
"created",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L438-L451 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsStringTemplateRenderer.java | CmsStringTemplateRenderer.renderTemplate | public static String renderTemplate(
CmsObject cms,
String template,
CmsJspContentAccessBean content,
Map<String, Object> contextObjects) {
"""
Renders the given string template.<p>
@param cms the cms context
@param template the template
@param content the content
@param conte... | java | public static String renderTemplate(
CmsObject cms,
String template,
CmsJspContentAccessBean content,
Map<String, Object> contextObjects) {
STGroup group = new STGroup('%', '%');
group.registerRenderer(Date.class, new DateRenderer());
CompiledST cST = group.defin... | [
"public",
"static",
"String",
"renderTemplate",
"(",
"CmsObject",
"cms",
",",
"String",
"template",
",",
"CmsJspContentAccessBean",
"content",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"contextObjects",
")",
"{",
"STGroup",
"group",
"=",
"new",
"STGroup",
... | Renders the given string template.<p>
@param cms the cms context
@param template the template
@param content the content
@param contextObjects additional context objects made available to the template
@return the rendering result | [
"Renders",
"the",
"given",
"string",
"template",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsStringTemplateRenderer.java#L135-L158 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/plugin/Version.java | Version.fromClasspathProperties | public static Version fromClasspathProperties(String path, String propertyName, String gitPath, String gitPropertyName, Version defaultVersion) {
"""
Try to read the version from {@code path} ({@code propertyName} property)
and {@code gitPath} ({@code gitPropertyName} property) from the classpath.
@param path ... | java | public static Version fromClasspathProperties(String path, String propertyName, String gitPath, String gitPropertyName, Version defaultVersion) {
return fromClasspathProperties(Version.class, path, propertyName, gitPath, gitPropertyName, defaultVersion);
} | [
"public",
"static",
"Version",
"fromClasspathProperties",
"(",
"String",
"path",
",",
"String",
"propertyName",
",",
"String",
"gitPath",
",",
"String",
"gitPropertyName",
",",
"Version",
"defaultVersion",
")",
"{",
"return",
"fromClasspathProperties",
"(",
"Version",... | Try to read the version from {@code path} ({@code propertyName} property)
and {@code gitPath} ({@code gitPropertyName} property) from the classpath.
@param path Path of the properties file on the classpath which contains the version information.
@param propertyName The name of the property to read as pro... | [
"Try",
"to",
"read",
"the",
"version",
"from",
"{",
"@code",
"path",
"}",
"(",
"{",
"@code",
"propertyName",
"}",
"property",
")",
"and",
"{",
"@code",
"gitPath",
"}",
"(",
"{",
"@code",
"gitPropertyName",
"}",
"property",
")",
"from",
"the",
"classpath"... | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/plugin/Version.java#L198-L200 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/ByteRangeRandomizer.java | ByteRangeRandomizer.aNewByteRangeRandomizer | public static ByteRangeRandomizer aNewByteRangeRandomizer(final Byte min, final Byte max, final long seed) {
"""
Create a new {@link ByteRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link ByteRangeRandomizer}.
"""
return new ByteRangeRandom... | java | public static ByteRangeRandomizer aNewByteRangeRandomizer(final Byte min, final Byte max, final long seed) {
return new ByteRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"ByteRangeRandomizer",
"aNewByteRangeRandomizer",
"(",
"final",
"Byte",
"min",
",",
"final",
"Byte",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"ByteRangeRandomizer",
"(",
"min",
",",
"max",
",",
"seed",
")",
";",
"}"... | Create a new {@link ByteRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link ByteRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"ByteRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/ByteRangeRandomizer.java#L73-L75 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/Util.java | Util.toLog2 | public static int toLog2(final int value, final String argName) {
"""
Checks the given value if it is a power of 2. If not, it throws an exception.
Otherwise, returns the log-base2 of the given value.
@param value must be a power of 2 and greater than zero.
@param argName the argument name used in the exception... | java | public static int toLog2(final int value, final String argName) {
checkIfPowerOf2(value, argName);
return Integer.numberOfTrailingZeros(value);
} | [
"public",
"static",
"int",
"toLog2",
"(",
"final",
"int",
"value",
",",
"final",
"String",
"argName",
")",
"{",
"checkIfPowerOf2",
"(",
"value",
",",
"argName",
")",
";",
"return",
"Integer",
".",
"numberOfTrailingZeros",
"(",
"value",
")",
";",
"}"
] | Checks the given value if it is a power of 2. If not, it throws an exception.
Otherwise, returns the log-base2 of the given value.
@param value must be a power of 2 and greater than zero.
@param argName the argument name used in the exception if thrown.
@return the log-base2 of the given value | [
"Checks",
"the",
"given",
"value",
"if",
"it",
"is",
"a",
"power",
"of",
"2",
".",
"If",
"not",
"it",
"throws",
"an",
"exception",
".",
"Otherwise",
"returns",
"the",
"log",
"-",
"base2",
"of",
"the",
"given",
"value",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/Util.java#L381-L384 |
symulakr/gwt-generators | src/main/java/com/github/symulakr/gwt/generators/rebind/Logger.java | Logger.die | public void die(String message, Object... params) throws UnableToCompleteException {
"""
Post an error message and halt processing. This method always throws an {@link com.google.gwt.core.ext.UnableToCompleteException}
"""
internalLog(TreeLogger.ERROR, String.format(message, params));
throw new Una... | java | public void die(String message, Object... params) throws UnableToCompleteException
{
internalLog(TreeLogger.ERROR, String.format(message, params));
throw new UnableToCompleteException();
} | [
"public",
"void",
"die",
"(",
"String",
"message",
",",
"Object",
"...",
"params",
")",
"throws",
"UnableToCompleteException",
"{",
"internalLog",
"(",
"TreeLogger",
".",
"ERROR",
",",
"String",
".",
"format",
"(",
"message",
",",
"params",
")",
")",
";",
... | Post an error message and halt processing. This method always throws an {@link com.google.gwt.core.ext.UnableToCompleteException} | [
"Post",
"an",
"error",
"message",
"and",
"halt",
"processing",
".",
"This",
"method",
"always",
"throws",
"an",
"{"
] | train | https://github.com/symulakr/gwt-generators/blob/fb34ea6a5dcc9e83b5ab2e420b638bbef3cfe589/src/main/java/com/github/symulakr/gwt/generators/rebind/Logger.java#L46-L50 |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/evaluator/Evaluator.java | Evaluator.resolveExpressionBlock | protected String resolveExpressionBlock(String expression, EvaluationContext context, boolean urlEncode, EvaluationStrategy strategy, List<String> errors) {
"""
Resolves an expression block found in the template, e.g. @(...). If an evaluation error occurs, expression is
returned as is.
"""
try {
... | java | protected String resolveExpressionBlock(String expression, EvaluationContext context, boolean urlEncode, EvaluationStrategy strategy, List<String> errors) {
try {
String body = expression.substring(1); // strip prefix
// if expression doesn't start with ( then check it's an allowed top ... | [
"protected",
"String",
"resolveExpressionBlock",
"(",
"String",
"expression",
",",
"EvaluationContext",
"context",
",",
"boolean",
"urlEncode",
",",
"EvaluationStrategy",
"strategy",
",",
"List",
"<",
"String",
">",
"errors",
")",
"{",
"try",
"{",
"String",
"body"... | Resolves an expression block found in the template, e.g. @(...). If an evaluation error occurs, expression is
returned as is. | [
"Resolves",
"an",
"expression",
"block",
"found",
"in",
"the",
"template",
"e",
".",
"g",
"."
] | train | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/evaluator/Evaluator.java#L198-L221 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java | DescribeDenseHogFastAlg.growCellArray | void growCellArray(int imageWidth, int imageHeight) {
"""
Determines if the cell array needs to grow. If it does a new array is declared. Old data is recycled when
possible
"""
cellCols = imageWidth/ pixelsPerCell;
cellRows = imageHeight/ pixelsPerCell;
if( cellRows*cellCols > cells.length ) {
Cel... | java | void growCellArray(int imageWidth, int imageHeight) {
cellCols = imageWidth/ pixelsPerCell;
cellRows = imageHeight/ pixelsPerCell;
if( cellRows*cellCols > cells.length ) {
Cell[] a = new Cell[cellCols*cellRows];
System.arraycopy(cells,0,a,0,cells.length);
for (int i = cells.length; i < a.length; i++) {... | [
"void",
"growCellArray",
"(",
"int",
"imageWidth",
",",
"int",
"imageHeight",
")",
"{",
"cellCols",
"=",
"imageWidth",
"/",
"pixelsPerCell",
";",
"cellRows",
"=",
"imageHeight",
"/",
"pixelsPerCell",
";",
"if",
"(",
"cellRows",
"*",
"cellCols",
">",
"cells",
... | Determines if the cell array needs to grow. If it does a new array is declared. Old data is recycled when
possible | [
"Determines",
"if",
"the",
"cell",
"array",
"needs",
"to",
"grow",
".",
"If",
"it",
"does",
"a",
"new",
"array",
"is",
"declared",
".",
"Old",
"data",
"is",
"recycled",
"when",
"possible"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L104-L118 |
hdbeukel/james-extensions | src/main/java/org/jamesframework/ext/analysis/AnalysisResults.java | AnalysisResults.getNumRuns | public int getNumRuns(String problemID, String searchID) {
"""
Get the number of performed runs of the given search when solving the given problem.
@param problemID ID of the problem
@param searchID ID of the applied search
@return number of performed runs of the given search when solving the given problem
@... | java | public int getNumRuns(String problemID, String searchID){
if(!results.containsKey(problemID)){
throw new UnknownIDException("Unknown problem ID " + problemID + ".");
}
if(!results.get(problemID).containsKey(searchID)){
throw new UnknownIDException("Unknown search ID " + s... | [
"public",
"int",
"getNumRuns",
"(",
"String",
"problemID",
",",
"String",
"searchID",
")",
"{",
"if",
"(",
"!",
"results",
".",
"containsKey",
"(",
"problemID",
")",
")",
"{",
"throw",
"new",
"UnknownIDException",
"(",
"\"Unknown problem ID \"",
"+",
"problemI... | Get the number of performed runs of the given search when solving the given problem.
@param problemID ID of the problem
@param searchID ID of the applied search
@return number of performed runs of the given search when solving the given problem
@throws UnknownIDException if an unknown problem or search ID is given | [
"Get",
"the",
"number",
"of",
"performed",
"runs",
"of",
"the",
"given",
"search",
"when",
"solving",
"the",
"given",
"problem",
"."
] | train | https://github.com/hdbeukel/james-extensions/blob/37a43aa6ac4d67575cabc7aed25fd96c91d4c7b2/src/main/java/org/jamesframework/ext/analysis/AnalysisResults.java#L147-L155 |
jbundle/jcalendarbutton | src/main/java/org/jbundle/util/jcalendarbutton/JTimePopup.java | JTimePopup.createTimePopup | public static JTimePopup createTimePopup(Date dateTarget, Component button) {
"""
Create this calendar in a popup menu and synchronize the text field on change.
@param dateTarget The initial date for this button.
@param button The calling button.
"""
return JTimePopup.createTimePopup(null, dateTarget... | java | public static JTimePopup createTimePopup(Date dateTarget, Component button)
{
return JTimePopup.createTimePopup(null, dateTarget, button, null);
} | [
"public",
"static",
"JTimePopup",
"createTimePopup",
"(",
"Date",
"dateTarget",
",",
"Component",
"button",
")",
"{",
"return",
"JTimePopup",
".",
"createTimePopup",
"(",
"null",
",",
"dateTarget",
",",
"button",
",",
"null",
")",
";",
"}"
] | Create this calendar in a popup menu and synchronize the text field on change.
@param dateTarget The initial date for this button.
@param button The calling button. | [
"Create",
"this",
"calendar",
"in",
"a",
"popup",
"menu",
"and",
"synchronize",
"the",
"text",
"field",
"on",
"change",
"."
] | train | https://github.com/jbundle/jcalendarbutton/blob/2944e6a0b634b83768d5c0b7b4a2898176421403/src/main/java/org/jbundle/util/jcalendarbutton/JTimePopup.java#L197-L200 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.newVarNode | static Node newVarNode(Node lhs, Node value) {
"""
Create a VAR node containing the given lhs (name or destructuring pattern) and
initial value expression.
"""
if (lhs.isDestructuringPattern()) {
checkNotNull(value);
return IR.var(new Node(Token.DESTRUCTURING_LHS, lhs, value).srcref(lhs)).srcr... | java | static Node newVarNode(Node lhs, Node value) {
if (lhs.isDestructuringPattern()) {
checkNotNull(value);
return IR.var(new Node(Token.DESTRUCTURING_LHS, lhs, value).srcref(lhs)).srcref(lhs);
} else {
checkState(lhs.isName() && !lhs.hasChildren());
if (value != null) {
lhs.addChild... | [
"static",
"Node",
"newVarNode",
"(",
"Node",
"lhs",
",",
"Node",
"value",
")",
"{",
"if",
"(",
"lhs",
".",
"isDestructuringPattern",
"(",
")",
")",
"{",
"checkNotNull",
"(",
"value",
")",
";",
"return",
"IR",
".",
"var",
"(",
"new",
"Node",
"(",
"Tok... | Create a VAR node containing the given lhs (name or destructuring pattern) and
initial value expression. | [
"Create",
"a",
"VAR",
"node",
"containing",
"the",
"given",
"lhs",
"(",
"name",
"or",
"destructuring",
"pattern",
")",
"and",
"initial",
"value",
"expression",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L4559-L4570 |
apptik/JustJson | json-core/src/main/java/io/apptik/json/JsonObject.java | JsonObject.put | public JsonObject put(String name, Object value) throws JsonException {
"""
Maps {@code name} to {@code value}, clobbering any existing name/value
mapping with the same name. If the value is {@code null}, any existing
mapping for {@code name} is removed.
@param value a {@link JsonObject}, {@link JsonArray}, S... | java | public JsonObject put(String name, Object value) throws JsonException {
return put(name, wrap(value));
} | [
"public",
"JsonObject",
"put",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"JsonException",
"{",
"return",
"put",
"(",
"name",
",",
"wrap",
"(",
"value",
")",
")",
";",
"}"
] | Maps {@code name} to {@code value}, clobbering any existing name/value
mapping with the same name. If the value is {@code null}, any existing
mapping for {@code name} is removed.
@param value a {@link JsonObject}, {@link JsonArray}, String, Boolean,
Integer, Long, Double, {@code null}. May not be
{@link Double#isNaN()... | [
"Maps",
"{",
"@code",
"name",
"}",
"to",
"{",
"@code",
"value",
"}",
"clobbering",
"any",
"existing",
"name",
"/",
"value",
"mapping",
"with",
"the",
"same",
"name",
".",
"If",
"the",
"value",
"is",
"{",
"@code",
"null",
"}",
"any",
"existing",
"mappin... | train | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/JsonObject.java#L190-L192 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/KeysInner.java | KeysInner.listByAutomationAccountAsync | public Observable<KeyListResultInner> listByAutomationAccountAsync(String resourceGroupName, String automationAccountName) {
"""
Retrieve the automation keys for an account.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws Illeg... | java | public Observable<KeyListResultInner> listByAutomationAccountAsync(String resourceGroupName, String automationAccountName) {
return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName).map(new Func1<ServiceResponse<KeyListResultInner>, KeyListResultInner>() {
@Ov... | [
"public",
"Observable",
"<",
"KeyListResultInner",
">",
"listByAutomationAccountAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
")",
"{",
"return",
"listByAutomationAccountWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationA... | Retrieve the automation keys for an account.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the KeyListResultInner object | [
"Retrieve",
"the",
"automation",
"keys",
"for",
"an",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/KeysInner.java#L95-L102 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/service/PartitionKeyMapper.java | PartitionKeyMapper.addFields | public void addFields(Document document, DecoratedKey partitionKey) {
"""
Adds to the specified {@link Document} the {@link Field}s associated to the specified raw partition key.
@param document The document in which the fields are going to be added.
@param partitionKey The raw partition key to be converte... | java | public void addFields(Document document, DecoratedKey partitionKey) {
String serializedKey = ByteBufferUtils.toString(partitionKey.getKey());
Field field = new StringField(FIELD_NAME, serializedKey, Store.YES);
document.add(field);
} | [
"public",
"void",
"addFields",
"(",
"Document",
"document",
",",
"DecoratedKey",
"partitionKey",
")",
"{",
"String",
"serializedKey",
"=",
"ByteBufferUtils",
".",
"toString",
"(",
"partitionKey",
".",
"getKey",
"(",
")",
")",
";",
"Field",
"field",
"=",
"new",... | Adds to the specified {@link Document} the {@link Field}s associated to the specified raw partition key.
@param document The document in which the fields are going to be added.
@param partitionKey The raw partition key to be converted. | [
"Adds",
"to",
"the",
"specified",
"{",
"@link",
"Document",
"}",
"the",
"{",
"@link",
"Field",
"}",
"s",
"associated",
"to",
"the",
"specified",
"raw",
"partition",
"key",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/PartitionKeyMapper.java#L84-L88 |
m-m-m/util | cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java | AbstractCliParser.parseParameterUndefinedOption | private void parseParameterUndefinedOption(String parameter, CliParserState parserState, CliParameterConsumer parameterConsumer) {
"""
Parses the given commandline {@code parameter} that is no defined {@link CliOption}.
@param parameter is the commandline argument.
@param parserState is the current {@link CliP... | java | private void parseParameterUndefinedOption(String parameter, CliParserState parserState, CliParameterConsumer parameterConsumer) {
if (END_OPTIONS.equals(parameter)) {
parserState.setOptionsComplete();
return;
}
CliStyleHandling handling = this.cliState.getCliStyle().optionMixedShortForm();
... | [
"private",
"void",
"parseParameterUndefinedOption",
"(",
"String",
"parameter",
",",
"CliParserState",
"parserState",
",",
"CliParameterConsumer",
"parameterConsumer",
")",
"{",
"if",
"(",
"END_OPTIONS",
".",
"equals",
"(",
"parameter",
")",
")",
"{",
"parserState",
... | Parses the given commandline {@code parameter} that is no defined {@link CliOption}.
@param parameter is the commandline argument.
@param parserState is the current {@link CliParserState}.
@param parameterConsumer is the {@link CliParameterConsumer}. | [
"Parses",
"the",
"given",
"commandline",
"{",
"@code",
"parameter",
"}",
"that",
"is",
"no",
"defined",
"{",
"@link",
"CliOption",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java#L320-L350 |
pierre/serialization | hadoop/src/main/java/com/ning/metrics/serialization/hadoop/pig/ThriftStorage.java | ThriftStorage.setLocation | @Override
public void setLocation(String location, Job job) throws IOException {
"""
Communicate to the loader the location of the object(s) being loaded.
The location string passed to the LoadFunc here is the return value of
{@link org.apache.pig.LoadFunc#relativeToAbsolutePath(String, org.apache.hadoop.fs.... | java | @Override
public void setLocation(String location, Job job) throws IOException
{
setIOSerializations(job.getConfiguration());
FileInputFormat.setInputPaths(job, location);
} | [
"@",
"Override",
"public",
"void",
"setLocation",
"(",
"String",
"location",
",",
"Job",
"job",
")",
"throws",
"IOException",
"{",
"setIOSerializations",
"(",
"job",
".",
"getConfiguration",
"(",
")",
")",
";",
"FileInputFormat",
".",
"setInputPaths",
"(",
"jo... | Communicate to the loader the location of the object(s) being loaded.
The location string passed to the LoadFunc here is the return value of
{@link org.apache.pig.LoadFunc#relativeToAbsolutePath(String, org.apache.hadoop.fs.Path)}. Implementations
should use this method to communicate the location (and any other inform... | [
"Communicate",
"to",
"the",
"loader",
"the",
"location",
"of",
"the",
"object",
"(",
"s",
")",
"being",
"loaded",
".",
"The",
"location",
"string",
"passed",
"to",
"the",
"LoadFunc",
"here",
"is",
"the",
"return",
"value",
"of",
"{",
"@link",
"org",
".",... | train | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/hadoop/src/main/java/com/ning/metrics/serialization/hadoop/pig/ThriftStorage.java#L101-L106 |
kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/PixelInfoStatusBar.java | PixelInfoStatusBar.updateLabel | protected void updateLabel(BufferedImage image, int x, int y, int availableWidth) {
"""
This function updates the contents of the {@link #label}. It is called when the highlighted pixel or the image changes,
and only when the image is not {@code null} and the pixel is within the bounds of the image. If either of ... | java | protected void updateLabel(BufferedImage image, int x, int y, int availableWidth) {
if (image.getRaster().getNumBands()==1) {
label.setText(String.format("%d, %d; intensity %d", x, y,
image.getRaster().getSample(x, y, 0)));
} else if (image.getRaster().getNumBands()==4) {
int rgb = image.getRGB(x, y);
... | [
"protected",
"void",
"updateLabel",
"(",
"BufferedImage",
"image",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"availableWidth",
")",
"{",
"if",
"(",
"image",
".",
"getRaster",
"(",
")",
".",
"getNumBands",
"(",
")",
"==",
"1",
")",
"{",
"label",
"... | This function updates the contents of the {@link #label}. It is called when the highlighted pixel or the image changes,
and only when the image is not {@code null} and the pixel is within the bounds of the image. If either of these
conditions aren't true, the {@code update} function calls {@link #updateLabelNoData()} i... | [
"This",
"function",
"updates",
"the",
"contents",
"of",
"the",
"{"
] | train | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/PixelInfoStatusBar.java#L135-L168 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.invoke | public static <T> T invoke(String classNameWithMethodName, boolean isSingleton, Object... args) {
"""
执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
@param <T> 对象类型
@param classNameWithMethodName 类名和方法名表达式,例如:com.xiaoleilu.hutool.StrUtil#isEmpty或com.xiaoleilu.hutool.StrUtil.isEmpty
@p... | java | public static <T> T invoke(String classNameWithMethodName, boolean isSingleton, Object... args) {
if (StrUtil.isBlank(classNameWithMethodName)) {
throw new UtilException("Blank classNameDotMethodName!");
}
int splitIndex = classNameWithMethodName.lastIndexOf('#');
if (splitIndex <= 0) {
splitIndex... | [
"public",
"static",
"<",
"T",
">",
"T",
"invoke",
"(",
"String",
"classNameWithMethodName",
",",
"boolean",
"isSingleton",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"classNameWithMethodName",
")",
")",
"{",
"throw",
... | 执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
@param <T> 对象类型
@param classNameWithMethodName 类名和方法名表达式,例如:com.xiaoleilu.hutool.StrUtil#isEmpty或com.xiaoleilu.hutool.StrUtil.isEmpty
@param isSingleton 是否为单例对象,如果此参数为false,每次执行方法时创建一个新对象
@param args 参数,必须严格对应指定方法的参数类型和数量
@return 返回结果 | [
"执行方法<br",
">",
"可执行Private方法,也可执行static方法<br",
">",
"执行非static方法时,必须满足对象有默认构造方法<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L634-L651 |
ReactiveX/RxNetty | rxnetty-tcp/src/main/java/io/reactivex/netty/protocol/tcp/server/TcpServer.java | TcpServer.newServer | public static TcpServer<ByteBuf, ByteBuf> newServer(int port, EventLoopGroup eventLoopGroup,
Class<? extends ServerChannel> channelClass) {
"""
Creates a new server using the passed port.
@param port Port for the server. {@code 0} to use ephemeral port.
... | java | public static TcpServer<ByteBuf, ByteBuf> newServer(int port, EventLoopGroup eventLoopGroup,
Class<? extends ServerChannel> channelClass) {
return newServer(port, eventLoopGroup, eventLoopGroup, channelClass);
} | [
"public",
"static",
"TcpServer",
"<",
"ByteBuf",
",",
"ByteBuf",
">",
"newServer",
"(",
"int",
"port",
",",
"EventLoopGroup",
"eventLoopGroup",
",",
"Class",
"<",
"?",
"extends",
"ServerChannel",
">",
"channelClass",
")",
"{",
"return",
"newServer",
"(",
"port... | Creates a new server using the passed port.
@param port Port for the server. {@code 0} to use ephemeral port.
@param eventLoopGroup Eventloop group to be used for server as well as client sockets.
@param channelClass The class to be used for server channel.
@return A new {@link TcpServer} | [
"Creates",
"a",
"new",
"server",
"using",
"the",
"passed",
"port",
"."
] | train | https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-tcp/src/main/java/io/reactivex/netty/protocol/tcp/server/TcpServer.java#L382-L385 |
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/lazy/LazyTreeReader.java | LazyTreeReader.seekToPresentRow | protected void seekToPresentRow(long currentRow) throws IOException {
"""
Shifts only the present stream so that next will return the value for currentRow
@param currentRow
@throws IOException
"""
if (currentRow != previousPresentRow + 1) {
long rowInStripe = currentRow - rowBaseInStripe - 1;
... | java | protected void seekToPresentRow(long currentRow) throws IOException {
if (currentRow != previousPresentRow + 1) {
long rowInStripe = currentRow - rowBaseInStripe - 1;
int rowIndexEntry = computeRowIndexEntry(currentRow);
if (rowIndexEntry != computeRowIndexEntry(previousPresentRow) ||
cu... | [
"protected",
"void",
"seekToPresentRow",
"(",
"long",
"currentRow",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentRow",
"!=",
"previousPresentRow",
"+",
"1",
")",
"{",
"long",
"rowInStripe",
"=",
"currentRow",
"-",
"rowBaseInStripe",
"-",
"1",
";",
"in... | Shifts only the present stream so that next will return the value for currentRow
@param currentRow
@throws IOException | [
"Shifts",
"only",
"the",
"present",
"stream",
"so",
"that",
"next",
"will",
"return",
"the",
"value",
"for",
"currentRow"
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/lazy/LazyTreeReader.java#L185-L206 |
OpenTSDB/opentsdb | src/tools/Fsck.java | Fsck.runQueries | public void runQueries(final List<Query> queries) throws Exception {
"""
Scans the rows matching one or more standard queries. An aggregator is still
required though it's ignored.
@param queries The queries to execute
@throws Exception If something goes pear shaped.
"""
final long start_time = System.cu... | java | public void runQueries(final List<Query> queries) throws Exception {
final long start_time = System.currentTimeMillis() / 1000;
// TODO - threadify it. We *could* have hundreds of queries and we don't
// want to create that many threads. For now we'll just execute each one
// serially
final Thread ... | [
"public",
"void",
"runQueries",
"(",
"final",
"List",
"<",
"Query",
">",
"queries",
")",
"throws",
"Exception",
"{",
"final",
"long",
"start_time",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"1000",
";",
"// TODO - threadify it. We *could* have hundre... | Scans the rows matching one or more standard queries. An aggregator is still
required though it's ignored.
@param queries The queries to execute
@throws Exception If something goes pear shaped. | [
"Scans",
"the",
"rows",
"matching",
"one",
"or",
"more",
"standard",
"queries",
".",
"An",
"aggregator",
"is",
"still",
"required",
"though",
"it",
"s",
"ignored",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/Fsck.java#L183-L213 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.bcryptMatches | public static boolean bcryptMatches(String plain, String storedHash) {
"""
Checks if a hash matches a string.
@param plain plain text string
@param storedHash hashed string
@return true if the hash matches
"""
if (StringUtils.isBlank(plain) || StringUtils.isBlank(storedHash)) {
return false;
}
tr... | java | public static boolean bcryptMatches(String plain, String storedHash) {
if (StringUtils.isBlank(plain) || StringUtils.isBlank(storedHash)) {
return false;
}
try {
return BCrypt.checkpw(plain, storedHash);
} catch (Exception e) {
return false;
}
} | [
"public",
"static",
"boolean",
"bcryptMatches",
"(",
"String",
"plain",
",",
"String",
"storedHash",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"plain",
")",
"||",
"StringUtils",
".",
"isBlank",
"(",
"storedHash",
")",
")",
"{",
"return",
"fa... | Checks if a hash matches a string.
@param plain plain text string
@param storedHash hashed string
@return true if the hash matches | [
"Checks",
"if",
"a",
"hash",
"matches",
"a",
"string",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L197-L206 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_redirection_id_DELETE | public OvhTaskSpecialAccount domain_redirection_id_DELETE(String domain, String id) throws IOException {
"""
Delete an existing redirection in server
REST: DELETE /email/domain/{domain}/redirection/{id}
@param domain [required] Name of your domain name
@param id [required]
"""
String qPath = "/email/dom... | java | public OvhTaskSpecialAccount domain_redirection_id_DELETE(String domain, String id) throws IOException {
String qPath = "/email/domain/{domain}/redirection/{id}";
StringBuilder sb = path(qPath, domain, id);
String resp = exec(qPath, "DELETE", sb.toString(), null);
return convertTo(resp, OvhTaskSpecialAccount.cl... | [
"public",
"OvhTaskSpecialAccount",
"domain_redirection_id_DELETE",
"(",
"String",
"domain",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/redirection/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPat... | Delete an existing redirection in server
REST: DELETE /email/domain/{domain}/redirection/{id}
@param domain [required] Name of your domain name
@param id [required] | [
"Delete",
"an",
"existing",
"redirection",
"in",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1038-L1043 |
google/closure-templates | java/src/com/google/template/soy/jssrc/internal/JsRuntime.java | JsRuntime.symbolWithNamespace | private static Expression symbolWithNamespace(String requireSymbol, String fullyQualifiedSymbol) {
"""
Returns a code chunk that accesses the given symbol.
@param requireSymbol The symbol to {@code goog.require}
@param fullyQualifiedSymbol The symbol we want to access.
"""
GoogRequire require = GoogReq... | java | private static Expression symbolWithNamespace(String requireSymbol, String fullyQualifiedSymbol) {
GoogRequire require = GoogRequire.create(requireSymbol);
if (fullyQualifiedSymbol.equals(require.symbol())) {
return require.reference();
}
String ident = fullyQualifiedSymbol.substring(require.symbo... | [
"private",
"static",
"Expression",
"symbolWithNamespace",
"(",
"String",
"requireSymbol",
",",
"String",
"fullyQualifiedSymbol",
")",
"{",
"GoogRequire",
"require",
"=",
"GoogRequire",
".",
"create",
"(",
"requireSymbol",
")",
";",
"if",
"(",
"fullyQualifiedSymbol",
... | Returns a code chunk that accesses the given symbol.
@param requireSymbol The symbol to {@code goog.require}
@param fullyQualifiedSymbol The symbol we want to access. | [
"Returns",
"a",
"code",
"chunk",
"that",
"accesses",
"the",
"given",
"symbol",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/JsRuntime.java#L229-L236 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/misc/TransposeAlgs_DDRM.java | TransposeAlgs_DDRM.standard | public static void standard(DMatrix1Row A, DMatrix1Row A_tran) {
"""
A straight forward transpose. Good for small non-square matrices.
@param A Original matrix. Not modified.
@param A_tran Transposed matrix. Modified.
"""
int index = 0;
for( int i = 0; i < A_tran.numRows; i++ ) {
... | java | public static void standard(DMatrix1Row A, DMatrix1Row A_tran)
{
int index = 0;
for( int i = 0; i < A_tran.numRows; i++ ) {
int index2 = i;
int end = index + A_tran.numCols;
while( index < end ) {
A_tran.data[index++ ] = A.data[ index2 ];
... | [
"public",
"static",
"void",
"standard",
"(",
"DMatrix1Row",
"A",
",",
"DMatrix1Row",
"A_tran",
")",
"{",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"A_tran",
".",
"numRows",
";",
"i",
"++",
")",
"{",
"int",
"i... | A straight forward transpose. Good for small non-square matrices.
@param A Original matrix. Not modified.
@param A_tran Transposed matrix. Modified. | [
"A",
"straight",
"forward",
"transpose",
".",
"Good",
"for",
"small",
"non",
"-",
"square",
"matrices",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/misc/TransposeAlgs_DDRM.java#L103-L115 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/CCheckOracle.java | CCheckOracle.checkAlive | private List<Metric> checkAlive(final Connection c, final ICommandLine cl) throws BadThresholdException, SQLException {
"""
Checks if the database is reacheble.
@param c
The connection to the database
@param cl
The command line as received from JNRPE
@return The plugin result
@throws BadThresholdException
... | java | private List<Metric> checkAlive(final Connection c, final ICommandLine cl) throws BadThresholdException, SQLException {
List<Metric> metricList = new ArrayList<Metric>();
Statement stmt = null;
ResultSet rs = null;
long lStart = System.currentTimeMillis();
try {
... | [
"private",
"List",
"<",
"Metric",
">",
"checkAlive",
"(",
"final",
"Connection",
"c",
",",
"final",
"ICommandLine",
"cl",
")",
"throws",
"BadThresholdException",
",",
"SQLException",
"{",
"List",
"<",
"Metric",
">",
"metricList",
"=",
"new",
"ArrayList",
"<",
... | Checks if the database is reacheble.
@param c
The connection to the database
@param cl
The command line as received from JNRPE
@return The plugin result
@throws BadThresholdException
-
@throws SQLException | [
"Checks",
"if",
"the",
"database",
"is",
"reacheble",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/CCheckOracle.java#L96-L123 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/MethodParameter.java | MethodParameter.forMethodOrConstructor | public static MethodParameter forMethodOrConstructor(Object methodOrConstructor, int parameterIndex) {
"""
Create a new MethodParameter for the given method or constructor.
<p>
This is a convenience constructor for scenarios where a Method or Constructor reference is treated in a generic fashion.
@param metho... | java | public static MethodParameter forMethodOrConstructor(Object methodOrConstructor, int parameterIndex) {
if (methodOrConstructor instanceof Method) {
return new MethodParameter((Method) methodOrConstructor, parameterIndex);
} else if (methodOrConstructor instanceof Constructor) {
r... | [
"public",
"static",
"MethodParameter",
"forMethodOrConstructor",
"(",
"Object",
"methodOrConstructor",
",",
"int",
"parameterIndex",
")",
"{",
"if",
"(",
"methodOrConstructor",
"instanceof",
"Method",
")",
"{",
"return",
"new",
"MethodParameter",
"(",
"(",
"Method",
... | Create a new MethodParameter for the given method or constructor.
<p>
This is a convenience constructor for scenarios where a Method or Constructor reference is treated in a generic fashion.
@param methodOrConstructor the Method or Constructor to specify a parameter for
@param parameterIndex the index of the parameter... | [
"Create",
"a",
"new",
"MethodParameter",
"for",
"the",
"given",
"method",
"or",
"constructor",
".",
"<p",
">",
"This",
"is",
"a",
"convenience",
"constructor",
"for",
"scenarios",
"where",
"a",
"Method",
"or",
"Constructor",
"reference",
"is",
"treated",
"in",... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/MethodParameter.java#L515-L524 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.resetPassword | public void resetPassword(String userName, ResetPasswordPayload resetPasswordPayload) {
"""
Resets the user password on an environment This operation can take a while to complete.
@param userName The name of the user.
@param resetPasswordPayload Represents the payload for resetting passwords.
@throws IllegalA... | java | public void resetPassword(String userName, ResetPasswordPayload resetPasswordPayload) {
resetPasswordWithServiceResponseAsync(userName, resetPasswordPayload).toBlocking().last().body();
} | [
"public",
"void",
"resetPassword",
"(",
"String",
"userName",
",",
"ResetPasswordPayload",
"resetPasswordPayload",
")",
"{",
"resetPasswordWithServiceResponseAsync",
"(",
"userName",
",",
"resetPasswordPayload",
")",
".",
"toBlocking",
"(",
")",
".",
"last",
"(",
")",... | Resets the user password on an environment This operation can take a while to complete.
@param userName The name of the user.
@param resetPasswordPayload Represents the payload for resetting passwords.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the reques... | [
"Resets",
"the",
"user",
"password",
"on",
"an",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L932-L934 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.credit_balance_GET | public ArrayList<String> credit_balance_GET(OvhType type) throws IOException {
"""
Retrieve credit balance names
REST: GET /me/credit/balance
@param type [required] Balance type
"""
String qPath = "/me/credit/balance";
StringBuilder sb = path(qPath);
query(sb, "type", type);
String resp = exec(qPat... | java | public ArrayList<String> credit_balance_GET(OvhType type) throws IOException {
String qPath = "/me/credit/balance";
StringBuilder sb = path(qPath);
query(sb, "type", type);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t1);
} | [
"public",
"ArrayList",
"<",
"String",
">",
"credit_balance_GET",
"(",
"OvhType",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/credit/balance\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query",
"(",
"sb",
... | Retrieve credit balance names
REST: GET /me/credit/balance
@param type [required] Balance type | [
"Retrieve",
"credit",
"balance",
"names"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L923-L929 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/authenticator/OAuth20CasAuthenticationBuilder.java | OAuth20CasAuthenticationBuilder.buildService | public Service buildService(final OAuthRegisteredService registeredService, final J2EContext context, final boolean useServiceHeader) {
"""
Build service.
@param registeredService the registered service
@param context the context
@param useServiceHeader the use service header
@return the service
... | java | public Service buildService(final OAuthRegisteredService registeredService, final J2EContext context, final boolean useServiceHeader) {
var id = StringUtils.EMPTY;
if (useServiceHeader) {
id = OAuth20Utils.getServiceRequestHeaderIfAny(context.getRequest());
LOGGER.debug("Located ... | [
"public",
"Service",
"buildService",
"(",
"final",
"OAuthRegisteredService",
"registeredService",
",",
"final",
"J2EContext",
"context",
",",
"final",
"boolean",
"useServiceHeader",
")",
"{",
"var",
"id",
"=",
"StringUtils",
".",
"EMPTY",
";",
"if",
"(",
"useServi... | Build service.
@param registeredService the registered service
@param context the context
@param useServiceHeader the use service header
@return the service | [
"Build",
"service",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/authenticator/OAuth20CasAuthenticationBuilder.java#L70-L80 |
mkotsur/restito | src/main/java/com/xebialabs/restito/semantics/Condition.java | Condition.withHeader | public static Condition withHeader(final String key, final String... expectedHeaders) {
"""
With header present and equals.
Header key is case insensitive. More information <a href="http://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive">here</a>.
"""
return new Condition(input -> ... | java | public static Condition withHeader(final String key, final String... expectedHeaders) {
return new Condition(input -> {
for (Map.Entry<String, List<String>> e : input.getHeaders().entrySet()) {
if (e.getKey().equalsIgnoreCase(key)) {
return (expectedHeaders == nul... | [
"public",
"static",
"Condition",
"withHeader",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"...",
"expectedHeaders",
")",
"{",
"return",
"new",
"Condition",
"(",
"input",
"->",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
... | With header present and equals.
Header key is case insensitive. More information <a href="http://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive">here</a>. | [
"With",
"header",
"present",
"and",
"equals",
".",
"Header",
"key",
"is",
"case",
"insensitive",
".",
"More",
"information",
"<a",
"href",
"=",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"5258977",
"/",
"are",
"-",
"http",
"-"... | train | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/semantics/Condition.java#L189-L199 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java | GVRPreference.getIntegerProperty | public Integer getIntegerProperty(String key, Integer defaultValue) {
"""
Gets a boolean property with a boolean value.
@param key The key string.
@param defaultValue The default value.
@return The boolean property value.
"""
String val = getProperty(key, defaultValue.toString());
try {
... | java | public Integer getIntegerProperty(String key, Integer defaultValue) {
String val = getProperty(key, defaultValue.toString());
try {
Integer intVal = Integer.parseInt(val);
return intVal;
} catch (NumberFormatException e) {
return defaultValue;
}
} | [
"public",
"Integer",
"getIntegerProperty",
"(",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"getProperty",
"(",
"key",
",",
"defaultValue",
".",
"toString",
"(",
")",
")",
";",
"try",
"{",
"Integer",
"intVal",
"=",
"Int... | Gets a boolean property with a boolean value.
@param key The key string.
@param defaultValue The default value.
@return The boolean property value. | [
"Gets",
"a",
"boolean",
"property",
"with",
"a",
"boolean",
"value",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java#L73-L81 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java | TranscoderUtils.byteBufToClass | public static <T> T byteBufToClass(ByteBuf input, Class<? extends T> clazz, ObjectMapper mapper) throws IOException {
"""
Decode a {@link ByteBuf} representing a valid JSON entity to the requested target class,
using the {@link ObjectMapper} provided and without releasing the buffer.
Mapper uses a {@link ByteB... | java | public static <T> T byteBufToClass(ByteBuf input, Class<? extends T> clazz, ObjectMapper mapper) throws IOException {
if (input.hasArray()) {
ByteBufToArray toArray = byteBufToByteArray(input);
return mapper.readValue(toArray.byteArray, toArray.offset, toArray.length, clazz);
} e... | [
"public",
"static",
"<",
"T",
">",
"T",
"byteBufToClass",
"(",
"ByteBuf",
"input",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"clazz",
",",
"ObjectMapper",
"mapper",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
".",
"hasArray",
"(",
")",
")... | Decode a {@link ByteBuf} representing a valid JSON entity to the requested target class,
using the {@link ObjectMapper} provided and without releasing the buffer.
Mapper uses a {@link ByteBufInputStream} reading directly the netty {@link ByteBuf} if its
backed by a direct buffer and avoids a memory copy if backed by a... | [
"Decode",
"a",
"{",
"@link",
"ByteBuf",
"}",
"representing",
"a",
"valid",
"JSON",
"entity",
"to",
"the",
"requested",
"target",
"class",
"using",
"the",
"{",
"@link",
"ObjectMapper",
"}",
"provided",
"and",
"without",
"releasing",
"the",
"buffer",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java#L329-L345 |
phax/ph-oton | ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResource.java | WebSiteResource._readAndParseCSS | @Nonnull
private String _readAndParseCSS (@Nonnull final IHasInputStream aISP,
@Nonnull @Nonempty final String sBasePath,
final boolean bRegular) {
"""
Unify all paths in a CSS relative to the passed base path.
@param aISP
Input stream pro... | java | @Nonnull
private String _readAndParseCSS (@Nonnull final IHasInputStream aISP,
@Nonnull @Nonempty final String sBasePath,
final boolean bRegular)
{
final CascadingStyleSheet aCSS = CSSReader.readFromStream (aISP, m_aCharset, ECSSVersion.CSS30... | [
"@",
"Nonnull",
"private",
"String",
"_readAndParseCSS",
"(",
"@",
"Nonnull",
"final",
"IHasInputStream",
"aISP",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sBasePath",
",",
"final",
"boolean",
"bRegular",
")",
"{",
"final",
"CascadingStyleSheet",
... | Unify all paths in a CSS relative to the passed base path.
@param aISP
Input stream provider.
@param sBasePath
The base path, where the source CSS is read from.
@param bRegular
<code>true</code> for normal output, <code>false</code> for minified
output.
@return The modified String. | [
"Unify",
"all",
"paths",
"in",
"a",
"CSS",
"relative",
"to",
"the",
"passed",
"base",
"path",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResource.java#L160-L190 |
AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/ScanJob.java | ScanJob.startScanning | private boolean startScanning() {
"""
Returns true of scanning actually was started, false if it did not need to be
"""
BeaconManager beaconManager = BeaconManager.getInstanceForApplication(getApplicationContext());
beaconManager.setScannerInSameProcess(true);
if (beaconManager.isMainPr... | java | private boolean startScanning() {
BeaconManager beaconManager = BeaconManager.getInstanceForApplication(getApplicationContext());
beaconManager.setScannerInSameProcess(true);
if (beaconManager.isMainProcess()) {
LogManager.i(TAG, "scanJob version %s is starting up on the main process... | [
"private",
"boolean",
"startScanning",
"(",
")",
"{",
"BeaconManager",
"beaconManager",
"=",
"BeaconManager",
".",
"getInstanceForApplication",
"(",
"getApplicationContext",
"(",
")",
")",
";",
"beaconManager",
".",
"setScannerInSameProcess",
"(",
"true",
")",
";",
... | Returns true of scanning actually was started, false if it did not need to be | [
"Returns",
"true",
"of",
"scanning",
"actually",
"was",
"started",
"false",
"if",
"it",
"did",
"not",
"need",
"to",
"be"
] | train | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/ScanJob.java#L238-L252 |
lecousin/java-compression | lzma/src/main/java/net/lecousin/compression/lzma/Optimum.java | Optimum.set3 | void set3(int newPrice, int optCur, int back2, int len2, int back) {
"""
Sets to indicate three LZMA symbols of which the second one
is a literal.
"""
price = newPrice;
optPrev = optCur + len2 + 1;
backPrev = back;
prev1IsLiteral = true;
hasPrev2 = true;
optPrev... | java | void set3(int newPrice, int optCur, int back2, int len2, int back) {
price = newPrice;
optPrev = optCur + len2 + 1;
backPrev = back;
prev1IsLiteral = true;
hasPrev2 = true;
optPrev2 = optCur;
backPrev2 = back2;
} | [
"void",
"set3",
"(",
"int",
"newPrice",
",",
"int",
"optCur",
",",
"int",
"back2",
",",
"int",
"len2",
",",
"int",
"back",
")",
"{",
"price",
"=",
"newPrice",
";",
"optPrev",
"=",
"optCur",
"+",
"len2",
"+",
"1",
";",
"backPrev",
"=",
"back",
";",
... | Sets to indicate three LZMA symbols of which the second one
is a literal. | [
"Sets",
"to",
"indicate",
"three",
"LZMA",
"symbols",
"of",
"which",
"the",
"second",
"one",
"is",
"a",
"literal",
"."
] | train | https://github.com/lecousin/java-compression/blob/19c8001fb3655817a52a3b8ab69501e3df7a2b4a/lzma/src/main/java/net/lecousin/compression/lzma/Optimum.java#L54-L62 |
stripe/stripe-java | src/main/java/com/stripe/model/File.java | File.create | public static File create(Map<String, Object> params, RequestOptions options)
throws StripeException {
"""
To upload a file to Stripe, you’ll need to send a request of type {@code multipart/form-data}.
The request should contain the file you would like to upload, as well as the parameters for
creating a fi... | java | public static File create(Map<String, Object> params, RequestOptions options)
throws StripeException {
return multipartRequest(RequestMethod.POST, classUrl(File.class, Stripe.getUploadBase()),
params, File.class, options);
} | [
"public",
"static",
"File",
"create",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"multipartRequest",
"(",
"RequestMethod",
".",
"POST",
",",
"classUrl",
"(",
"File... | To upload a file to Stripe, you’ll need to send a request of type {@code multipart/form-data}.
The request should contain the file you would like to upload, as well as the parameters for
creating a file. | [
"To",
"upload",
"a",
"file",
"to",
"Stripe",
"you’ll",
"need",
"to",
"send",
"a",
"request",
"of",
"type",
"{"
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/File.java#L104-L108 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.enterPackage | public PackageSymbol enterPackage(Name name, PackageSymbol owner) {
"""
Make a package, given its unqualified name and enclosing package.
"""
return enterPackage(TypeSymbol.formFullName(name, owner));
} | java | public PackageSymbol enterPackage(Name name, PackageSymbol owner) {
return enterPackage(TypeSymbol.formFullName(name, owner));
} | [
"public",
"PackageSymbol",
"enterPackage",
"(",
"Name",
"name",
",",
"PackageSymbol",
"owner",
")",
"{",
"return",
"enterPackage",
"(",
"TypeSymbol",
".",
"formFullName",
"(",
"name",
",",
"owner",
")",
")",
";",
"}"
] | Make a package, given its unqualified name and enclosing package. | [
"Make",
"a",
"package",
"given",
"its",
"unqualified",
"name",
"and",
"enclosing",
"package",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2672-L2674 |
wisdom-framework/wisdom-jcr | wisdom-modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestRepositories.java | RestRepositories.addRepository | public Repository addRepository(String name,
String url) {
"""
Adds a repository to the list.
@param name a {@code non-null} string, the name of the repository.
@param url a {@code non-null} string, the absolute url to the repository
@return a {@link Repository} instance.
... | java | public Repository addRepository(String name,
String url) {
Repository repository = new Repository(name, url);
repositories.add(repository);
return repository;
} | [
"public",
"Repository",
"addRepository",
"(",
"String",
"name",
",",
"String",
"url",
")",
"{",
"Repository",
"repository",
"=",
"new",
"Repository",
"(",
"name",
",",
"url",
")",
";",
"repositories",
".",
"add",
"(",
"repository",
")",
";",
"return",
"rep... | Adds a repository to the list.
@param name a {@code non-null} string, the name of the repository.
@param url a {@code non-null} string, the absolute url to the repository
@return a {@link Repository} instance. | [
"Adds",
"a",
"repository",
"to",
"the",
"list",
"."
] | train | https://github.com/wisdom-framework/wisdom-jcr/blob/2711383dde2239a19b90c226b3fd2aecab5715e4/wisdom-modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestRepositories.java#L67-L72 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/list/primitive/IntInterval.java | IntInterval.evensFromTo | public static IntInterval evensFromTo(int from, int to) {
"""
Returns an IntInterval representing the even values from the value from to the value to.
"""
if (from % 2 != 0)
{
if (from < to)
{
from++;
}
else
{
... | java | public static IntInterval evensFromTo(int from, int to)
{
if (from % 2 != 0)
{
if (from < to)
{
from++;
}
else
{
from--;
}
}
if (to % 2 != 0)
{
if (to > from)
... | [
"public",
"static",
"IntInterval",
"evensFromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"%",
"2",
"!=",
"0",
")",
"{",
"if",
"(",
"from",
"<",
"to",
")",
"{",
"from",
"++",
";",
"}",
"else",
"{",
"from",
"--",
";",
... | Returns an IntInterval representing the even values from the value from to the value to. | [
"Returns",
"an",
"IntInterval",
"representing",
"the",
"even",
"values",
"from",
"the",
"value",
"from",
"to",
"the",
"value",
"to",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/list/primitive/IntInterval.java#L177-L202 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.deleteOrganizationalUnit | public void deleteOrganizationalUnit(CmsRequestContext context, CmsOrganizationalUnit organizationalUnit)
throws CmsException {
"""
Deletes an organizational unit.<p>
Only organizational units that contain no sub organizational unit can be deleted.<p>
The organizational unit can not be delete if it is us... | java | public void deleteOrganizationalUnit(CmsRequestContext context, CmsOrganizationalUnit organizationalUnit)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
// check for root ou
if (organizationalUnit.getParentFqn() == null) {
... | [
"public",
"void",
"deleteOrganizationalUnit",
"(",
"CmsRequestContext",
"context",
",",
"CmsOrganizationalUnit",
"organizationalUnit",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"t... | Deletes an organizational unit.<p>
Only organizational units that contain no sub organizational unit can be deleted.<p>
The organizational unit can not be delete if it is used in the request context,
or if the current user belongs to it.<p>
All users and groups in the given organizational unit will be deleted.<p>
@... | [
"Deletes",
"an",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L1448-L1468 |
rzwitserloot/lombok | src/core/lombok/core/handlers/HandlerUtil.java | HandlerUtil.toAllGetterNames | public static List<String> toAllGetterNames(AST<?, ?, ?> ast, AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean) {
"""
Returns all names of methods that would represent the getter for a field with the provided name.
For example if {@code isBoolean} is true, then a field named {@co... | java | public static List<String> toAllGetterNames(AST<?, ?, ?> ast, AnnotationValues<Accessors> accessors, CharSequence fieldName, boolean isBoolean) {
return toAllAccessorNames(ast, accessors, fieldName, isBoolean, "is", "get", true);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"toAllGetterNames",
"(",
"AST",
"<",
"?",
",",
"?",
",",
"?",
">",
"ast",
",",
"AnnotationValues",
"<",
"Accessors",
">",
"accessors",
",",
"CharSequence",
"fieldName",
",",
"boolean",
"isBoolean",
")",
"{",
... | Returns all names of methods that would represent the getter for a field with the provided name.
For example if {@code isBoolean} is true, then a field named {@code isRunning} would produce:<br />
{@code [isRunning, getRunning, isIsRunning, getIsRunning]}
@param accessors Accessors configuration.
@param fieldName the... | [
"Returns",
"all",
"names",
"of",
"methods",
"that",
"would",
"represent",
"the",
"getter",
"for",
"a",
"field",
"with",
"the",
"provided",
"name",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/core/handlers/HandlerUtil.java#L562-L564 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.toBean | public static <T> T toBean(JSONObject json, Type beanType, boolean ignoreError) {
"""
转为实体类对象
@param <T> Bean类型
@param json JSONObject
@param beanType 实体类对象类型
@param ignoreError 是否忽略转换错误
@return 实体类对象
@since 4.3.2
"""
if (null == json) {
return null;
}
return json.toBean(beanType, ignoreEr... | java | public static <T> T toBean(JSONObject json, Type beanType, boolean ignoreError) {
if (null == json) {
return null;
}
return json.toBean(beanType, ignoreError);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"toBean",
"(",
"JSONObject",
"json",
",",
"Type",
"beanType",
",",
"boolean",
"ignoreError",
")",
"{",
"if",
"(",
"null",
"==",
"json",
")",
"{",
"return",
"null",
";",
"}",
"return",
"json",
".",
"toBean",
"("... | 转为实体类对象
@param <T> Bean类型
@param json JSONObject
@param beanType 实体类对象类型
@param ignoreError 是否忽略转换错误
@return 实体类对象
@since 4.3.2 | [
"转为实体类对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L369-L374 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/JCacheMetrics.java | JCacheMetrics.monitor | public static <K, V, C extends Cache<K, V>> C monitor(MeterRegistry registry, C cache, Iterable<Tag> tags) {
"""
Record metrics on a JCache cache.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param tags Tags to apply to all recorded metrics.
@param <C> T... | java | public static <K, V, C extends Cache<K, V>> C monitor(MeterRegistry registry, C cache, Iterable<Tag> tags) {
new JCacheMetrics(cache, tags).bindTo(registry);
return cache;
} | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"C",
"extends",
"Cache",
"<",
"K",
",",
"V",
">",
">",
"C",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"C",
"cache",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
")",
"{",
"new",
"JCacheMetrics",
"("... | Record metrics on a JCache cache.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param tags Tags to apply to all recorded metrics.
@param <C> The cache type.
@param <K> The cache key type.
@param <V> The cache value type.
@return The instrumented cache, un... | [
"Record",
"metrics",
"on",
"a",
"JCache",
"cache",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/JCacheMetrics.java#L73-L76 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerSerializationUtil.java | TypeSerializerSerializationUtil.writeSerializer | public static <T> void writeSerializer(DataOutputView out, TypeSerializer<T> serializer) throws IOException {
"""
Writes a {@link TypeSerializer} to the provided data output view.
<p>It is written with a format that can be later read again using
{@link #tryReadSerializer(DataInputView, ClassLoader, boolean)}.
... | java | public static <T> void writeSerializer(DataOutputView out, TypeSerializer<T> serializer) throws IOException {
new TypeSerializerSerializationUtil.TypeSerializerSerializationProxy<>(serializer).write(out);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"writeSerializer",
"(",
"DataOutputView",
"out",
",",
"TypeSerializer",
"<",
"T",
">",
"serializer",
")",
"throws",
"IOException",
"{",
"new",
"TypeSerializerSerializationUtil",
".",
"TypeSerializerSerializationProxy",
"<>",
... | Writes a {@link TypeSerializer} to the provided data output view.
<p>It is written with a format that can be later read again using
{@link #tryReadSerializer(DataInputView, ClassLoader, boolean)}.
@param out the data output view.
@param serializer the serializer to write.
@param <T> Data type of the serializer.
@th... | [
"Writes",
"a",
"{",
"@link",
"TypeSerializer",
"}",
"to",
"the",
"provided",
"data",
"output",
"view",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerSerializationUtil.java#L68-L70 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java | MetadataFinder.attachMetadataCache | public void attachMetadataCache(SlotReference slot, File file)
throws IOException {
"""
Attach a metadata cache file to a particular player media slot, so the cache will be used instead of querying
the player for metadata. This supports operation with metadata during shows where DJs are using all four... | java | public void attachMetadataCache(SlotReference slot, File file)
throws IOException {
ensureRunning();
if (slot.player < 1 || slot.player > 4 || DeviceFinder.getInstance().getLatestAnnouncementFrom(slot.player) == null) {
throw new IllegalArgumentException("unable to attach metadat... | [
"public",
"void",
"attachMetadataCache",
"(",
"SlotReference",
"slot",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"ensureRunning",
"(",
")",
";",
"if",
"(",
"slot",
".",
"player",
"<",
"1",
"||",
"slot",
".",
"player",
">",
"4",
"||",
"Devic... | Attach a metadata cache file to a particular player media slot, so the cache will be used instead of querying
the player for metadata. This supports operation with metadata during shows where DJs are using all four player
numbers and heavily cross-linking between them.
If the media is ejected from that player slot, th... | [
"Attach",
"a",
"metadata",
"cache",
"file",
"to",
"a",
"particular",
"player",
"media",
"slot",
"so",
"the",
"cache",
"will",
"be",
"used",
"instead",
"of",
"querying",
"the",
"player",
"for",
"metadata",
".",
"This",
"supports",
"operation",
"with",
"metada... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java#L540-L563 |
Netflix/netflix-graph | src/main/java/com/netflix/nfgraph/NFGraph.java | NFGraph.getConnectionIterator | public OrdinalIterator getConnectionIterator(String connectionModel, String nodeType, int ordinal, String propertyName) {
"""
Retrieve an {@link OrdinalIterator} over all connected ordinals in a given connection model, given the type and ordinal of the originating node, and the property by which this node is conne... | java | public OrdinalIterator getConnectionIterator(String connectionModel, String nodeType, int ordinal, String propertyName) {
int connectionModelIndex = modelHolder.getModelIndex(connectionModel);
return getConnectionIterator(connectionModelIndex, nodeType, ordinal, propertyName);
} | [
"public",
"OrdinalIterator",
"getConnectionIterator",
"(",
"String",
"connectionModel",
",",
"String",
"nodeType",
",",
"int",
"ordinal",
",",
"String",
"propertyName",
")",
"{",
"int",
"connectionModelIndex",
"=",
"modelHolder",
".",
"getModelIndex",
"(",
"connection... | Retrieve an {@link OrdinalIterator} over all connected ordinals in a given connection model, given the type and ordinal of the originating node, and the property by which this node is connected.
@return an {@link OrdinalIterator} over all connected ordinals | [
"Retrieve",
"an",
"{",
"@link",
"OrdinalIterator",
"}",
"over",
"all",
"connected",
"ordinals",
"in",
"a",
"given",
"connection",
"model",
"given",
"the",
"type",
"and",
"ordinal",
"of",
"the",
"originating",
"node",
"and",
"the",
"property",
"by",
"which",
... | train | https://github.com/Netflix/netflix-graph/blob/ee129252a08a9f51dd296d6fca2f0b28b7be284e/src/main/java/com/netflix/nfgraph/NFGraph.java#L134-L137 |
mbenson/uelbox | src/main/java/uelbox/UEL.java | UEL.coerceToType | public static <T> T coerceToType(ELContext context, Class<T> toType, Object object) {
"""
Use EL specification coercion facilities to coerce an object to the specified type.
@param context
@param toType
@param object
@return T
@throws ELException if the coercion fails.
"""
@SuppressWarnings("unc... | java | public static <T> T coerceToType(ELContext context, Class<T> toType, Object object) {
@SuppressWarnings("unchecked")
T result = (T) getExpressionFactory(context).coerceToType(object, toType);
return result;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"coerceToType",
"(",
"ELContext",
"context",
",",
"Class",
"<",
"T",
">",
"toType",
",",
"Object",
"object",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"T",
"result",
"=",
"(",
"T",
")",
"getEx... | Use EL specification coercion facilities to coerce an object to the specified type.
@param context
@param toType
@param object
@return T
@throws ELException if the coercion fails. | [
"Use",
"EL",
"specification",
"coercion",
"facilities",
"to",
"coerce",
"an",
"object",
"to",
"the",
"specified",
"type",
"."
] | train | https://github.com/mbenson/uelbox/blob/b0c2df2c738295bddfd3c16a916e67c9c7c512ef/src/main/java/uelbox/UEL.java#L248-L252 |
bmwcarit/joynr | java/messaging/bounceproxy-controller-service/src/main/java/io/joynr/messaging/info/PerformanceMeasures.java | PerformanceMeasures.addMeasure | public void addMeasure(Key key, int value) {
"""
Adds a measure. If the key is <code>null</code>, the measure is simply
ignored without any warning.
@param key the key of the measure to be added to hash map
@param value the value of the measure to be added to hash map
"""
if (key != null) {
... | java | public void addMeasure(Key key, int value) {
if (key != null) {
measures.put(key, value);
} else {
// TODO for now, we just ignore the value
}
} | [
"public",
"void",
"addMeasure",
"(",
"Key",
"key",
",",
"int",
"value",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"measures",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
"else",
"{",
"// TODO for now, we just ignore the value",
"}",
... | Adds a measure. If the key is <code>null</code>, the measure is simply
ignored without any warning.
@param key the key of the measure to be added to hash map
@param value the value of the measure to be added to hash map | [
"Adds",
"a",
"measure",
".",
"If",
"the",
"key",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"the",
"measure",
"is",
"simply",
"ignored",
"without",
"any",
"warning",
"."
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/bounceproxy-controller-service/src/main/java/io/joynr/messaging/info/PerformanceMeasures.java#L133-L140 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.incidents_GET | public ArrayList<Long> incidents_GET(Date creationDate, Date endDate) throws IOException {
"""
List of incidents
REST: GET /xdsl/incidents
@param creationDate [required] Filter the value of creationDate property (>)
@param endDate [required] Filter the value of endDate property (<)
"""
String qPath = "/... | java | public ArrayList<Long> incidents_GET(Date creationDate, Date endDate) throws IOException {
String qPath = "/xdsl/incidents";
StringBuilder sb = path(qPath);
query(sb, "creationDate", creationDate);
query(sb, "endDate", endDate);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, ... | [
"public",
"ArrayList",
"<",
"Long",
">",
"incidents_GET",
"(",
"Date",
"creationDate",
",",
"Date",
"endDate",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/incidents\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
... | List of incidents
REST: GET /xdsl/incidents
@param creationDate [required] Filter the value of creationDate property (>)
@param endDate [required] Filter the value of endDate property (<) | [
"List",
"of",
"incidents"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1977-L1984 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.registerChaincodeEventListener | public String registerChaincodeEventListener(Pattern chaincodeId, Pattern eventName, ChaincodeEventListener chaincodeEventListener) throws InvalidArgumentException {
"""
Register a chaincode event listener. Both chaincodeId pattern AND eventName pattern must match to invoke
the chaincodeEventListener
@param ch... | java | public String registerChaincodeEventListener(Pattern chaincodeId, Pattern eventName, ChaincodeEventListener chaincodeEventListener) throws InvalidArgumentException {
if (shutdown) {
throw new InvalidArgumentException(format("Channel %s has been shutdown.", name));
}
if (chaincodeId... | [
"public",
"String",
"registerChaincodeEventListener",
"(",
"Pattern",
"chaincodeId",
",",
"Pattern",
"eventName",
",",
"ChaincodeEventListener",
"chaincodeEventListener",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"shutdown",
")",
"{",
"throw",
"new",
"I... | Register a chaincode event listener. Both chaincodeId pattern AND eventName pattern must match to invoke
the chaincodeEventListener
@param chaincodeId Java pattern for chaincode identifier also know as chaincode name. If ma
@param eventName Java pattern to match the event name.
@param chaincode... | [
"Register",
"a",
"chaincode",
"event",
"listener",
".",
"Both",
"chaincodeId",
"pattern",
"AND",
"eventName",
"pattern",
"must",
"match",
"to",
"invoke",
"the",
"chaincodeEventListener"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L5897-L5923 |
alkacon/opencms-core | src/org/opencms/ui/components/fileselect/CmsResourceTreeContainer.java | CmsResourceTreeContainer.readTreeLevel | public void readTreeLevel(CmsObject cms, CmsUUID parentId) {
"""
Reads the given tree level.<p>
@param cms the CMS context
@param parentId the parent id
"""
try {
CmsResource parent = cms.readResource(parentId, m_filter);
List<CmsResource> children = cms.readResources(parent,... | java | public void readTreeLevel(CmsObject cms, CmsUUID parentId) {
try {
CmsResource parent = cms.readResource(parentId, m_filter);
List<CmsResource> children = cms.readResources(parent, m_filter, false);
// sets the parent to leaf mode, in case no child folders are present
... | [
"public",
"void",
"readTreeLevel",
"(",
"CmsObject",
"cms",
",",
"CmsUUID",
"parentId",
")",
"{",
"try",
"{",
"CmsResource",
"parent",
"=",
"cms",
".",
"readResource",
"(",
"parentId",
",",
"m_filter",
")",
";",
"List",
"<",
"CmsResource",
">",
"children",
... | Reads the given tree level.<p>
@param cms the CMS context
@param parentId the parent id | [
"Reads",
"the",
"given",
"tree",
"level",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/fileselect/CmsResourceTreeContainer.java#L157-L175 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/BaseDataAdaptiveTableLayoutAdapter.java | BaseDataAdaptiveTableLayoutAdapter.switchTwoRowHeaders | void switchTwoRowHeaders(int rowIndex, int rowToIndex) {
"""
Switch 2 rows headers with data
@param rowIndex row header from
@param rowToIndex row header to
"""
Object cellData = getRowHeaders()[rowToIndex];
getRowHeaders()[rowToIndex] = getRowHeaders()[rowIndex];
getRowHeaders()[... | java | void switchTwoRowHeaders(int rowIndex, int rowToIndex) {
Object cellData = getRowHeaders()[rowToIndex];
getRowHeaders()[rowToIndex] = getRowHeaders()[rowIndex];
getRowHeaders()[rowIndex] = cellData;
} | [
"void",
"switchTwoRowHeaders",
"(",
"int",
"rowIndex",
",",
"int",
"rowToIndex",
")",
"{",
"Object",
"cellData",
"=",
"getRowHeaders",
"(",
")",
"[",
"rowToIndex",
"]",
";",
"getRowHeaders",
"(",
")",
"[",
"rowToIndex",
"]",
"=",
"getRowHeaders",
"(",
")",
... | Switch 2 rows headers with data
@param rowIndex row header from
@param rowToIndex row header to | [
"Switch",
"2",
"rows",
"headers",
"with",
"data"
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/BaseDataAdaptiveTableLayoutAdapter.java#L85-L89 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java | ObjectEnvelopeOrdering.buildPotentialMNEdge | protected Edge buildPotentialMNEdge(Vertex vertex1, Vertex vertex2) {
"""
Checks if the database operations associated with two object envelopes
that might have been related via an m:n collection reference before
the current transaction needs to be performed
in a particular order and if so builds and returns a ... | java | protected Edge buildPotentialMNEdge(Vertex vertex1, Vertex vertex2)
{
ModificationState state1 = vertex1.getEnvelope().getModificationState();
ModificationState state2 = vertex2.getEnvelope().getModificationState();
if (state1.needsUpdate() || state1.needsDelete())
{
... | [
"protected",
"Edge",
"buildPotentialMNEdge",
"(",
"Vertex",
"vertex1",
",",
"Vertex",
"vertex2",
")",
"{",
"ModificationState",
"state1",
"=",
"vertex1",
".",
"getEnvelope",
"(",
")",
".",
"getModificationState",
"(",
")",
";",
"ModificationState",
"state2",
"=",
... | Checks if the database operations associated with two object envelopes
that might have been related via an m:n collection reference before
the current transaction needs to be performed
in a particular order and if so builds and returns a corresponding
directed edge weighted with <code>POTENTIAL_EDGE_WEIGHT</code>.
The ... | [
"Checks",
"if",
"the",
"database",
"operations",
"associated",
"with",
"two",
"object",
"envelopes",
"that",
"might",
"have",
"been",
"related",
"via",
"an",
"m",
":",
"n",
"collection",
"reference",
"before",
"the",
"current",
"transaction",
"needs",
"to",
"b... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java#L653-L666 |
omadahealth/TypefaceView | lib/src/main/java/com/github/omadahealth/typefaceview/TypefaceTextView.java | TypefaceTextView.setCustomTypeface | @BindingAdapter("bind:tv_typeface")
public static void setCustomTypeface(TypefaceTextView textView, String type) {
"""
Data-binding method for custom attribute bind:tv_typeface to be set
@param textView The instance of the object to set value on
@param type The string name of the typeface, same as in xml
... | java | @BindingAdapter("bind:tv_typeface")
public static void setCustomTypeface(TypefaceTextView textView, String type) {
textView.mCurrentTypeface = TypefaceType.getTypeface(type != null ? type : "");
Typeface typeface = getFont(textView.getContext(), textView.mCurrentTypeface.getAssetFileName());
... | [
"@",
"BindingAdapter",
"(",
"\"bind:tv_typeface\"",
")",
"public",
"static",
"void",
"setCustomTypeface",
"(",
"TypefaceTextView",
"textView",
",",
"String",
"type",
")",
"{",
"textView",
".",
"mCurrentTypeface",
"=",
"TypefaceType",
".",
"getTypeface",
"(",
"type",... | Data-binding method for custom attribute bind:tv_typeface to be set
@param textView The instance of the object to set value on
@param type The string name of the typeface, same as in xml | [
"Data",
"-",
"binding",
"method",
"for",
"custom",
"attribute",
"bind",
":",
"tv_typeface",
"to",
"be",
"set"
] | train | https://github.com/omadahealth/TypefaceView/blob/9a36a67b0fb26584c3e20a24f8f0bafad6a0badd/lib/src/main/java/com/github/omadahealth/typefaceview/TypefaceTextView.java#L79-L84 |
google/closure-compiler | src/com/google/javascript/jscomp/ProcessClosurePrimitives.java | ProcessClosurePrimitives.processForwardDeclare | private void processForwardDeclare(Node n, Node parent) {
"""
Process a goog.forwardDeclare() call and record the specified forward declaration.
"""
CodingConvention convention = compiler.getCodingConvention();
String typeDeclaration = null;
try {
typeDeclaration = Iterables.getOnlyElement(
... | java | private void processForwardDeclare(Node n, Node parent) {
CodingConvention convention = compiler.getCodingConvention();
String typeDeclaration = null;
try {
typeDeclaration = Iterables.getOnlyElement(
convention.identifyTypeDeclarationCall(n));
} catch (NullPointerException | NoSuchElem... | [
"private",
"void",
"processForwardDeclare",
"(",
"Node",
"n",
",",
"Node",
"parent",
")",
"{",
"CodingConvention",
"convention",
"=",
"compiler",
".",
"getCodingConvention",
"(",
")",
";",
"String",
"typeDeclaration",
"=",
"null",
";",
"try",
"{",
"typeDeclarati... | Process a goog.forwardDeclare() call and record the specified forward declaration. | [
"Process",
"a",
"goog",
".",
"forwardDeclare",
"()",
"call",
"and",
"record",
"the",
"specified",
"forward",
"declaration",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java#L927-L948 |
JetBrains/xodus | vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java | VirtualFileSystem.createFile | @NotNull
public File createFile(@NotNull final Transaction txn, final long fileDescriptor, @NotNull final String path) {
"""
Creates new file inside specified {@linkplain Transaction} with specified file descriptor and path and returns
the {@linkplain File} instance.
@param txn {@linkplain Trans... | java | @NotNull
public File createFile(@NotNull final Transaction txn, final long fileDescriptor, @NotNull final String path) {
while (true) {
long current = fileDescriptorSequence.get();
long next = Math.max(fileDescriptor + 1, current);
if (fileDescriptorSequence.compareAndSet... | [
"@",
"NotNull",
"public",
"File",
"createFile",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"final",
"long",
"fileDescriptor",
",",
"@",
"NotNull",
"final",
"String",
"path",
")",
"{",
"while",
"(",
"true",
")",
"{",
"long",
"current",
"=",
... | Creates new file inside specified {@linkplain Transaction} with specified file descriptor and path and returns
the {@linkplain File} instance.
@param txn {@linkplain Transaction} instance
@param fileDescriptor file descriptor
@param path file path
@return new {@linkplain File}
@throws FileExistsEx... | [
"Creates",
"new",
"file",
"inside",
"specified",
"{",
"@linkplain",
"Transaction",
"}",
"with",
"specified",
"file",
"descriptor",
"and",
"path",
"and",
"returns",
"the",
"{",
"@linkplain",
"File",
"}",
"instance",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java#L225-L234 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.reverseForEach | @Deprecated
public static void reverseForEach(String string, CharProcedure procedure) {
"""
For each char in the {@code string} in reverse order, execute the {@link CharProcedure}.
@deprecated since 7.0. Use {@link #reverseForEachChar(String, CharProcedure)} instead.
"""
StringIterate.reverseFor... | java | @Deprecated
public static void reverseForEach(String string, CharProcedure procedure)
{
StringIterate.reverseForEachChar(string, procedure);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"reverseForEach",
"(",
"String",
"string",
",",
"CharProcedure",
"procedure",
")",
"{",
"StringIterate",
".",
"reverseForEachChar",
"(",
"string",
",",
"procedure",
")",
";",
"}"
] | For each char in the {@code string} in reverse order, execute the {@link CharProcedure}.
@deprecated since 7.0. Use {@link #reverseForEachChar(String, CharProcedure)} instead. | [
"For",
"each",
"char",
"in",
"the",
"{",
"@code",
"string",
"}",
"in",
"reverse",
"order",
"execute",
"the",
"{",
"@link",
"CharProcedure",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L401-L405 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.inducedHomography13 | public static DMatrixRMaj inducedHomography13( TrifocalTensor tensor ,
Vector3D_F64 line2 ,
DMatrixRMaj output ) {
"""
Computes the homography induced from view 1 to 3 by a line in view 2. The provided line in
view 2 must contain the view 2 observation.
p3 = H13*p1
@param tens... | java | public static DMatrixRMaj inducedHomography13( TrifocalTensor tensor ,
Vector3D_F64 line2 ,
DMatrixRMaj output ) {
if( output == null )
output = new DMatrixRMaj(3,3);
DMatrixRMaj T = tensor.T1;
// H(:,0) = transpose(T1)*line
output.data[0] = T.data[0]*line2.x + T.data[3]*line2... | [
"public",
"static",
"DMatrixRMaj",
"inducedHomography13",
"(",
"TrifocalTensor",
"tensor",
",",
"Vector3D_F64",
"line2",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"3",
... | Computes the homography induced from view 1 to 3 by a line in view 2. The provided line in
view 2 must contain the view 2 observation.
p3 = H13*p1
@param tensor Input: Trifocal tensor
@param line2 Input: Line in view 2. {@link LineGeneral2D_F64 General notation}.
@param output Output: Optional storage for homograph... | [
"Computes",
"the",
"homography",
"induced",
"from",
"view",
"1",
"to",
"3",
"by",
"a",
"line",
"in",
"view",
"2",
".",
"The",
"provided",
"line",
"in",
"view",
"2",
"must",
"contain",
"the",
"view",
"2",
"observation",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L438-L473 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/VRPResourceManager.java | VRPResourceManager.getChildRPforHub | public ResourcePool getChildRPforHub(String vrpId, ManagedEntity hub) throws InvalidState, NotFound, RuntimeFault, RemoteException {
"""
Given the VRP Id and a hub, gets the associated child resource pool.
@param vrpId ID of the VRP.
@param hub ManagedEntity representing the hub.
@return A ResourcePool
@th... | java | public ResourcePool getChildRPforHub(String vrpId, ManagedEntity hub) throws InvalidState, NotFound, RuntimeFault, RemoteException {
ManagedObjectReference rpMor = getVimService().getChildRPforHub(getMOR(), vrpId, hub.getMOR());
return new ResourcePool(getServerConnection(), rpMor);
} | [
"public",
"ResourcePool",
"getChildRPforHub",
"(",
"String",
"vrpId",
",",
"ManagedEntity",
"hub",
")",
"throws",
"InvalidState",
",",
"NotFound",
",",
"RuntimeFault",
",",
"RemoteException",
"{",
"ManagedObjectReference",
"rpMor",
"=",
"getVimService",
"(",
")",
".... | Given the VRP Id and a hub, gets the associated child resource pool.
@param vrpId ID of the VRP.
@param hub ManagedEntity representing the hub.
@return A ResourcePool
@throws InvalidState
@throws NotFound
@throws RuntimeFault
@throws RemoteException | [
"Given",
"the",
"VRP",
"Id",
"and",
"a",
"hub",
"gets",
"the",
"associated",
"child",
"resource",
"pool",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/VRPResourceManager.java#L106-L109 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_receivers_slotId_GET | public OvhReceiver serviceName_receivers_slotId_GET(String serviceName, Long slotId) throws IOException {
"""
Get this object properties
REST: GET /sms/{serviceName}/receivers/{slotId}
@param serviceName [required] The internal name of your SMS offer
@param slotId [required] Slot number id
"""
String qP... | java | public OvhReceiver serviceName_receivers_slotId_GET(String serviceName, Long slotId) throws IOException {
String qPath = "/sms/{serviceName}/receivers/{slotId}";
StringBuilder sb = path(qPath, serviceName, slotId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhReceiver.class);... | [
"public",
"OvhReceiver",
"serviceName_receivers_slotId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"slotId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/{serviceName}/receivers/{slotId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath... | Get this object properties
REST: GET /sms/{serviceName}/receivers/{slotId}
@param serviceName [required] The internal name of your SMS offer
@param slotId [required] Slot number id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L545-L550 |
alkacon/opencms-core | src/org/opencms/gwt/CmsVfsService.java | CmsVfsService.getPageInfoWithLock | public static CmsListInfoBean getPageInfoWithLock(CmsObject cms, CmsResource resource)
throws CmsLoaderException, CmsException {
"""
Returns a bean to display the {@link org.opencms.gwt.client.ui.CmsListItemWidget} including the lock state.<p>
@param cms the CMS context
@param resource the resource to get ... | java | public static CmsListInfoBean getPageInfoWithLock(CmsObject cms, CmsResource resource)
throws CmsLoaderException, CmsException {
CmsListInfoBean result = getPageInfo(cms, resource);
addLockInfo(cms, resource, result);
return result;
} | [
"public",
"static",
"CmsListInfoBean",
"getPageInfoWithLock",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsLoaderException",
",",
"CmsException",
"{",
"CmsListInfoBean",
"result",
"=",
"getPageInfo",
"(",
"cms",
",",
"resource",
")",
"... | Returns a bean to display the {@link org.opencms.gwt.client.ui.CmsListItemWidget} including the lock state.<p>
@param cms the CMS context
@param resource the resource to get the page info for
@return a bean to display the {@link org.opencms.gwt.client.ui.CmsListItemWidget}.<p>
@throws CmsLoaderException if the resou... | [
"Returns",
"a",
"bean",
"to",
"display",
"the",
"{",
"@link",
"org",
".",
"opencms",
".",
"gwt",
".",
"client",
".",
"ui",
".",
"CmsListItemWidget",
"}",
"including",
"the",
"lock",
"state",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsVfsService.java#L285-L291 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java | Configurations.getDouble | public static double getDouble(String name, double defaultVal) {
"""
Get the property object as double, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as double, return defaultVal if property is undefined.
"""... | java | public static double getDouble(String name, double defaultVal){
if(getConfiguration().containsKey(name)){
return getConfiguration().getDouble(name);
} else {
return defaultVal;
}
} | [
"public",
"static",
"double",
"getDouble",
"(",
"String",
"name",
",",
"double",
"defaultVal",
")",
"{",
"if",
"(",
"getConfiguration",
"(",
")",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"getConfiguration",
"(",
")",
".",
"getDouble",
"(",... | Get the property object as double, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as double, return defaultVal if property is undefined. | [
"Get",
"the",
"property",
"object",
"as",
"double",
"or",
"return",
"defaultVal",
"if",
"property",
"is",
"not",
"defined",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java#L170-L176 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/JavacState.java | JavacState.setVisibleSources | public void setVisibleSources(Map<String,Source> vs) {
"""
Specify which sources are visible to the compiler through -sourcepath.
"""
visibleSrcs = new HashSet<URI>();
for (String s : vs.keySet()) {
Source src = vs.get(s);
visibleSrcs.add(src.file().toURI());
}
... | java | public void setVisibleSources(Map<String,Source> vs) {
visibleSrcs = new HashSet<URI>();
for (String s : vs.keySet()) {
Source src = vs.get(s);
visibleSrcs.add(src.file().toURI());
}
} | [
"public",
"void",
"setVisibleSources",
"(",
"Map",
"<",
"String",
",",
"Source",
">",
"vs",
")",
"{",
"visibleSrcs",
"=",
"new",
"HashSet",
"<",
"URI",
">",
"(",
")",
";",
"for",
"(",
"String",
"s",
":",
"vs",
".",
"keySet",
"(",
")",
")",
"{",
"... | Specify which sources are visible to the compiler through -sourcepath. | [
"Specify",
"which",
"sources",
"are",
"visible",
"to",
"the",
"compiler",
"through",
"-",
"sourcepath",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/JavacState.java#L199-L205 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderItemPersistenceImpl.java | CommerceOrderItemPersistenceImpl.findByCPInstanceId | @Override
public List<CommerceOrderItem> findByCPInstanceId(long CPInstanceId,
int start, int end) {
"""
Returns a range of all the commerce order items where CPInstanceId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</... | java | @Override
public List<CommerceOrderItem> findByCPInstanceId(long CPInstanceId,
int start, int end) {
return findByCPInstanceId(CPInstanceId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrderItem",
">",
"findByCPInstanceId",
"(",
"long",
"CPInstanceId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPInstanceId",
"(",
"CPInstanceId",
",",
"start",
",",
"end",
",",
"null",
... | Returns a range of all the commerce order items where CPInstanceId = ?.
<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 t... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"order",
"items",
"where",
"CPInstanceId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderItemPersistenceImpl.java#L1173-L1177 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/AtomDODeserializer.java | AtomDODeserializer.addObjectProperties | private void addObjectProperties(Feed feed, DigitalObject obj)
throws ObjectIntegrityException {
"""
Set the Fedora Object properties from the Feed metadata.
@throws ObjectIntegrityException
"""
PID pid;
try {
pid = new PID(feed.getId().toString());
} catch (M... | java | private void addObjectProperties(Feed feed, DigitalObject obj)
throws ObjectIntegrityException {
PID pid;
try {
pid = new PID(feed.getId().toString());
} catch (MalformedPIDException e) {
throw new ObjectIntegrityException(e.getMessage(), e);
}
... | [
"private",
"void",
"addObjectProperties",
"(",
"Feed",
"feed",
",",
"DigitalObject",
"obj",
")",
"throws",
"ObjectIntegrityException",
"{",
"PID",
"pid",
";",
"try",
"{",
"pid",
"=",
"new",
"PID",
"(",
"feed",
".",
"getId",
"(",
")",
".",
"toString",
"(",
... | Set the Fedora Object properties from the Feed metadata.
@throws ObjectIntegrityException | [
"Set",
"the",
"Fedora",
"Object",
"properties",
"from",
"the",
"Feed",
"metadata",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/AtomDODeserializer.java#L160-L191 |
lucee/Lucee | core/src/main/java/lucee/runtime/net/ntp/NtpMessage.java | NtpMessage.decodeTimestamp | public static double decodeTimestamp(byte[] array, int pointer) {
"""
Will read 8 bytes of a message beginning at <code>pointer</code> and return it as a double,
according to the NTP 64-bit timestamp format.
@param array
@param pointer
@return
"""
double r = 0.0;
for (int i = 0; i < 8; i++) {
r +... | java | public static double decodeTimestamp(byte[] array, int pointer) {
double r = 0.0;
for (int i = 0; i < 8; i++) {
r += unsignedByteToShort(array[pointer + i]) * Math.pow(2, (3 - i) * 8);
}
return r;
} | [
"public",
"static",
"double",
"decodeTimestamp",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"pointer",
")",
"{",
"double",
"r",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"8",
";",
"i",
"++",
")",
"{",
"r",
"+=",
"unsign... | Will read 8 bytes of a message beginning at <code>pointer</code> and return it as a double,
according to the NTP 64-bit timestamp format.
@param array
@param pointer
@return | [
"Will",
"read",
"8",
"bytes",
"of",
"a",
"message",
"beginning",
"at",
"<code",
">",
"pointer<",
"/",
"code",
">",
"and",
"return",
"it",
"as",
"a",
"double",
"according",
"to",
"the",
"NTP",
"64",
"-",
"bit",
"timestamp",
"format",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/ntp/NtpMessage.java#L289-L297 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java | BatchFraction.defaultThreadPool | public BatchFraction defaultThreadPool(final int maxThreads, final int keepAliveTime, final TimeUnit keepAliveUnits) {
"""
Creates a new thread-pool using the {@linkplain #DEFAULT_THREAD_POOL_NAME default name}. The thread-pool is then set as
the default thread-pool for bath jobs.
@param maxThreads the max... | java | public BatchFraction defaultThreadPool(final int maxThreads, final int keepAliveTime, final TimeUnit keepAliveUnits) {
return defaultThreadPool(DEFAULT_THREAD_POOL_NAME, maxThreads, keepAliveTime, keepAliveUnits);
} | [
"public",
"BatchFraction",
"defaultThreadPool",
"(",
"final",
"int",
"maxThreads",
",",
"final",
"int",
"keepAliveTime",
",",
"final",
"TimeUnit",
"keepAliveUnits",
")",
"{",
"return",
"defaultThreadPool",
"(",
"DEFAULT_THREAD_POOL_NAME",
",",
"maxThreads",
",",
"keep... | Creates a new thread-pool using the {@linkplain #DEFAULT_THREAD_POOL_NAME default name}. The thread-pool is then set as
the default thread-pool for bath jobs.
@param maxThreads the maximum number of threads to set the pool to
@param keepAliveTime the time to keep threads alive
@param keepAliveUnits the time unit ... | [
"Creates",
"a",
"new",
"thread",
"-",
"pool",
"using",
"the",
"{",
"@linkplain",
"#DEFAULT_THREAD_POOL_NAME",
"default",
"name",
"}",
".",
"The",
"thread",
"-",
"pool",
"is",
"then",
"set",
"as",
"the",
"default",
"thread",
"-",
"pool",
"for",
"bath",
"job... | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java#L143-L145 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/state/RaftState.java | RaftState.restoreGroupMembers | public void restoreGroupMembers(long logIndex, Collection<Endpoint> members) {
"""
Restores group members from the snapshot. Both {@link #committedGroupMembers}
and {@link #lastGroupMembers} are overwritten and they become the same.
"""
assert lastGroupMembers.index() <= logIndex
: "Ca... | java | public void restoreGroupMembers(long logIndex, Collection<Endpoint> members) {
assert lastGroupMembers.index() <= logIndex
: "Cannot restore group members to: " + members + " at log index: " + logIndex + " because last group members: "
+ lastGroupMembers + " has a bigger log inde... | [
"public",
"void",
"restoreGroupMembers",
"(",
"long",
"logIndex",
",",
"Collection",
"<",
"Endpoint",
">",
"members",
")",
"{",
"assert",
"lastGroupMembers",
".",
"index",
"(",
")",
"<=",
"logIndex",
":",
"\"Cannot restore group members to: \"",
"+",
"members",
"+... | Restores group members from the snapshot. Both {@link #committedGroupMembers}
and {@link #lastGroupMembers} are overwritten and they become the same. | [
"Restores",
"group",
"members",
"from",
"the",
"snapshot",
".",
"Both",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/state/RaftState.java#L437-L447 |
baratine/baratine | framework/src/main/java/com/caucho/v5/json/ser/JavaSerializerJson.java | JavaSerializerJson.writeFields | private void writeFields(JsonWriterImpl out, Object value) {
"""
/*
@Override
public void write(JsonWriter out,
String name,
Object value)
{
out.writeStartObject(name);
writeFields(out, value);
out.writeEnd();
}
"""
for (JsonField field : _fields) {
field.write(out, value);
}
} | java | private void writeFields(JsonWriterImpl out, Object value)
{
for (JsonField field : _fields) {
field.write(out, value);
}
} | [
"private",
"void",
"writeFields",
"(",
"JsonWriterImpl",
"out",
",",
"Object",
"value",
")",
"{",
"for",
"(",
"JsonField",
"field",
":",
"_fields",
")",
"{",
"field",
".",
"write",
"(",
"out",
",",
"value",
")",
";",
"}",
"}"
] | /*
@Override
public void write(JsonWriter out,
String name,
Object value)
{
out.writeStartObject(name);
writeFields(out, value);
out.writeEnd();
} | [
"/",
"*",
"@Override",
"public",
"void",
"write",
"(",
"JsonWriter",
"out",
"String",
"name",
"Object",
"value",
")",
"{",
"out",
".",
"writeStartObject",
"(",
"name",
")",
";"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/json/ser/JavaSerializerJson.java#L210-L215 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSubAnnotationPropertyOfAxiomImpl_CustomFieldSerializer.java | OWLSubAnnotationPropertyOfAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLSubAnnotationPropertyOfAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@lin... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLSubAnnotationPropertyOfAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLSubAnnotationPropertyOfAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSubAnnotationPropertyOfAxiomImpl_CustomFieldSerializer.java#L97-L100 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.isRegularQueue | public static boolean isRegularQueue(final Jedis jedis, final String key) {
"""
Determines if the queue identified by the given key is a regular queue.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key identifies a regular queue, false otherwise
"""
... | java | public static boolean isRegularQueue(final Jedis jedis, final String key) {
return LIST.equalsIgnoreCase(jedis.type(key));
} | [
"public",
"static",
"boolean",
"isRegularQueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"key",
")",
"{",
"return",
"LIST",
".",
"equalsIgnoreCase",
"(",
"jedis",
".",
"type",
"(",
"key",
")",
")",
";",
"}"
] | Determines if the queue identified by the given key is a regular queue.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key identifies a regular queue, false otherwise | [
"Determines",
"if",
"the",
"queue",
"identified",
"by",
"the",
"given",
"key",
"is",
"a",
"regular",
"queue",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L119-L121 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/InetUtilities.java | InetUtilities.getURLData | public static byte[] getURLData(final String url) {
"""
Downloads a file as a byte array
@param url The URL of the resource to download
@return The byte array containing the data of the downloaded file
"""
final int readBytes = 1000;
URL u;
InputStream is = null;
final Byte... | java | public static byte[] getURLData(final String url) {
final int readBytes = 1000;
URL u;
InputStream is = null;
final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
// See http://www.exampledepot.com/egs/javax.net.ssl/TrustAll.html
// Create a trust manager ... | [
"public",
"static",
"byte",
"[",
"]",
"getURLData",
"(",
"final",
"String",
"url",
")",
"{",
"final",
"int",
"readBytes",
"=",
"1000",
";",
"URL",
"u",
";",
"InputStream",
"is",
"=",
"null",
";",
"final",
"ByteArrayOutputStream",
"buffer",
"=",
"new",
"B... | Downloads a file as a byte array
@param url The URL of the resource to download
@return The byte array containing the data of the downloaded file | [
"Downloads",
"a",
"file",
"as",
"a",
"byte",
"array"
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/InetUtilities.java#L42-L97 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.