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 |
|---|---|---|---|---|---|---|---|---|---|---|
xebialabs/overcast | src/main/java/com/xebialabs/overcast/support/libvirt/Metadata.java | Metadata.fromXml | public static Metadata fromXml(Document domainXml) {
"""
Extract {@link Metadata} from the domain XML. Throws {@link IllegalArgumentException} if the metadata is
malformed.
@return the metadata or <code>null</code> if there's no metadata
"""
try {
SimpleDateFormat sdf = new SimpleDateFo... | java | public static Metadata fromXml(Document domainXml) {
try {
SimpleDateFormat sdf = new SimpleDateFormat(XML_DATE_FORMAT);
Element metadata = getMetadataElement(domainXml);
if (metadata == null) {
return null;
}
Namespace ns = Namespace.g... | [
"public",
"static",
"Metadata",
"fromXml",
"(",
"Document",
"domainXml",
")",
"{",
"try",
"{",
"SimpleDateFormat",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"XML_DATE_FORMAT",
")",
";",
"Element",
"metadata",
"=",
"getMetadataElement",
"(",
"domainXml",
")",
"... | Extract {@link Metadata} from the domain XML. Throws {@link IllegalArgumentException} if the metadata is
malformed.
@return the metadata or <code>null</code> if there's no metadata | [
"Extract",
"{",
"@link",
"Metadata",
"}",
"from",
"the",
"domain",
"XML",
".",
"Throws",
"{",
"@link",
"IllegalArgumentException",
"}",
"if",
"the",
"metadata",
"is",
"malformed",
"."
] | train | https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/libvirt/Metadata.java#L116-L142 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.makeSatisfied | private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples, Tuple satisfyingTuple) {
"""
Starting with the given tuple, completes bindings to satisfy all current test case conditions,
using additional selections from the given set of tuples if necessary.
Returns true if and only if all conditions sa... | java | private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples, Tuple satisfyingTuple)
{
return
// Compatible tuple found?
testCase.addCompatible( satisfyingTuple) != null
// Did this tuple create an infeasible combination?
&& !testCase.isInfeasible()
// Can also we sati... | [
"private",
"boolean",
"makeSatisfied",
"(",
"TestCaseDef",
"testCase",
",",
"VarTupleSet",
"tuples",
",",
"Tuple",
"satisfyingTuple",
")",
"{",
"return",
"// Compatible tuple found?",
"testCase",
".",
"addCompatible",
"(",
"satisfyingTuple",
")",
"!=",
"null",
"// Did... | Starting with the given tuple, completes bindings to satisfy all current test case conditions,
using additional selections from the given set of tuples if necessary.
Returns true if and only if all conditions satisfied. | [
"Starting",
"with",
"the",
"given",
"tuple",
"completes",
"bindings",
"to",
"satisfy",
"all",
"current",
"test",
"case",
"conditions",
"using",
"additional",
"selections",
"from",
"the",
"given",
"set",
"of",
"tuples",
"if",
"necessary",
".",
"Returns",
"true",
... | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L508-L519 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/workers/rest/AbstractRestCommandJob2.java | AbstractRestCommandJob2.createHttpPostEntity | private HttpPost createHttpPostEntity(ReviewInput reviewInput, String reviewEndpoint) {
"""
Construct the post.
@param reviewInput input
@param reviewEndpoint end point
@return the entity
"""
HttpPost httpPost = new HttpPost(reviewEndpoint);
String asJson = GSON.toJson(reviewInput);
... | java | private HttpPost createHttpPostEntity(ReviewInput reviewInput, String reviewEndpoint) {
HttpPost httpPost = new HttpPost(reviewEndpoint);
String asJson = GSON.toJson(reviewInput);
StringEntity entity = null;
try {
entity = new StringEntity(asJson);
} catch (Unsuppor... | [
"private",
"HttpPost",
"createHttpPostEntity",
"(",
"ReviewInput",
"reviewInput",
",",
"String",
"reviewEndpoint",
")",
"{",
"HttpPost",
"httpPost",
"=",
"new",
"HttpPost",
"(",
"reviewEndpoint",
")",
";",
"String",
"asJson",
"=",
"GSON",
".",
"toJson",
"(",
"re... | Construct the post.
@param reviewInput input
@param reviewEndpoint end point
@return the entity | [
"Construct",
"the",
"post",
"."
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/workers/rest/AbstractRestCommandJob2.java#L176-L194 |
reactor/reactor-netty | src/main/java/reactor/netty/channel/BootstrapHandlers.java | BootstrapHandlers.channelOperationFactory | @SuppressWarnings("unchecked")
public static ChannelOperations.OnSetup channelOperationFactory(AbstractBootstrap<?, ?> b) {
"""
Obtain and remove the current {@link ChannelOperations.OnSetup} from the bootstrap.
@param b the bootstrap to scan
@return current {@link ChannelOperations.OnSetup} factory or null... | java | @SuppressWarnings("unchecked")
public static ChannelOperations.OnSetup channelOperationFactory(AbstractBootstrap<?, ?> b) {
Objects.requireNonNull(b, "bootstrap");
ChannelOperations.OnSetup ops =
(ChannelOperations.OnSetup) b.config()
.options()
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"ChannelOperations",
".",
"OnSetup",
"channelOperationFactory",
"(",
"AbstractBootstrap",
"<",
"?",
",",
"?",
">",
"b",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"b",
",",
"\"bootstra... | Obtain and remove the current {@link ChannelOperations.OnSetup} from the bootstrap.
@param b the bootstrap to scan
@return current {@link ChannelOperations.OnSetup} factory or null | [
"Obtain",
"and",
"remove",
"the",
"current",
"{",
"@link",
"ChannelOperations",
".",
"OnSetup",
"}",
"from",
"the",
"bootstrap",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/channel/BootstrapHandlers.java#L212-L224 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/support/i18n/message/MessageSourceSupport.java | MessageSourceSupport.createMessageFormat | protected MessageFormat createMessageFormat(String msg, Locale locale) {
"""
Create a MessageFormat for the given message and Locale.
@param msg the message to create a MessageFormat for
@param locale the Locale to create a MessageFormat for
@return the MessageFormat instance
"""
return new Messag... | java | protected MessageFormat createMessageFormat(String msg, Locale locale) {
return new MessageFormat((msg != null ? msg : ""), locale);
} | [
"protected",
"MessageFormat",
"createMessageFormat",
"(",
"String",
"msg",
",",
"Locale",
"locale",
")",
"{",
"return",
"new",
"MessageFormat",
"(",
"(",
"msg",
"!=",
"null",
"?",
"msg",
":",
"\"\"",
")",
",",
"locale",
")",
";",
"}"
] | Create a MessageFormat for the given message and Locale.
@param msg the message to create a MessageFormat for
@param locale the Locale to create a MessageFormat for
@return the MessageFormat instance | [
"Create",
"a",
"MessageFormat",
"for",
"the",
"given",
"message",
"and",
"Locale",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/support/i18n/message/MessageSourceSupport.java#L155-L157 |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/settings/NumericalValueRange.java | NumericalValueRange.parseNumericalValueRange | public static final NumericalValueRange parseNumericalValueRange (final String value) {
"""
Parses a {@link NumericalValueRange} from a {@link String}. The lower and boundaries must be separated by a '~'
character and the the leading integer must not be larger than the trailing one. If these format requirements a... | java | public static final NumericalValueRange parseNumericalValueRange (final String value) {
// check formatting
final Matcher rangeMatcher = NUMERICAL_RANGE_PATTERN.matcher(value);
if (!rangeMatcher.matches()) { return null; }
int min, max;
// split parameter at '~' sign and p... | [
"public",
"static",
"final",
"NumericalValueRange",
"parseNumericalValueRange",
"(",
"final",
"String",
"value",
")",
"{",
"// check formatting\r",
"final",
"Matcher",
"rangeMatcher",
"=",
"NUMERICAL_RANGE_PATTERN",
".",
"matcher",
"(",
"value",
")",
";",
"if",
"(",
... | Parses a {@link NumericalValueRange} from a {@link String}. The lower and boundaries must be separated by a '~'
character and the the leading integer must not be larger than the trailing one. If these format requirements are
violated the method will return <code>null</code>.
@param value the {@link String} to parse
@r... | [
"Parses",
"a",
"{",
"@link",
"NumericalValueRange",
"}",
"from",
"a",
"{",
"@link",
"String",
"}",
".",
"The",
"lower",
"and",
"boundaries",
"must",
"be",
"separated",
"by",
"a",
"~",
"character",
"and",
"the",
"the",
"leading",
"integer",
"must",
"not",
... | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/settings/NumericalValueRange.java#L48-L64 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/AbstractStrategy.java | AbstractStrategy.printRanking | protected void printRanking(final String user, final Map<Long, Double> scoredItems, final PrintStream out, final OUTPUT_FORMAT format) {
"""
Print the item ranking and scores for a specific user.
@param user The user (as a String).
@param scoredItems The item to print rankings for.
@param out Where to direct ... | java | protected void printRanking(final String user, final Map<Long, Double> scoredItems, final PrintStream out, final OUTPUT_FORMAT format) {
final Map<Double, Set<Long>> preferenceMap = new HashMap<Double, Set<Long>>();
for (Map.Entry<Long, Double> e : scoredItems.entrySet()) {
long item = e.get... | [
"protected",
"void",
"printRanking",
"(",
"final",
"String",
"user",
",",
"final",
"Map",
"<",
"Long",
",",
"Double",
">",
"scoredItems",
",",
"final",
"PrintStream",
"out",
",",
"final",
"OUTPUT_FORMAT",
"format",
")",
"{",
"final",
"Map",
"<",
"Double",
... | Print the item ranking and scores for a specific user.
@param user The user (as a String).
@param scoredItems The item to print rankings for.
@param out Where to direct the print.
@param format The format of the printer. | [
"Print",
"the",
"item",
"ranking",
"and",
"scores",
"for",
"a",
"specific",
"user",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/AbstractStrategy.java#L133-L167 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImagePreviewDialog.java | CmsImagePreviewDialog.getImageAttributes | public void getImageAttributes(Map<String, String> attributes, I_CmsSimpleCallback<Map<String, String>> callback) {
"""
Adds necessary attributes to the map.<p>
@param attributes the attribute map
@param callback the callback to execute
"""
if (getGalleryMode() == GalleryMode.editor) {
... | java | public void getImageAttributes(Map<String, String> attributes, I_CmsSimpleCallback<Map<String, String>> callback) {
if (getGalleryMode() == GalleryMode.editor) {
m_imageEditorFormatsTab.getImageAttributes(attributes);
m_imageAdvancedTab.getImageAttributes(attributes, callback);
... | [
"public",
"void",
"getImageAttributes",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
",",
"I_CmsSimpleCallback",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"callback",
")",
"{",
"if",
"(",
"getGalleryMode",
"(",
")",
"==",
"Gallery... | Adds necessary attributes to the map.<p>
@param attributes the attribute map
@param callback the callback to execute | [
"Adds",
"necessary",
"attributes",
"to",
"the",
"map",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImagePreviewDialog.java#L173-L181 |
CenturyLinkCloud/clc-java-sdk | sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/GroupService.java | GroupService.defineGroupHierarchy | public OperationFuture<Group> defineGroupHierarchy(DataCenter dataCenter, GroupHierarchyConfig config) {
"""
Create group hierarchy based on {@link GroupHierarchyConfig} instance
Existing groups are not override!
@param dataCenter datacenter in which will be created group hierarchy
@param config group hierarc... | java | public OperationFuture<Group> defineGroupHierarchy(DataCenter dataCenter, GroupHierarchyConfig config) {
checkNotNull(dataCenter, "DataCenter must be not null");
checkNotNull(config, "GroupHierarchyConfig must be not null");
String parentGroupId = dataCenterService.findByRef(dataCenter).getGrou... | [
"public",
"OperationFuture",
"<",
"Group",
">",
"defineGroupHierarchy",
"(",
"DataCenter",
"dataCenter",
",",
"GroupHierarchyConfig",
"config",
")",
"{",
"checkNotNull",
"(",
"dataCenter",
",",
"\"DataCenter must be not null\"",
")",
";",
"checkNotNull",
"(",
"config",
... | Create group hierarchy based on {@link GroupHierarchyConfig} instance
Existing groups are not override!
@param dataCenter datacenter in which will be created group hierarchy
@param config group hierarchy config
@return OperationFuture wrapper for parent Group | [
"Create",
"group",
"hierarchy",
"based",
"on",
"{",
"@link",
"GroupHierarchyConfig",
"}",
"instance",
"Existing",
"groups",
"are",
"not",
"override!"
] | train | https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/GroupService.java#L228-L243 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/IHEAuditor.java | IHEAuditor.auditActorStartEvent | public void auditActorStartEvent(RFC3881EventOutcomeCodes eventOutcome, String actorName, String actorStarter) {
"""
Sends a DICOM Application Activity / Application Start Event audit message
@param eventOutcome Event Outcome Indicator
@param actorName Application Participant User ID (Actor Name)
@param actor... | java | public void auditActorStartEvent(RFC3881EventOutcomeCodes eventOutcome, String actorName, String actorStarter)
{
if (!isAuditorEnabled()) {
return;
}
ApplicationStartEvent startEvent = new ApplicationStartEvent(eventOutcome);
startEvent.setAuditSourceId(getAuditSourceId(), getAuditEnterpriseSiteId());
sta... | [
"public",
"void",
"auditActorStartEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"actorName",
",",
"String",
"actorStarter",
")",
"{",
"if",
"(",
"!",
"isAuditorEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"ApplicationStartEvent",
"st... | Sends a DICOM Application Activity / Application Start Event audit message
@param eventOutcome Event Outcome Indicator
@param actorName Application Participant User ID (Actor Name)
@param actorStarter Application Starter Participant User ID (Actor Starter Name) | [
"Sends",
"a",
"DICOM",
"Application",
"Activity",
"/",
"Application",
"Start",
"Event",
"audit",
"message"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/IHEAuditor.java#L603-L615 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1, T2, T3, T4, T5, T6, T7> Func7<T1, T2, T3, T4, T5, T6, T7, Observable<Void>> toAsync(Action7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7> action) {
"""
Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img wid... | java | public static <T1, T2, T3, T4, T5, T6, T7> Func7<T1, T2, T3, T4, T5, T6, T7, Observable<Void>> toAsync(Action7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7> action) {
return toAsync(action, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"T6",
",",
"T7",
">",
"Func7",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"T6",
",",
"T7",
",",
"Observable",
"<",
"Void",
">",
">",
"toAsync",... | Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
... | [
"Convert",
"a",
"synchronous",
"action",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L524-L526 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/ObjectInputStream.java | ObjectInputStream.readFully | public void readFully(byte[] dst, int offset, int byteCount) throws IOException {
"""
Reads {@code byteCount} bytes from the source stream into the byte array {@code dst}.
@param dst
the byte array in which to store the bytes read.
@param offset
the initial position in {@code dst} to store the bytes
read fr... | java | public void readFully(byte[] dst, int offset, int byteCount) throws IOException {
primitiveTypes.readFully(dst, offset, byteCount);
} | [
"public",
"void",
"readFully",
"(",
"byte",
"[",
"]",
"dst",
",",
"int",
"offset",
",",
"int",
"byteCount",
")",
"throws",
"IOException",
"{",
"primitiveTypes",
".",
"readFully",
"(",
"dst",
",",
"offset",
",",
"byteCount",
")",
";",
"}"
] | Reads {@code byteCount} bytes from the source stream into the byte array {@code dst}.
@param dst
the byte array in which to store the bytes read.
@param offset
the initial position in {@code dst} to store the bytes
read from the source stream.
@param byteCount
the number of bytes to read.
@throws EOFException
if the e... | [
"Reads",
"{",
"@code",
"byteCount",
"}",
"bytes",
"from",
"the",
"source",
"stream",
"into",
"the",
"byte",
"array",
"{",
"@code",
"dst",
"}",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/ObjectInputStream.java#L1215-L1217 |
canhnt/sne-xacml | sne-xacml/src/main/java/nl/uva/sne/midd/nodes/InternalNode.java | InternalNode.addChild | @SuppressWarnings("unchecked")
public void addChild(final AbstractEdge<?> edge, final AbstractNode child) {
"""
Create an out-going edge to the given node. The edge and child node are mutable objects.
If they are used in another tree, it'd better to clone before adding them.
Note: Edge<?> and InternalNode<... | java | @SuppressWarnings("unchecked")
public void addChild(final AbstractEdge<?> edge, final AbstractNode child) {
if (child == null || edge == null ||
edge.getIntervals() == null || edge.getIntervals().size() == 0) {
throw new IllegalArgumentException("Cannot add null child or empty ed... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"addChild",
"(",
"final",
"AbstractEdge",
"<",
"?",
">",
"edge",
",",
"final",
"AbstractNode",
"child",
")",
"{",
"if",
"(",
"child",
"==",
"null",
"||",
"edge",
"==",
"null",
"||",
"e... | Create an out-going edge to the given node. The edge and child node are mutable objects.
If they are used in another tree, it'd better to clone before adding them.
Note: Edge<?> and InternalNode<T> must use the same type
@param edge
@param child | [
"Create",
"an",
"out",
"-",
"going",
"edge",
"to",
"the",
"given",
"node",
".",
"The",
"edge",
"and",
"child",
"node",
"are",
"mutable",
"objects",
".",
"If",
"they",
"are",
"used",
"in",
"another",
"tree",
"it",
"d",
"better",
"to",
"clone",
"before",... | train | https://github.com/canhnt/sne-xacml/blob/7ffca16bf558d2c3ee16181d926f066ab1de75b2/sne-xacml/src/main/java/nl/uva/sne/midd/nodes/InternalNode.java#L85-L94 |
icode/ameba | src/main/java/ameba/lib/Fibers.java | Fibers.runInFiberRuntime | public static void runInFiberRuntime(FiberScheduler scheduler, SuspendableRunnable target) throws InterruptedException {
"""
Runs an action in a new fiber and awaits the fiber's termination.
Unlike {@link #runInFiber(FiberScheduler, SuspendableRunnable) runInFiber} this method does not throw {@link ExecutionExc... | java | public static void runInFiberRuntime(FiberScheduler scheduler, SuspendableRunnable target) throws InterruptedException {
FiberUtil.runInFiberRuntime(scheduler, target);
} | [
"public",
"static",
"void",
"runInFiberRuntime",
"(",
"FiberScheduler",
"scheduler",
",",
"SuspendableRunnable",
"target",
")",
"throws",
"InterruptedException",
"{",
"FiberUtil",
".",
"runInFiberRuntime",
"(",
"scheduler",
",",
"target",
")",
";",
"}"
] | Runs an action in a new fiber and awaits the fiber's termination.
Unlike {@link #runInFiber(FiberScheduler, SuspendableRunnable) runInFiber} this method does not throw {@link ExecutionException}, but wraps
any checked exception thrown by the operation in a {@link RuntimeException}.
@param scheduler the {@link FiberS... | [
"Runs",
"an",
"action",
"in",
"a",
"new",
"fiber",
"and",
"awaits",
"the",
"fiber",
"s",
"termination",
".",
"Unlike",
"{",
"@link",
"#runInFiber",
"(",
"FiberScheduler",
"SuspendableRunnable",
")",
"runInFiber",
"}",
"this",
"method",
"does",
"not",
"throw",
... | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Fibers.java#L343-L345 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java | TransferManager.uploadFileList | public MultipleFileUpload uploadFileList(String bucketName, String virtualDirectoryKeyPrefix, File directory, List<File> files,ObjectMetadataProvider metadataProvider) {
"""
Uploads all specified files to the bucket named, constructing
relative keys depending on the commonParentDirectory given.
<p>
S3 will over... | java | public MultipleFileUpload uploadFileList(String bucketName, String virtualDirectoryKeyPrefix, File directory, List<File> files,ObjectMetadataProvider metadataProvider) {
return uploadFileList(bucketName, virtualDirectoryKeyPrefix, directory, files, metadataProvider,null);
} | [
"public",
"MultipleFileUpload",
"uploadFileList",
"(",
"String",
"bucketName",
",",
"String",
"virtualDirectoryKeyPrefix",
",",
"File",
"directory",
",",
"List",
"<",
"File",
">",
"files",
",",
"ObjectMetadataProvider",
"metadataProvider",
")",
"{",
"return",
"uploadF... | Uploads all specified files to the bucket named, constructing
relative keys depending on the commonParentDirectory given.
<p>
S3 will overwrite any existing objects that happen to have the same key,
just as when uploading individual files, so use with caution.
</p>
<p>
If you are uploading <a href="http://aws.amazon.co... | [
"Uploads",
"all",
"specified",
"files",
"to",
"the",
"bucket",
"named",
"constructing",
"relative",
"keys",
"depending",
"on",
"the",
"commonParentDirectory",
"given",
".",
"<p",
">",
"S3",
"will",
"overwrite",
"any",
"existing",
"objects",
"that",
"happen",
"to... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java#L1677-L1679 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListAccountRelPersistenceImpl.java | CommercePriceListAccountRelPersistenceImpl.findByUUID_G | @Override
public CommercePriceListAccountRel findByUUID_G(String uuid, long groupId)
throws NoSuchPriceListAccountRelException {
"""
Returns the commerce price list account rel where uuid = ? and groupId = ? or throws a {@link NoSuchPriceListAccountRelException} if it could not be found.
@param uuid ... | java | @Override
public CommercePriceListAccountRel findByUUID_G(String uuid, long groupId)
throws NoSuchPriceListAccountRelException {
CommercePriceListAccountRel commercePriceListAccountRel = fetchByUUID_G(uuid,
groupId);
if (commercePriceListAccountRel == null) {
StringBundler msg = new StringBundler(6);
... | [
"@",
"Override",
"public",
"CommercePriceListAccountRel",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchPriceListAccountRelException",
"{",
"CommercePriceListAccountRel",
"commercePriceListAccountRel",
"=",
"fetchByUUID_G",
"(",
"uuid",
... | Returns the commerce price list account rel where uuid = ? and groupId = ? or throws a {@link NoSuchPriceListAccountRelException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce price list account rel
@throws NoSuchPriceListAccountRelException if a match... | [
"Returns",
"the",
"commerce",
"price",
"list",
"account",
"rel",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchPriceListAccountRelException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListAccountRelPersistenceImpl.java#L677-L704 |
super-csv/super-csv | super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/ParseDuration.java | ParseDuration.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or is not a String
"""
validateInputNotNull(value, context);
if (!(value instanceof String)) {
throw new SuperCsvCellProcessorException(String.class, value,... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
if (!(value instanceof String)) {
throw new SuperCsvCellProcessorException(String.class, value,
context, this);
}
final Duration result;
try {
result = Duration.parse((String) value);
} cat... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"String",
")",
")",
"{",
"throw",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null or is not a String | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/ParseDuration.java#L64-L78 |
buschmais/jqa-java-plugin | src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java | VisitorHelper.getFieldDescriptor | FieldDescriptor getFieldDescriptor(TypeCache.CachedType<?> cachedType, String signature) {
"""
Return the field descriptor for the given type and field signature.
@param cachedType
The containing type.
@param signature
The field signature.
@return The field descriptor.
"""
FieldDescriptor fieldD... | java | FieldDescriptor getFieldDescriptor(TypeCache.CachedType<?> cachedType, String signature) {
FieldDescriptor fieldDescriptor = cachedType.getField(signature);
if (fieldDescriptor == null) {
fieldDescriptor = scannerContext.getStore().create(FieldDescriptor.class);
fieldDescriptor.s... | [
"FieldDescriptor",
"getFieldDescriptor",
"(",
"TypeCache",
".",
"CachedType",
"<",
"?",
">",
"cachedType",
",",
"String",
"signature",
")",
"{",
"FieldDescriptor",
"fieldDescriptor",
"=",
"cachedType",
".",
"getField",
"(",
"signature",
")",
";",
"if",
"(",
"fie... | Return the field descriptor for the given type and field signature.
@param cachedType
The containing type.
@param signature
The field signature.
@return The field descriptor. | [
"Return",
"the",
"field",
"descriptor",
"for",
"the",
"given",
"type",
"and",
"field",
"signature",
"."
] | train | https://github.com/buschmais/jqa-java-plugin/blob/4c050943e9c28cf1c4a08aa962d5b5bf03c4fe54/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java#L180-L188 |
lightbend/config | config/src/main/java/com/typesafe/config/ConfigFactory.java | ConfigFactory.parseProperties | public static Config parseProperties(Properties properties,
ConfigParseOptions options) {
"""
Converts a Java {@link java.util.Properties} object to a
{@link ConfigObject} using the rules documented in the <a
href="https://github.com/lightbend/config/blob/master/HOCON.md">HOCON
spec</a>. The keys in... | java | public static Config parseProperties(Properties properties,
ConfigParseOptions options) {
return Parseable.newProperties(properties, options).parse().toConfig();
} | [
"public",
"static",
"Config",
"parseProperties",
"(",
"Properties",
"properties",
",",
"ConfigParseOptions",
"options",
")",
"{",
"return",
"Parseable",
".",
"newProperties",
"(",
"properties",
",",
"options",
")",
".",
"parse",
"(",
")",
".",
"toConfig",
"(",
... | Converts a Java {@link java.util.Properties} object to a
{@link ConfigObject} using the rules documented in the <a
href="https://github.com/lightbend/config/blob/master/HOCON.md">HOCON
spec</a>. The keys in the <code>Properties</code> object are split on the
period character '.' and treated as paths. The values will al... | [
"Converts",
"a",
"Java",
"{",
"@link",
"java",
".",
"util",
".",
"Properties",
"}",
"object",
"to",
"a",
"{",
"@link",
"ConfigObject",
"}",
"using",
"the",
"rules",
"documented",
"in",
"the",
"<a",
"href",
"=",
"https",
":",
"//",
"github",
".",
"com",... | train | https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigFactory.java#L641-L644 |
wildfly/wildfly-core | elytron/src/main/java/org/wildfly/extension/elytron/ProviderAttributeDefinition.java | ProviderAttributeDefinition.populateProvider | static void populateProvider(final ModelNode response, final Provider provider, final boolean includeServices) {
"""
Populate the supplied response {@link ModelNode} with information about the supplied {@link Provider}
@param response the response to populate.
@param provider the {@link Provider} to use when p... | java | static void populateProvider(final ModelNode response, final Provider provider, final boolean includeServices) {
response.get(ElytronDescriptionConstants.NAME).set(provider.getName());
response.get(ElytronDescriptionConstants.INFO).set(provider.getInfo());
response.get(ElytronDescriptionConstant... | [
"static",
"void",
"populateProvider",
"(",
"final",
"ModelNode",
"response",
",",
"final",
"Provider",
"provider",
",",
"final",
"boolean",
"includeServices",
")",
"{",
"response",
".",
"get",
"(",
"ElytronDescriptionConstants",
".",
"NAME",
")",
".",
"set",
"("... | Populate the supplied response {@link ModelNode} with information about the supplied {@link Provider}
@param response the response to populate.
@param provider the {@link Provider} to use when populating the response. | [
"Populate",
"the",
"supplied",
"response",
"{",
"@link",
"ModelNode",
"}",
"with",
"information",
"about",
"the",
"supplied",
"{",
"@link",
"Provider",
"}"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/elytron/src/main/java/org/wildfly/extension/elytron/ProviderAttributeDefinition.java#L164-L172 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsUserDriver.java | CmsUserDriver.createRoleQuery | protected String createRoleQuery(String mainQuery, boolean includeSubOus, boolean readRoles) {
"""
Returns a sql query to select groups.<p>
@param mainQuery the main select sql query
@param includeSubOus if groups in sub-ous should be included in the selection
@param readRoles if groups or roles whould be sel... | java | protected String createRoleQuery(String mainQuery, boolean includeSubOus, boolean readRoles) {
String sqlQuery = m_sqlManager.readQuery(mainQuery);
sqlQuery += " ";
if (includeSubOus) {
sqlQuery += m_sqlManager.readQuery("C_GROUPS_GROUP_OU_LIKE_1");
} else {
sqlQ... | [
"protected",
"String",
"createRoleQuery",
"(",
"String",
"mainQuery",
",",
"boolean",
"includeSubOus",
",",
"boolean",
"readRoles",
")",
"{",
"String",
"sqlQuery",
"=",
"m_sqlManager",
".",
"readQuery",
"(",
"mainQuery",
")",
";",
"sqlQuery",
"+=",
"\" \"",
";",... | Returns a sql query to select groups.<p>
@param mainQuery the main select sql query
@param includeSubOus if groups in sub-ous should be included in the selection
@param readRoles if groups or roles whould be selected
@return a sql query to select groups | [
"Returns",
"a",
"sql",
"query",
"to",
"select",
"groups",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsUserDriver.java#L2111-L2129 |
jbundle/jbundle | thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/TableProxy.java | TableProxy.getRemoteDatabase | public RemoteDatabase getRemoteDatabase(Map<String, Object> properties) throws RemoteException {
"""
Get/Make this remote database session for this table session.
@param properties The client database properties (Typically for transaction support).
"""
BaseTransport transport = this.createProxyTranspo... | java | public RemoteDatabase getRemoteDatabase(Map<String, Object> properties) throws RemoteException
{
BaseTransport transport = this.createProxyTransport(GET_REMOTE_DATABASE);
transport.addParam(PROPERTIES, properties);
String strRemoteDatabaseID = (String)transport.sendMessageAndGetReply();
... | [
"public",
"RemoteDatabase",
"getRemoteDatabase",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"throws",
"RemoteException",
"{",
"BaseTransport",
"transport",
"=",
"this",
".",
"createProxyTransport",
"(",
"GET_REMOTE_DATABASE",
")",
";",
"transp... | Get/Make this remote database session for this table session.
@param properties The client database properties (Typically for transaction support). | [
"Get",
"/",
"Make",
"this",
"remote",
"database",
"session",
"for",
"this",
"table",
"session",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/TableProxy.java#L278-L288 |
XDean/Java-EX | src/main/java/xdean/jex/util/reflect/AnnotationUtil.java | AnnotationUtil.addAnnotation | @SuppressWarnings("unchecked")
public static void addAnnotation(Executable ex, Annotation annotation) {
"""
Add annotation to Executable(Method or Constructor)<br>
Note that you may need to give the root method.
@param ex
@param annotation
@author XDean
@see Executable
@see #createAnnotationFromMap(Clas... | java | @SuppressWarnings("unchecked")
public static void addAnnotation(Executable ex, Annotation annotation) {
ex.getAnnotation(Annotation.class);// prevent declaredAnnotations haven't initialized
Map<Class<? extends Annotation>, Annotation> annos;
try {
annos = (Map<Class<? extends Annotation>, Annot... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"addAnnotation",
"(",
"Executable",
"ex",
",",
"Annotation",
"annotation",
")",
"{",
"ex",
".",
"getAnnotation",
"(",
"Annotation",
".",
"class",
")",
";",
"// prevent declaredAnnotati... | Add annotation to Executable(Method or Constructor)<br>
Note that you may need to give the root method.
@param ex
@param annotation
@author XDean
@see Executable
@see #createAnnotationFromMap(Class, Map)
@see ReflectUtil#getRootMethods(Class) | [
"Add",
"annotation",
"to",
"Executable",
"(",
"Method",
"or",
"Constructor",
")",
"<br",
">",
"Note",
"that",
"you",
"may",
"need",
"to",
"give",
"the",
"root",
"method",
"."
] | train | https://github.com/XDean/Java-EX/blob/9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7/src/main/java/xdean/jex/util/reflect/AnnotationUtil.java#L127-L145 |
dmfs/http-client-interfaces | src/org/dmfs/httpclientinterfaces/HttpStatus.java | HttpStatus.fromStatusLine | public static HttpStatus fromStatusLine(final String statusLine) throws IllegalArgumentException {
"""
Parse an HTTP status line for the status code. The status line must comply to <a href="https://tools.ietf.org/html/rfc7230#section-3.1.2">RFC 7230
section 3.1.2</a>.
<p />
This method is rather tolerant. It do... | java | public static HttpStatus fromStatusLine(final String statusLine) throws IllegalArgumentException
{
/*
* According to RFC 7230, a valid HTTP status line always looks like
*
* HTTP-Version SP Status-Code SP Reason-Phrase CRLF
*
* This method method scans for the two spaces and tries to convert the str... | [
"public",
"static",
"HttpStatus",
"fromStatusLine",
"(",
"final",
"String",
"statusLine",
")",
"throws",
"IllegalArgumentException",
"{",
"/*\n\t\t * According to RFC 7230, a valid HTTP status line always looks like\n\t\t * \n\t\t * HTTP-Version SP Status-Code SP Reason-Phrase CRLF\n\t\t * \... | Parse an HTTP status line for the status code. The status line must comply to <a href="https://tools.ietf.org/html/rfc7230#section-3.1.2">RFC 7230
section 3.1.2</a>.
<p />
This method is rather tolerant. It doesn't actually verify the HTTP version nor the reason phrase.
@param statusLine
A {@link String} containing an... | [
"Parse",
"an",
"HTTP",
"status",
"line",
"for",
"the",
"status",
"code",
".",
"The",
"status",
"line",
"must",
"comply",
"to",
"<a",
"href",
"=",
"https",
":",
"//",
"tools",
".",
"ietf",
".",
"org",
"/",
"html",
"/",
"rfc7230#section",
"-",
"3",
"."... | train | https://github.com/dmfs/http-client-interfaces/blob/10896c71270ccaf32ac4ed5d706dfa0001fd3862/src/org/dmfs/httpclientinterfaces/HttpStatus.java#L352-L395 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java | LeaderSelector.getLeader | public Participant getLeader() throws Exception {
"""
<p>
Return the id for the current leader. If for some reason there is no
current leader, a dummy participant is returned.
</p>
<p>
<p>
<B>NOTE</B> - this method polls the ZK server. Therefore it can possibly
return a value that does not match {@link #has... | java | public Participant getLeader() throws Exception
{
Collection<String> participantNodes = mutex.getParticipantNodes();
return getLeader(client, participantNodes);
} | [
"public",
"Participant",
"getLeader",
"(",
")",
"throws",
"Exception",
"{",
"Collection",
"<",
"String",
">",
"participantNodes",
"=",
"mutex",
".",
"getParticipantNodes",
"(",
")",
";",
"return",
"getLeader",
"(",
"client",
",",
"participantNodes",
")",
";",
... | <p>
Return the id for the current leader. If for some reason there is no
current leader, a dummy participant is returned.
</p>
<p>
<p>
<B>NOTE</B> - this method polls the ZK server. Therefore it can possibly
return a value that does not match {@link #hasLeadership()} as hasLeadership
uses a local field of the class.
</... | [
"<p",
">",
"Return",
"the",
"id",
"for",
"the",
"current",
"leader",
".",
"If",
"for",
"some",
"reason",
"there",
"is",
"no",
"current",
"leader",
"a",
"dummy",
"participant",
"is",
"returned",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<p",
">",
"<B",
"... | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java#L334-L338 |
52inc/android-52Kit | library-winds/src/main/java/com/ftinc/kit/winds/Winds.java | Winds.checkChangelogDialog | public static void checkChangelogDialog(Activity ctx, @XmlRes int configId) {
"""
Check to see if we should show the changelog activity if there are any new changes
to the configuration file.
@param ctx the context to launch the activity with
@param configId the changelog configuration xml reso... | java | public static void checkChangelogDialog(Activity ctx, @XmlRes int configId){
// Parse configuration
ChangeLog changeLog = Parser.parse(ctx, configId);
if(changeLog != null){
// Validate that there is a new version code
if(validateVersion(ctx, changeLog)) {
... | [
"public",
"static",
"void",
"checkChangelogDialog",
"(",
"Activity",
"ctx",
",",
"@",
"XmlRes",
"int",
"configId",
")",
"{",
"// Parse configuration",
"ChangeLog",
"changeLog",
"=",
"Parser",
".",
"parse",
"(",
"ctx",
",",
"configId",
")",
";",
"if",
"(",
"c... | Check to see if we should show the changelog activity if there are any new changes
to the configuration file.
@param ctx the context to launch the activity with
@param configId the changelog configuration xml resource id | [
"Check",
"to",
"see",
"if",
"we",
"should",
"show",
"the",
"changelog",
"activity",
"if",
"there",
"are",
"any",
"new",
"changes",
"to",
"the",
"configuration",
"file",
"."
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-winds/src/main/java/com/ftinc/kit/winds/Winds.java#L153-L168 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addInlineComment | public void addInlineComment(Element element, Content htmltree) {
"""
Adds the inline comment.
@param element the Element for which the inline comments will be generated
@param htmltree the documentation tree to which the inline comments will be added
"""
addCommentTags(element, utils.getFullBody(e... | java | public void addInlineComment(Element element, Content htmltree) {
addCommentTags(element, utils.getFullBody(element), false, false, htmltree);
} | [
"public",
"void",
"addInlineComment",
"(",
"Element",
"element",
",",
"Content",
"htmltree",
")",
"{",
"addCommentTags",
"(",
"element",
",",
"utils",
".",
"getFullBody",
"(",
"element",
")",
",",
"false",
",",
"false",
",",
"htmltree",
")",
";",
"}"
] | Adds the inline comment.
@param element the Element for which the inline comments will be generated
@param htmltree the documentation tree to which the inline comments will be added | [
"Adds",
"the",
"inline",
"comment",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1685-L1687 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.processRelationships | protected void processRelationships(final ParserData parserData) {
"""
Process the relationships without logging any errors.
@param parserData
"""
// Process the level relationships
for (final Map.Entry<String, List<Relationship>> entry : parserData.getLevelRelationships().entrySet()) {
... | java | protected void processRelationships(final ParserData parserData) {
// Process the level relationships
for (final Map.Entry<String, List<Relationship>> entry : parserData.getLevelRelationships().entrySet()) {
final String levelId = entry.getKey();
final Level level = parserData.ge... | [
"protected",
"void",
"processRelationships",
"(",
"final",
"ParserData",
"parserData",
")",
"{",
"// Process the level relationships",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"Relationship",
">",
">",
"entry",
":",
"parserData",
... | Process the relationships without logging any errors.
@param parserData | [
"Process",
"the",
"relationships",
"without",
"logging",
"any",
"errors",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L1797-L1821 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryInterestPointAlgs.java | FactoryInterestPointAlgs.fastHessian | public static <II extends ImageGray<II>>
FastHessianFeatureDetector<II> fastHessian( @Nullable ConfigFastHessian config ) {
"""
Creates a Fast Hessian blob detector used by SURF.
@param config Configuration for detector. Pass in null for default options.
@param <II> Integral Image
@return The feature detecto... | java | public static <II extends ImageGray<II>>
FastHessianFeatureDetector<II> fastHessian( @Nullable ConfigFastHessian config ) {
if( config == null )
config = new ConfigFastHessian();
config.checkValidity();
// ignore border is overwritten by Fast Hessian at detection time
NonMaxSuppression extractor = Factory... | [
"public",
"static",
"<",
"II",
"extends",
"ImageGray",
"<",
"II",
">",
">",
"FastHessianFeatureDetector",
"<",
"II",
">",
"fastHessian",
"(",
"@",
"Nullable",
"ConfigFastHessian",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"config",
"=",
"... | Creates a Fast Hessian blob detector used by SURF.
@param config Configuration for detector. Pass in null for default options.
@param <II> Integral Image
@return The feature detector | [
"Creates",
"a",
"Fast",
"Hessian",
"blob",
"detector",
"used",
"by",
"SURF",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryInterestPointAlgs.java#L170-L183 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagUserTracking.java | CmsJspTagUserTracking.removeSessionAttributes | protected static void removeSessionAttributes(String[] prefixes, HttpServletRequest req) {
"""
Removes all session attributes starting with the given prefixes.<p>
@param prefixes the prefixes of the session attributes to remove
@param req the current request
"""
HttpSession session = req.getSessio... | java | protected static void removeSessionAttributes(String[] prefixes, HttpServletRequest req) {
HttpSession session = req.getSession(true);
@SuppressWarnings("unchecked")
Enumeration<String> en = session.getAttributeNames();
while (en.hasMoreElements()) {
String attrKey = en.next... | [
"protected",
"static",
"void",
"removeSessionAttributes",
"(",
"String",
"[",
"]",
"prefixes",
",",
"HttpServletRequest",
"req",
")",
"{",
"HttpSession",
"session",
"=",
"req",
".",
"getSession",
"(",
"true",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\... | Removes all session attributes starting with the given prefixes.<p>
@param prefixes the prefixes of the session attributes to remove
@param req the current request | [
"Removes",
"all",
"session",
"attributes",
"starting",
"with",
"the",
"given",
"prefixes",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagUserTracking.java#L350-L363 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/CachedRemoteTable.java | CachedRemoteTable.doMove | public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException {
"""
Move the current position and read the record (optionally read several records).
Note: The cache only kicks in for move(+1).
@param iRelPosition relative Position to read the next record.
@param iRecordCount Recor... | java | public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException
{
boolean bShouldBeCached = (((m_iOpenMode & Constants.OPEN_CACHE_RECORDS) == Constants.OPEN_CACHE_RECORDS)
|| ((m_iOpenMode & Constants.OPEN_READ_ONLY) == Constants.OPEN_READ_ONLY));
if (!bS... | [
"public",
"Object",
"doMove",
"(",
"int",
"iRelPosition",
",",
"int",
"iRecordCount",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"boolean",
"bShouldBeCached",
"=",
"(",
"(",
"(",
"m_iOpenMode",
"&",
"Constants",
".",
"OPEN_CACHE_RECORDS",
")",
"=... | Move the current position and read the record (optionally read several records).
Note: The cache only kicks in for move(+1).
@param iRelPosition relative Position to read the next record.
@param iRecordCount Records to read.
@return If I read 1 record, this is the record's data.
@return If I read several records, this ... | [
"Move",
"the",
"current",
"position",
"and",
"read",
"the",
"record",
"(",
"optionally",
"read",
"several",
"records",
")",
".",
"Note",
":",
"The",
"cache",
"only",
"kicks",
"in",
"for",
"move",
"(",
"+",
"1",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/CachedRemoteTable.java#L290-L315 |
airbnb/lottie-android | lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java | LottieDrawable.setMaxProgress | public void setMaxProgress(@FloatRange(from = 0f, to = 1f) final float maxProgress) {
"""
Sets the maximum progress that the animation will end at when playing or looping.
"""
if (composition == null) {
lazyCompositionTasks.add(new LazyCompositionTask() {
@Override
public void run(Lot... | java | public void setMaxProgress(@FloatRange(from = 0f, to = 1f) final float maxProgress) {
if (composition == null) {
lazyCompositionTasks.add(new LazyCompositionTask() {
@Override
public void run(LottieComposition composition) {
setMaxProgress(maxProgress);
}
});
retu... | [
"public",
"void",
"setMaxProgress",
"(",
"@",
"FloatRange",
"(",
"from",
"=",
"0f",
",",
"to",
"=",
"1f",
")",
"final",
"float",
"maxProgress",
")",
"{",
"if",
"(",
"composition",
"==",
"null",
")",
"{",
"lazyCompositionTasks",
".",
"add",
"(",
"new",
... | Sets the maximum progress that the animation will end at when playing or looping. | [
"Sets",
"the",
"maximum",
"progress",
"that",
"the",
"animation",
"will",
"end",
"at",
"when",
"playing",
"or",
"looping",
"."
] | train | https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L477-L488 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/utils/MongoDBUtils.java | MongoDBUtils.populateValue | public static Object populateValue(Object valObj, Class clazz) {
"""
Populate value.
@param valObj
the val obj
@param clazz
the clazz
@return the object
"""
if (isUTF8Value(clazz) || clazz.isEnum())
{
return valObj.toString();
}
else if ((valObj instanceof Cal... | java | public static Object populateValue(Object valObj, Class clazz)
{
if (isUTF8Value(clazz) || clazz.isEnum())
{
return valObj.toString();
}
else if ((valObj instanceof Calendar) || (valObj instanceof GregorianCalendar))
{
return ((Calendar) valObj).getTim... | [
"public",
"static",
"Object",
"populateValue",
"(",
"Object",
"valObj",
",",
"Class",
"clazz",
")",
"{",
"if",
"(",
"isUTF8Value",
"(",
"clazz",
")",
"||",
"clazz",
".",
"isEnum",
"(",
")",
")",
"{",
"return",
"valObj",
".",
"toString",
"(",
")",
";",
... | Populate value.
@param valObj
the val obj
@param clazz
the clazz
@return the object | [
"Populate",
"value",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/utils/MongoDBUtils.java#L140-L167 |
sarxos/webcam-capture | webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamUtils.java | WebcamUtils.loadRB | public static final ResourceBundle loadRB(Class<?> clazz, Locale locale) {
"""
Get resource bundle for specific class.
@param clazz the class for which resource bundle should be found
@param locale the {@link Locale} object
@return Resource bundle
"""
String pkg = WebcamUtils.class.getPackage().getName... | java | public static final ResourceBundle loadRB(Class<?> clazz, Locale locale) {
String pkg = WebcamUtils.class.getPackage().getName().replaceAll("\\.", "/");
return PropertyResourceBundle.getBundle(String.format("%s/i18n/%s", pkg, clazz.getSimpleName()));
} | [
"public",
"static",
"final",
"ResourceBundle",
"loadRB",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Locale",
"locale",
")",
"{",
"String",
"pkg",
"=",
"WebcamUtils",
".",
"class",
".",
"getPackage",
"(",
")",
".",
"getName",
"(",
")",
".",
"replaceAll",... | Get resource bundle for specific class.
@param clazz the class for which resource bundle should be found
@param locale the {@link Locale} object
@return Resource bundle | [
"Get",
"resource",
"bundle",
"for",
"specific",
"class",
"."
] | train | https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamUtils.java#L76-L79 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java | Uris.getRawQuery | public static String getRawQuery(final URI uri, final boolean strict) {
"""
Returns the raw (and normalized) query of the given URI, or null if it is empty.
@param uri the URI to extract query from
@param strict whether or not to do strict escaping
@return the query or null if it is undefined
"""
... | java | public static String getRawQuery(final URI uri, final boolean strict) {
return esc(strict).escapeQuery(Strings.emptyToNull(uri.getRawQuery()));
} | [
"public",
"static",
"String",
"getRawQuery",
"(",
"final",
"URI",
"uri",
",",
"final",
"boolean",
"strict",
")",
"{",
"return",
"esc",
"(",
"strict",
")",
".",
"escapeQuery",
"(",
"Strings",
".",
"emptyToNull",
"(",
"uri",
".",
"getRawQuery",
"(",
")",
"... | Returns the raw (and normalized) query of the given URI, or null if it is empty.
@param uri the URI to extract query from
@param strict whether or not to do strict escaping
@return the query or null if it is undefined | [
"Returns",
"the",
"raw",
"(",
"and",
"normalized",
")",
"query",
"of",
"the",
"given",
"URI",
"or",
"null",
"if",
"it",
"is",
"empty",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java#L242-L244 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java | StreamSegmentContainer.processAttributeUpdaterOperation | private <T extends Operation & AttributeUpdaterOperation> CompletableFuture<Void> processAttributeUpdaterOperation(T operation, TimeoutTimer timer) {
"""
Processes the given AttributeUpdateOperation with exactly one retry in case it was rejected because of an attribute
update failure due to the attribute value mi... | java | private <T extends Operation & AttributeUpdaterOperation> CompletableFuture<Void> processAttributeUpdaterOperation(T operation, TimeoutTimer timer) {
Collection<AttributeUpdate> updates = operation.getAttributeUpdates();
if (updates == null || updates.isEmpty()) {
// No need for extra compli... | [
"private",
"<",
"T",
"extends",
"Operation",
"&",
"AttributeUpdaterOperation",
">",
"CompletableFuture",
"<",
"Void",
">",
"processAttributeUpdaterOperation",
"(",
"T",
"operation",
",",
"TimeoutTimer",
"timer",
")",
"{",
"Collection",
"<",
"AttributeUpdate",
">",
"... | Processes the given AttributeUpdateOperation with exactly one retry in case it was rejected because of an attribute
update failure due to the attribute value missing from the in-memory cache.
@param operation The Operation to process.
@param timer Timer for the operation.
@param <T> Type of the operation.
@r... | [
"Processes",
"the",
"given",
"AttributeUpdateOperation",
"with",
"exactly",
"one",
"retry",
"in",
"case",
"it",
"was",
"rejected",
"because",
"of",
"an",
"attribute",
"update",
"failure",
"due",
"to",
"the",
"attribute",
"value",
"missing",
"from",
"the",
"in",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java#L634-L666 |
zalando-nakadi/fahrschein | fahrschein-http-simple/src/main/java/org/zalando/fahrschein/http/simple/SimpleRequestFactory.java | SimpleRequestFactory.prepareConnection | private void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException {
"""
Template method for preparing the given {@link HttpURLConnection}.
<p>The default implementation prepares the connection for input and output, and sets the HTTP method.
@param connection the connection to p... | java | private void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException {
if (this.connectTimeout >= 0) {
connection.setConnectTimeout(this.connectTimeout);
}
if (this.readTimeout >= 0) {
connection.setReadTimeout(this.readTimeout);
}
... | [
"private",
"void",
"prepareConnection",
"(",
"HttpURLConnection",
"connection",
",",
"String",
"httpMethod",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"connectTimeout",
">=",
"0",
")",
"{",
"connection",
".",
"setConnectTimeout",
"(",
"this",
".... | Template method for preparing the given {@link HttpURLConnection}.
<p>The default implementation prepares the connection for input and output, and sets the HTTP method.
@param connection the connection to prepare
@param httpMethod the HTTP request method ({@code GET}, {@code POST}, etc.)
@throws IOException in case of... | [
"Template",
"method",
"for",
"preparing",
"the",
"given",
"{",
"@link",
"HttpURLConnection",
"}",
".",
"<p",
">",
"The",
"default",
"implementation",
"prepares",
"the",
"connection",
"for",
"input",
"and",
"output",
"and",
"sets",
"the",
"HTTP",
"method",
"."
... | train | https://github.com/zalando-nakadi/fahrschein/blob/b55ae0ff79aacb300548a88f3969fd11a0904804/fahrschein-http-simple/src/main/java/org/zalando/fahrschein/http/simple/SimpleRequestFactory.java#L78-L101 |
the-fascinator/plugin-authentication-internal | src/main/java/com/googlecode/fascinator/authentication/internal/InternalAuthentication.java | InternalAuthentication.encryptPassword | private String encryptPassword(String password)
throws AuthenticationException {
"""
Password encryption method
@param password Password to be encrypted
@return encrypted password
@throws AuthenticationException if fail to encrypt
"""
byte[] passwordBytes = password.getBytes();
... | java | private String encryptPassword(String password)
throws AuthenticationException {
byte[] passwordBytes = password.getBytes();
try {
MessageDigest algorithm = MessageDigest.getInstance("MD5");
algorithm.reset();
algorithm.update(passwordBytes);
... | [
"private",
"String",
"encryptPassword",
"(",
"String",
"password",
")",
"throws",
"AuthenticationException",
"{",
"byte",
"[",
"]",
"passwordBytes",
"=",
"password",
".",
"getBytes",
"(",
")",
";",
"try",
"{",
"MessageDigest",
"algorithm",
"=",
"MessageDigest",
... | Password encryption method
@param password Password to be encrypted
@return encrypted password
@throws AuthenticationException if fail to encrypt | [
"Password",
"encryption",
"method"
] | train | https://github.com/the-fascinator/plugin-authentication-internal/blob/a2b9a0eda9b43bf20583036a406c83c938be3042/src/main/java/com/googlecode/fascinator/authentication/internal/InternalAuthentication.java#L221-L242 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslciphersuite.java | sslciphersuite.get | public static sslciphersuite get(nitro_service service, String ciphername) throws Exception {
"""
Use this API to fetch sslciphersuite resource of given name .
"""
sslciphersuite obj = new sslciphersuite();
obj.set_ciphername(ciphername);
sslciphersuite response = (sslciphersuite) obj.get_resource(servic... | java | public static sslciphersuite get(nitro_service service, String ciphername) throws Exception{
sslciphersuite obj = new sslciphersuite();
obj.set_ciphername(ciphername);
sslciphersuite response = (sslciphersuite) obj.get_resource(service);
return response;
} | [
"public",
"static",
"sslciphersuite",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"ciphername",
")",
"throws",
"Exception",
"{",
"sslciphersuite",
"obj",
"=",
"new",
"sslciphersuite",
"(",
")",
";",
"obj",
".",
"set_ciphername",
"(",
"ciphername",
")"... | Use this API to fetch sslciphersuite resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"sslciphersuite",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslciphersuite.java#L122-L127 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java | AbstractQueuedSynchronizer.acquireQueued | final boolean acquireQueued(final Node node, int arg) {
"""
Acquires in exclusive uninterruptible mode for thread already in
queue. Used by condition wait methods as well as acquire.
@param node the node
@param arg the acquire argument
@return {@code true} if interrupted while waiting
"""
try {
... | java | final boolean acquireQueued(final Node node, int arg) {
try {
boolean interrupted = false;
for (;;) {
final Node p = node.predecessor();
if (p == head && tryAcquire(arg)) {
setHead(node);
p.next = null; // help GC
... | [
"final",
"boolean",
"acquireQueued",
"(",
"final",
"Node",
"node",
",",
"int",
"arg",
")",
"{",
"try",
"{",
"boolean",
"interrupted",
"=",
"false",
";",
"for",
"(",
";",
";",
")",
"{",
"final",
"Node",
"p",
"=",
"node",
".",
"predecessor",
"(",
")",
... | Acquires in exclusive uninterruptible mode for thread already in
queue. Used by condition wait methods as well as acquire.
@param node the node
@param arg the acquire argument
@return {@code true} if interrupted while waiting | [
"Acquires",
"in",
"exclusive",
"uninterruptible",
"mode",
"for",
"thread",
"already",
"in",
"queue",
".",
"Used",
"by",
"condition",
"wait",
"methods",
"as",
"well",
"as",
"acquire",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#L893-L911 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemUtils.java | ProxiedFileSystemUtils.createProxiedFileSystemUsingToken | static FileSystem createProxiedFileSystemUsingToken(@NonNull String userNameToProxyAs,
@NonNull Token<?> userNameToken, URI fsURI, Configuration conf) throws IOException, InterruptedException {
"""
Create a {@link FileSystem} that can perform any operations allowed the by the specified userNameToProxyAs. The... | java | static FileSystem createProxiedFileSystemUsingToken(@NonNull String userNameToProxyAs,
@NonNull Token<?> userNameToken, URI fsURI, Configuration conf) throws IOException, InterruptedException {
UserGroupInformation ugi =
UserGroupInformation.createProxyUser(userNameToProxyAs, UserGroupInformation.getL... | [
"static",
"FileSystem",
"createProxiedFileSystemUsingToken",
"(",
"@",
"NonNull",
"String",
"userNameToProxyAs",
",",
"@",
"NonNull",
"Token",
"<",
"?",
">",
"userNameToken",
",",
"URI",
"fsURI",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
",",
"In... | Create a {@link FileSystem} that can perform any operations allowed the by the specified userNameToProxyAs. The
method first proxies as userNameToProxyAs, and then adds the specified {@link Token} to the given
{@link UserGroupInformation} object. It then uses the {@link UserGroupInformation#doAs(PrivilegedExceptionActi... | [
"Create",
"a",
"{",
"@link",
"FileSystem",
"}",
"that",
"can",
"perform",
"any",
"operations",
"allowed",
"the",
"by",
"the",
"specified",
"userNameToProxyAs",
".",
"The",
"method",
"first",
"proxies",
"as",
"userNameToProxyAs",
"and",
"then",
"adds",
"the",
"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemUtils.java#L177-L183 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getRange | public IntegerRanges getRange(String name, String defaultValue) {
"""
Parse the given attribute as a set of integer ranges
@param name the attribute name
@param defaultValue the default value if it is not set
@return a new set of ranges from the configured value
"""
return new IntegerRanges(get(name, defa... | java | public IntegerRanges getRange(String name, String defaultValue) {
return new IntegerRanges(get(name, defaultValue));
} | [
"public",
"IntegerRanges",
"getRange",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"new",
"IntegerRanges",
"(",
"get",
"(",
"name",
",",
"defaultValue",
")",
")",
";",
"}"
] | Parse the given attribute as a set of integer ranges
@param name the attribute name
@param defaultValue the default value if it is not set
@return a new set of ranges from the configured value | [
"Parse",
"the",
"given",
"attribute",
"as",
"a",
"set",
"of",
"integer",
"ranges"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2033-L2035 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/landf/ScreenUtil.java | ScreenUtil.getPropery | public static String getPropery(String key, PropertyOwner propertyOwner, Map<String,Object> properties, String defaultValue) {
"""
A utility to get the property from the propertyowner or the property.
"""
String returnValue = null;
if (propertyOwner != null)
returnValue = propertyOw... | java | public static String getPropery(String key, PropertyOwner propertyOwner, Map<String,Object> properties, String defaultValue)
{
String returnValue = null;
if (propertyOwner != null)
returnValue = propertyOwner.getProperty(key);
if (properties != null) if (returnValue == null)
... | [
"public",
"static",
"String",
"getPropery",
"(",
"String",
"key",
",",
"PropertyOwner",
"propertyOwner",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"String",
"defaultValue",
")",
"{",
"String",
"returnValue",
"=",
"null",
";",
"if",
"(... | A utility to get the property from the propertyowner or the property. | [
"A",
"utility",
"to",
"get",
"the",
"property",
"from",
"the",
"propertyowner",
"or",
"the",
"property",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/landf/ScreenUtil.java#L210-L220 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java | DirectoryHelper.copyDirectory | public static void copyDirectory(File srcPath, File dstPath) throws IOException {
"""
Copy directory.
@param srcPath
source path
@param dstPath
destination path
@throws IOException
if any exception occurred
"""
if (srcPath.isDirectory())
{
if (!dstPath.exists())
{
... | java | public static void copyDirectory(File srcPath, File dstPath) throws IOException
{
if (srcPath.isDirectory())
{
if (!dstPath.exists())
{
dstPath.mkdirs();
}
String files[] = srcPath.list();
for (int i = 0; i < files.length; i++)
... | [
"public",
"static",
"void",
"copyDirectory",
"(",
"File",
"srcPath",
",",
"File",
"dstPath",
")",
"throws",
"IOException",
"{",
"if",
"(",
"srcPath",
".",
"isDirectory",
"(",
")",
")",
"{",
"if",
"(",
"!",
"dstPath",
".",
"exists",
"(",
")",
")",
"{",
... | Copy directory.
@param srcPath
source path
@param dstPath
destination path
@throws IOException
if any exception occurred | [
"Copy",
"directory",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/DirectoryHelper.java#L96-L137 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPURLConnectionInterceptor.java | HTTPURLConnectionInterceptor.populateRequestHeaders | private void populateRequestHeaders(HttpURLConnection httpUrlConnection, Map<String, String> requestHeaders) {
"""
Method to populate the HTTP request headers by reading it from the requestHeaders Map
"""
Set<String> keySet = requestHeaders.keySet();
Iterator<String> keySetIterator = keySet.iterator();
... | java | private void populateRequestHeaders(HttpURLConnection httpUrlConnection, Map<String, String> requestHeaders) {
Set<String> keySet = requestHeaders.keySet();
Iterator<String> keySetIterator = keySet.iterator();
while (keySetIterator.hasNext()) {
String key = keySetIterator.next();
String value = requestHe... | [
"private",
"void",
"populateRequestHeaders",
"(",
"HttpURLConnection",
"httpUrlConnection",
",",
"Map",
"<",
"String",
",",
"String",
">",
"requestHeaders",
")",
"{",
"Set",
"<",
"String",
">",
"keySet",
"=",
"requestHeaders",
".",
"keySet",
"(",
")",
";",
"It... | Method to populate the HTTP request headers by reading it from the requestHeaders Map | [
"Method",
"to",
"populate",
"the",
"HTTP",
"request",
"headers",
"by",
"reading",
"it",
"from",
"the",
"requestHeaders",
"Map"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPURLConnectionInterceptor.java#L132-L149 |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/Query.java | Query.withValue | public static Query withValue(String expression) {
"""
<pre>
{ field:<field>, op:<op>, rvalue:<value> }
{ field:<field>, op:<op>, values:[values] }
</pre>
"""
String[] parts = split(expression);
if (parts != null) {
String field = parts[0];
String operator = parts[1];... | java | public static Query withValue(String expression) {
String[] parts = split(expression);
if (parts != null) {
String field = parts[0];
String operator = parts[1];
String value = parts[2];
BinOp binOp = BinOp.getOp(operator);
if (binOp != null) {... | [
"public",
"static",
"Query",
"withValue",
"(",
"String",
"expression",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"split",
"(",
"expression",
")",
";",
"if",
"(",
"parts",
"!=",
"null",
")",
"{",
"String",
"field",
"=",
"parts",
"[",
"0",
"]",
";",
... | <pre>
{ field:<field>, op:<op>, rvalue:<value> }
{ field:<field>, op:<op>, values:[values] }
</pre> | [
"<pre",
">",
"{",
"field",
":",
"<field",
">",
"op",
":",
"<op",
">",
"rvalue",
":",
"<value",
">",
"}",
"{",
"field",
":",
"<field",
">",
"op",
":",
"<op",
">",
"values",
":",
"[",
"values",
"]",
"}",
"<",
"/",
"pre",
">"
] | train | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/Query.java#L315-L333 |
igniterealtime/Smack | smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/util/SecretKeyBackupHelper.java | SecretKeyBackupHelper.createSecretkeyElement | public static SecretkeyElement createSecretkeyElement(OpenPgpProvider provider,
BareJid owner,
Set<OpenPgpV4Fingerprint> fingerprints,
String backupCode)
... | java | public static SecretkeyElement createSecretkeyElement(OpenPgpProvider provider,
BareJid owner,
Set<OpenPgpV4Fingerprint> fingerprints,
String backupCode)
... | [
"public",
"static",
"SecretkeyElement",
"createSecretkeyElement",
"(",
"OpenPgpProvider",
"provider",
",",
"BareJid",
"owner",
",",
"Set",
"<",
"OpenPgpV4Fingerprint",
">",
"fingerprints",
",",
"String",
"backupCode",
")",
"throws",
"PGPException",
",",
"IOException",
... | Create a {@link SecretkeyElement} which contains the secret keys listed in {@code fingerprints} and is encrypted
symmetrically using the {@code backupCode}.
@param provider {@link OpenPgpProvider} for symmetric encryption.
@param owner owner of the secret keys (usually our jid).
@param fingerprints set of {@link OpenP... | [
"Create",
"a",
"{",
"@link",
"SecretkeyElement",
"}",
"which",
"contains",
"the",
"secret",
"keys",
"listed",
"in",
"{",
"@code",
"fingerprints",
"}",
"and",
"is",
"encrypted",
"symmetrically",
"using",
"the",
"{",
"@code",
"backupCode",
"}",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/util/SecretKeyBackupHelper.java#L91-L109 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.checkAccessibleType | void checkAccessibleType(Env<AttrContext> env, Type t) {
"""
Performs a recursive scan of a type looking for accessibility problems
from current attribution environment
"""
accessibilityChecker.visit(t, env);
} | java | void checkAccessibleType(Env<AttrContext> env, Type t) {
accessibilityChecker.visit(t, env);
} | [
"void",
"checkAccessibleType",
"(",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"Type",
"t",
")",
"{",
"accessibilityChecker",
".",
"visit",
"(",
"t",
",",
"env",
")",
";",
"}"
] | Performs a recursive scan of a type looking for accessibility problems
from current attribution environment | [
"Performs",
"a",
"recursive",
"scan",
"of",
"a",
"type",
"looking",
"for",
"accessibility",
"problems",
"from",
"current",
"attribution",
"environment"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java#L485-L487 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java | XpathUtils.asDouble | public static Double asDouble(String expression, Node node, XPath xpath)
throws XPathExpressionException {
"""
Same as {@link #asDouble(String, Node)} but allows an xpath to be passed
in explicitly for reuse.
"""
String doubleString = evaluateAsString(expression, node, xpath);
retu... | java | public static Double asDouble(String expression, Node node, XPath xpath)
throws XPathExpressionException {
String doubleString = evaluateAsString(expression, node, xpath);
return (isEmptyString(doubleString)) ? null : Double.parseDouble(doubleString);
} | [
"public",
"static",
"Double",
"asDouble",
"(",
"String",
"expression",
",",
"Node",
"node",
",",
"XPath",
"xpath",
")",
"throws",
"XPathExpressionException",
"{",
"String",
"doubleString",
"=",
"evaluateAsString",
"(",
"expression",
",",
"node",
",",
"xpath",
")... | Same as {@link #asDouble(String, Node)} but allows an xpath to be passed
in explicitly for reuse. | [
"Same",
"as",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L217-L221 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.visitMediaFormats | @SuppressWarnings("null")
private <T> T visitMediaFormats(MediaArgs mediaArgs, MediaFormatVisitor<T> mediaFormatVisitor) {
"""
Iterate over all media formats defined in media args. Ignores invalid media formats.
If the media format visitor returns a value that is not null, iteration is stopped and the value is ... | java | @SuppressWarnings("null")
private <T> T visitMediaFormats(MediaArgs mediaArgs, MediaFormatVisitor<T> mediaFormatVisitor) {
MediaFormat[] mediaFormats = mediaArgs.getMediaFormats();
if (mediaFormats != null) {
for (MediaFormat mediaFormat : mediaFormats) {
T returnValue = mediaFormatVisitor.visit... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"private",
"<",
"T",
">",
"T",
"visitMediaFormats",
"(",
"MediaArgs",
"mediaArgs",
",",
"MediaFormatVisitor",
"<",
"T",
">",
"mediaFormatVisitor",
")",
"{",
"MediaFormat",
"[",
"]",
"mediaFormats",
"=",
"mediaArgs",... | Iterate over all media formats defined in media args. Ignores invalid media formats.
If the media format visitor returns a value that is not null, iteration is stopped and the value is returned from
this method.
@param mediaArgs Media args
@param mediaFormatVisitor Media format visitor
@return Return value form media f... | [
"Iterate",
"over",
"all",
"media",
"formats",
"defined",
"in",
"media",
"args",
".",
"Ignores",
"invalid",
"media",
"formats",
".",
"If",
"the",
"media",
"format",
"visitor",
"returns",
"a",
"value",
"that",
"is",
"not",
"null",
"iteration",
"is",
"stopped",... | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L464-L476 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/buffer/BufferUtil.java | BufferUtil.unsignedBinarySearch | public static int unsignedBinarySearch(final ByteBuffer array, int position,
final int begin, final int end, final short k) {
"""
Look for value k in buffer in the range [begin,end). If the value is found, return its index.
If not, return -(i+1) where i is the index where the value would be inserted. The bu... | java | public static int unsignedBinarySearch(final ByteBuffer array, int position,
final int begin, final int end, final short k) {
return branchyUnsignedBinarySearch(array, position, begin, end, k);
} | [
"public",
"static",
"int",
"unsignedBinarySearch",
"(",
"final",
"ByteBuffer",
"array",
",",
"int",
"position",
",",
"final",
"int",
"begin",
",",
"final",
"int",
"end",
",",
"final",
"short",
"k",
")",
"{",
"return",
"branchyUnsignedBinarySearch",
"(",
"array... | Look for value k in buffer in the range [begin,end). If the value is found, return its index.
If not, return -(i+1) where i is the index where the value would be inserted. The buffer is
assumed to contain sorted values where shorts are interpreted as unsigned integers.
@param array buffer where we search
@param positi... | [
"Look",
"for",
"value",
"k",
"in",
"buffer",
"in",
"the",
"range",
"[",
"begin",
"end",
")",
".",
"If",
"the",
"value",
"is",
"found",
"return",
"its",
"index",
".",
"If",
"not",
"return",
"-",
"(",
"i",
"+",
"1",
")",
"where",
"i",
"is",
"the",
... | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/buffer/BufferUtil.java#L635-L638 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/mapping/MappingUtil.java | MappingUtil.fromType | public static JcPrimitive fromType(Class<?> type, String name) {
"""
Answer an appropriate instance of a JcPrimitive for the given simple-type and name.
E.g. given a type java.lang.String, a JcString instance will be returned.
@param type
@param name
@return
"""
// TODO what about dates and arrays
if (... | java | public static JcPrimitive fromType(Class<?> type, String name) {
// TODO what about dates and arrays
if (type.equals(String.class))
return new JcString(name);
else if (type.equals(Number.class))
return new JcNumber(name);
else if (type.equals(Boolean.class))
return new JcBoolean(name);
return null;
... | [
"public",
"static",
"JcPrimitive",
"fromType",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
")",
"{",
"// TODO what about dates and arrays",
"if",
"(",
"type",
".",
"equals",
"(",
"String",
".",
"class",
")",
")",
"return",
"new",
"JcString",
... | Answer an appropriate instance of a JcPrimitive for the given simple-type and name.
E.g. given a type java.lang.String, a JcString instance will be returned.
@param type
@param name
@return | [
"Answer",
"an",
"appropriate",
"instance",
"of",
"a",
"JcPrimitive",
"for",
"the",
"given",
"simple",
"-",
"type",
"and",
"name",
".",
"E",
".",
"g",
".",
"given",
"a",
"type",
"java",
".",
"lang",
".",
"String",
"a",
"JcString",
"instance",
"will",
"b... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/mapping/MappingUtil.java#L234-L243 |
kiegroup/drools | kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/decisiontables/DecisionTableImpl.java | DecisionTableImpl.defaultToOutput | private Object defaultToOutput(EvaluationContext ctx, FEEL feel) {
"""
No hits matched for the DT, so calculate result based on default outputs
"""
Map<String, Object> values = ctx.getAllValues();
if ( outputs.size() == 1 ) {
Object value = feel.evaluate( outputs.get( 0 ).getDefault... | java | private Object defaultToOutput(EvaluationContext ctx, FEEL feel) {
Map<String, Object> values = ctx.getAllValues();
if ( outputs.size() == 1 ) {
Object value = feel.evaluate( outputs.get( 0 ).getDefaultValue(), values );
return value;
} else {
// zip outputEnt... | [
"private",
"Object",
"defaultToOutput",
"(",
"EvaluationContext",
"ctx",
",",
"FEEL",
"feel",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
"=",
"ctx",
".",
"getAllValues",
"(",
")",
";",
"if",
"(",
"outputs",
".",
"size",
"(",
")",
"==... | No hits matched for the DT, so calculate result based on default outputs | [
"No",
"hits",
"matched",
"for",
"the",
"DT",
"so",
"calculate",
"result",
"based",
"on",
"default",
"outputs"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/decisiontables/DecisionTableImpl.java#L319-L329 |
selenide/selenide | src/main/java/com/codeborne/selenide/ElementsCollection.java | ElementsCollection.elementsToString | public static String elementsToString(Driver driver, Collection<WebElement> elements) {
"""
Outputs string presentation of the element's collection
@param elements
@return String
"""
if (elements == null) {
return "[not loaded yet...]";
}
if (elements.isEmpty()) {
return "[]";
}
... | java | public static String elementsToString(Driver driver, Collection<WebElement> elements) {
if (elements == null) {
return "[not loaded yet...]";
}
if (elements.isEmpty()) {
return "[]";
}
StringBuilder sb = new StringBuilder(256);
sb.append("[\n\t");
for (WebElement element : elem... | [
"public",
"static",
"String",
"elementsToString",
"(",
"Driver",
"driver",
",",
"Collection",
"<",
"WebElement",
">",
"elements",
")",
"{",
"if",
"(",
"elements",
"==",
"null",
")",
"{",
"return",
"\"[not loaded yet...]\"",
";",
"}",
"if",
"(",
"elements",
"... | Outputs string presentation of the element's collection
@param elements
@return String | [
"Outputs",
"string",
"presentation",
"of",
"the",
"element",
"s",
"collection"
] | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/ElementsCollection.java#L269-L288 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.newInstance | @SuppressWarnings("unchecked")
public static <T> T newInstance(Class<T> c, Object[] args) {
"""
Helper to construct a new instance from the given arguments.
The constructor is called based on the number and types in the
args array. Use <code>newInstance(null)</code> or simply
<code>newInstance()</code> for... | java | @SuppressWarnings("unchecked")
public static <T> T newInstance(Class<T> c, Object[] args) {
if (args == null) args = new Object[]{null};
return (T) InvokerHelper.invokeConstructorOf(c, args);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"T",
">",
"c",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
")",
"args",
"=",
"new",
"Objec... | Helper to construct a new instance from the given arguments.
The constructor is called based on the number and types in the
args array. Use <code>newInstance(null)</code> or simply
<code>newInstance()</code> for the default (no-arg) constructor.
@param c a class
@param args the constructor arguments
@return a new ... | [
"Helper",
"to",
"construct",
"a",
"new",
"instance",
"from",
"the",
"given",
"arguments",
".",
"The",
"constructor",
"is",
"called",
"based",
"on",
"the",
"number",
"and",
"types",
"in",
"the",
"args",
"array",
".",
"Use",
"<code",
">",
"newInstance",
"(",... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L17212-L17216 |
rsocket/rsocket-java | rsocket-core/src/main/java/io/rsocket/util/NumberUtils.java | NumberUtils.requirePositive | public static long requirePositive(long l, String message) {
"""
Requires that a {@code long} is greater than zero.
@param l the {@code long} to test
@param message detail message to be used in the event that a {@link IllegalArgumentException}
is thrown
@return the {@code long} if greater than zero
@throws ... | java | public static long requirePositive(long l, String message) {
Objects.requireNonNull(message, "message must not be null");
if (l <= 0) {
throw new IllegalArgumentException(message);
}
return l;
} | [
"public",
"static",
"long",
"requirePositive",
"(",
"long",
"l",
",",
"String",
"message",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"message",
",",
"\"message must not be null\"",
")",
";",
"if",
"(",
"l",
"<=",
"0",
")",
"{",
"throw",
"new",
"Ille... | Requires that a {@code long} is greater than zero.
@param l the {@code long} to test
@param message detail message to be used in the event that a {@link IllegalArgumentException}
is thrown
@return the {@code long} if greater than zero
@throws IllegalArgumentException if {@code l} is less than or equal to zero | [
"Requires",
"that",
"a",
"{",
"@code",
"long",
"}",
"is",
"greater",
"than",
"zero",
"."
] | train | https://github.com/rsocket/rsocket-java/blob/5101748fbd224ec86570351cebd24d079b63fbfc/rsocket-core/src/main/java/io/rsocket/util/NumberUtils.java#L68-L76 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.enableRequestResponseLogging | public void enableRequestResponseLogging(Logger logger, Level level, int maxEntitySize) {
"""
Enable the logging of the requests to and the responses from the GitLab server API using the
specified logger. Logging will mask PRIVATE-TOKEN and Authorization headers.
@param logger the Logger instance to log to
@p... | java | public void enableRequestResponseLogging(Logger logger, Level level, int maxEntitySize) {
enableRequestResponseLogging(logger, level, maxEntitySize, MaskingLoggingFilter.DEFAULT_MASKED_HEADER_NAMES);
} | [
"public",
"void",
"enableRequestResponseLogging",
"(",
"Logger",
"logger",
",",
"Level",
"level",
",",
"int",
"maxEntitySize",
")",
"{",
"enableRequestResponseLogging",
"(",
"logger",
",",
"level",
",",
"maxEntitySize",
",",
"MaskingLoggingFilter",
".",
"DEFAULT_MASKE... | Enable the logging of the requests to and the responses from the GitLab server API using the
specified logger. Logging will mask PRIVATE-TOKEN and Authorization headers.
@param logger the Logger instance to log to
@param level the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
@param maxEntitySize ... | [
"Enable",
"the",
"logging",
"of",
"the",
"requests",
"to",
"and",
"the",
"responses",
"from",
"the",
"GitLab",
"server",
"API",
"using",
"the",
"specified",
"logger",
".",
"Logging",
"will",
"mask",
"PRIVATE",
"-",
"TOKEN",
"and",
"Authorization",
"headers",
... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L667-L669 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.checkNotEmpty | @Conditioned
@Time(name = " {
"""
Generic method to check that the value given in parameters is not empty.
A first research is made from {@link com.github.noraui.gherkin.ScenarioRegistry} to retrieve value if a key is provided.
@param data
Name of the value to check
@param textOrKey
Is the new data (te... | java | @Conditioned
@Time(name = "{textOrKey}")
@Lorsque("Je vérifie que (.*) '(.*)' n'est pas vide[\\.|\\?]")
@Given("I check that (.*) '(.*)' is not empty[\\.|\\?]")
public void checkNotEmpty(String data, @TimeName("textOrKey") String textOrKey, List<GherkinStepCondition> conditions) throws TechnicalExce... | [
"@",
"Conditioned",
"@",
"Time",
"(",
"name",
"=",
"\"{textOrKey}\"",
")",
"@",
"Lorsque",
"(",
"\"Je vérifie que (.*) '(.*)' n'est pas vide[\\\\.|\\\\?]\")",
"\r",
"@",
"Given",
"(",
"\"I check that (.*) '(.*)' is not empty[\\\\.|\\\\?]\"",
")",
"public",
"void",
"checkNot... | Generic method to check that the value given in parameters is not empty.
A first research is made from {@link com.github.noraui.gherkin.ScenarioRegistry} to retrieve value if a key is provided.
@param data
Name of the value to check
@param textOrKey
Is the new data (text or text in context (after a save))
@param condi... | [
"Generic",
"method",
"to",
"check",
"that",
"the",
"value",
"given",
"in",
"parameters",
"is",
"not",
"empty",
".",
"A",
"first",
"research",
"is",
"made",
"from",
"{",
"@link",
"com",
".",
"github",
".",
"noraui",
".",
"gherkin",
".",
"ScenarioRegistry",
... | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L224-L235 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/SocketInterceptorConfig.java | SocketInterceptorConfig.setProperty | public SocketInterceptorConfig setProperty(String name, String value) {
"""
Sets a property.
@param name the name of the property to set
@param value the value of the property to set
@return the updated SocketInterceptorConfig
@throws NullPointerException if name or value is {@code null}
"""
pro... | java | public SocketInterceptorConfig setProperty(String name, String value) {
properties.put(name, value);
return this;
} | [
"public",
"SocketInterceptorConfig",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"properties",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets a property.
@param name the name of the property to set
@param value the value of the property to set
@return the updated SocketInterceptorConfig
@throws NullPointerException if name or value is {@code null} | [
"Sets",
"a",
"property",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/SocketInterceptorConfig.java#L108-L111 |
googlegenomics/utils-java | src/main/java/com/google/cloud/genomics/utils/grpc/VariantUtils.java | VariantUtils.isOverlapping | public static boolean isOverlapping(Variant blockRecord, Variant.Builder variant) {
"""
Determine whether the first variant overlaps the second variant.
This is particularly useful when determining whether a non-variant segment overlaps a variant.
@param blockRecord
@param variant
@return true, if the firs... | java | public static boolean isOverlapping(Variant blockRecord, Variant.Builder variant) {
return blockRecord.getStart() <= variant.getStart()
&& blockRecord.getEnd() >= variant.getStart() + 1;
} | [
"public",
"static",
"boolean",
"isOverlapping",
"(",
"Variant",
"blockRecord",
",",
"Variant",
".",
"Builder",
"variant",
")",
"{",
"return",
"blockRecord",
".",
"getStart",
"(",
")",
"<=",
"variant",
".",
"getStart",
"(",
")",
"&&",
"blockRecord",
".",
"get... | Determine whether the first variant overlaps the second variant.
This is particularly useful when determining whether a non-variant segment overlaps a variant.
@param blockRecord
@param variant
@return true, if the first variant overlaps the second variant | [
"Determine",
"whether",
"the",
"first",
"variant",
"overlaps",
"the",
"second",
"variant",
"."
] | train | https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/grpc/VariantUtils.java#L246-L249 |
febit/wit | wit-core/src/main/java/org/febit/wit/Engine.java | Engine.getTemplate | public Template getTemplate(final String parentName, final String name) throws ResourceNotFoundException {
"""
get template by parent template's name and it's relative name.
@param parentName parent template's name
@param name template's relative name
@return Template
@throws ResourceNotFoundException ... | java | public Template getTemplate(final String parentName, final String name) throws ResourceNotFoundException {
return getTemplate(this.loader.concat(parentName, name));
} | [
"public",
"Template",
"getTemplate",
"(",
"final",
"String",
"parentName",
",",
"final",
"String",
"name",
")",
"throws",
"ResourceNotFoundException",
"{",
"return",
"getTemplate",
"(",
"this",
".",
"loader",
".",
"concat",
"(",
"parentName",
",",
"name",
")",
... | get template by parent template's name and it's relative name.
@param parentName parent template's name
@param name template's relative name
@return Template
@throws ResourceNotFoundException if resource not found | [
"get",
"template",
"by",
"parent",
"template",
"s",
"name",
"and",
"it",
"s",
"relative",
"name",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit/Engine.java#L66-L68 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/content/CmsXmlContentRepairDialog.java | CmsXmlContentRepairDialog.getXmlContentResourceTypes | private List getXmlContentResourceTypes() {
"""
Returns the selector widget options to build a XML content resource type selector widget.<p>
@return the selector widget options to build a XML content resource type selector widget
"""
// get all available resource types and filter XML content resour... | java | private List getXmlContentResourceTypes() {
// get all available resource types and filter XML content resource types
List resTypes = OpenCms.getResourceManager().getResourceTypes();
Iterator i = resTypes.iterator();
List resTypeNames = new ArrayList(resTypes.size());
while (i.h... | [
"private",
"List",
"getXmlContentResourceTypes",
"(",
")",
"{",
"// get all available resource types and filter XML content resource types",
"List",
"resTypes",
"=",
"OpenCms",
".",
"getResourceManager",
"(",
")",
".",
"getResourceTypes",
"(",
")",
";",
"Iterator",
"i",
"... | Returns the selector widget options to build a XML content resource type selector widget.<p>
@return the selector widget options to build a XML content resource type selector widget | [
"Returns",
"the",
"selector",
"widget",
"options",
"to",
"build",
"a",
"XML",
"content",
"resource",
"type",
"selector",
"widget",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/content/CmsXmlContentRepairDialog.java#L253-L292 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/tlv/TLVElement.java | TLVElement.encodeHeader | public byte[] encodeHeader() throws TLVParserException {
"""
Encodes TLV header.
@return Byte array containing encoded TLV header.
@throws TLVParserException
when TLV header encoding fails or I/O error occurs.
"""
DataOutputStream out = null;
try {
ByteArrayOutputStream byteA... | java | public byte[] encodeHeader() throws TLVParserException {
DataOutputStream out = null;
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
out = new DataOutputStream(byteArrayOutputStream);
int dataLength = getContentLength();
... | [
"public",
"byte",
"[",
"]",
"encodeHeader",
"(",
")",
"throws",
"TLVParserException",
"{",
"DataOutputStream",
"out",
"=",
"null",
";",
"try",
"{",
"ByteArrayOutputStream",
"byteArrayOutputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"out",
"=",
... | Encodes TLV header.
@return Byte array containing encoded TLV header.
@throws TLVParserException
when TLV header encoding fails or I/O error occurs. | [
"Encodes",
"TLV",
"header",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/tlv/TLVElement.java#L484-L520 |
GCRC/nunaliit | nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/StreamUtils.java | StreamUtils.copyStream | static public void copyStream(Reader reader, Writer writer) throws IOException {
"""
Copy all the characters from a reader to a writer.
@param reader Input character stream
@param writer Output character stream
@throws IOException
"""
copyStream(reader, writer, DEFAULT_TRANSFER_BUFFER_SIZE);
} | java | static public void copyStream(Reader reader, Writer writer) throws IOException {
copyStream(reader, writer, DEFAULT_TRANSFER_BUFFER_SIZE);
} | [
"static",
"public",
"void",
"copyStream",
"(",
"Reader",
"reader",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"copyStream",
"(",
"reader",
",",
"writer",
",",
"DEFAULT_TRANSFER_BUFFER_SIZE",
")",
";",
"}"
] | Copy all the characters from a reader to a writer.
@param reader Input character stream
@param writer Output character stream
@throws IOException | [
"Copy",
"all",
"the",
"characters",
"from",
"a",
"reader",
"to",
"a",
"writer",
"."
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/StreamUtils.java#L52-L54 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.addOutline | public void addOutline(PdfOutline outline, String name) {
"""
Adds a named outline to the document.
@param outline the outline
@param name the name for the local destination
"""
checkWriter();
pdf.addOutline(outline, name);
} | java | public void addOutline(PdfOutline outline, String name) {
checkWriter();
pdf.addOutline(outline, name);
} | [
"public",
"void",
"addOutline",
"(",
"PdfOutline",
"outline",
",",
"String",
"name",
")",
"{",
"checkWriter",
"(",
")",
";",
"pdf",
".",
"addOutline",
"(",
"outline",
",",
"name",
")",
";",
"}"
] | Adds a named outline to the document.
@param outline the outline
@param name the name for the local destination | [
"Adds",
"a",
"named",
"outline",
"to",
"the",
"document",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L1652-L1655 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/util/RunMode.java | RunMode.disableIfNoRunModeActive | @Deprecated
public static boolean disableIfNoRunModeActive(Set<String> runModes, String[] allowedRunModes,
ComponentContext componentContext, Logger log) {
"""
Use this to disable a component if none of its run modes are active. Component activation status is logged
with DEBUG level.
This method is a rep... | java | @Deprecated
public static boolean disableIfNoRunModeActive(Set<String> runModes, String[] allowedRunModes,
ComponentContext componentContext, Logger log) {
final String name = (String)componentContext.getProperties().get(ComponentConstants.COMPONENT_NAME);
boolean result = false;
boolean isActive ... | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"disableIfNoRunModeActive",
"(",
"Set",
"<",
"String",
">",
"runModes",
",",
"String",
"[",
"]",
"allowedRunModes",
",",
"ComponentContext",
"componentContext",
",",
"Logger",
"log",
")",
"{",
"final",
"String",
... | Use this to disable a component if none of its run modes are active. Component activation status is logged
with DEBUG level.
This method is a replacement for the
<code>com.day.cq.commons.RunModeUtil#disableIfNoRunModeActive(RunMode, String[], ComponentContext, Logger)</code>
method which is deprecated.
@param runModes ... | [
"Use",
"this",
"to",
"disable",
"a",
"component",
"if",
"none",
"of",
"its",
"run",
"modes",
"are",
"active",
".",
"Component",
"activation",
"status",
"is",
"logged",
"with",
"DEBUG",
"level",
".",
"This",
"method",
"is",
"a",
"replacement",
"for",
"the",... | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/util/RunMode.java#L116-L148 |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/util/ADTUtil.java | ADTUtil.computeEffectiveResets | public static <S, I, O> int computeEffectiveResets(final ADTNode<S, I, O> adt) {
"""
Computes how often reset nodes are encountered when traversing from the given node to the leaves of the induced
subtree of the given node.
@param adt
the node whose subtree should be analyzed
@param <S>
(hypothesis) state t... | java | public static <S, I, O> int computeEffectiveResets(final ADTNode<S, I, O> adt) {
return computeEffectiveResetsInternal(adt, 0);
} | [
"public",
"static",
"<",
"S",
",",
"I",
",",
"O",
">",
"int",
"computeEffectiveResets",
"(",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"adt",
")",
"{",
"return",
"computeEffectiveResetsInternal",
"(",
"adt",
",",
"0",
")",
";",
"}"
] | Computes how often reset nodes are encountered when traversing from the given node to the leaves of the induced
subtree of the given node.
@param adt
the node whose subtree should be analyzed
@param <S>
(hypothesis) state type
@param <I>
input alphabet type
@param <O>
output alphabet type
@return the number of encoun... | [
"Computes",
"how",
"often",
"reset",
"nodes",
"are",
"encountered",
"when",
"traversing",
"from",
"the",
"given",
"node",
"to",
"the",
"leaves",
"of",
"the",
"induced",
"subtree",
"of",
"the",
"given",
"node",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/util/ADTUtil.java#L218-L220 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/Img.java | Img.pressImage | public Img pressImage(Image pressImg, int x, int y, float alpha) {
"""
给图片添加图片水印
@param pressImg 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移量相对于中间偏移
@param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字
@return this
"""
final int pressImgWidth = ... | java | public Img pressImage(Image pressImg, int x, int y, float alpha) {
final int pressImgWidth = pressImg.getWidth(null);
final int pressImgHeight = pressImg.getHeight(null);
return pressImage(pressImg, new Rectangle(x, y, pressImgWidth, pressImgHeight), alpha);
} | [
"public",
"Img",
"pressImage",
"(",
"Image",
"pressImg",
",",
"int",
"x",
",",
"int",
"y",
",",
"float",
"alpha",
")",
"{",
"final",
"int",
"pressImgWidth",
"=",
"pressImg",
".",
"getWidth",
"(",
"null",
")",
";",
"final",
"int",
"pressImgHeight",
"=",
... | 给图片添加图片水印
@param pressImg 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移量相对于中间偏移
@param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字
@return this | [
"给图片添加图片水印"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/Img.java#L433-L438 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/ReturnUrl.java | ReturnUrl.getReturnItemUrl | public static MozuUrl getReturnItemUrl(String responseFields, String returnId, String returnItemId) {
"""
Get Resource Url for GetReturnItem
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used t... | java | public static MozuUrl getReturnItemUrl(String responseFields, String returnId, String returnItemId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/{returnId}/items/{returnItemId}?responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl(... | [
"public",
"static",
"MozuUrl",
"getReturnItemUrl",
"(",
"String",
"responseFields",
",",
"String",
"returnId",
",",
"String",
"returnItemId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/returns/{returnId}/items/{returnItemId}?res... | Get Resource Url for GetReturnItem
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@param returnId Unique iden... | [
"Get",
"Resource",
"Url",
"for",
"GetReturnItem"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/ReturnUrl.java#L57-L64 |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/evaluator/Evaluator.java | Evaluator.evaluateExpression | public Object evaluateExpression(String expression, EvaluationContext context) throws EvaluationError {
"""
Evaluates a single expression, e.g. "contact.reports * 2"
@param expression the expression string
@param context the evaluation context
@return the evaluated expression value
@throws EvaluationError if a... | java | public Object evaluateExpression(String expression, EvaluationContext context) throws EvaluationError {
return evaluateExpression(expression, context, EvaluationStrategy.COMPLETE);
} | [
"public",
"Object",
"evaluateExpression",
"(",
"String",
"expression",
",",
"EvaluationContext",
"context",
")",
"throws",
"EvaluationError",
"{",
"return",
"evaluateExpression",
"(",
"expression",
",",
"context",
",",
"EvaluationStrategy",
".",
"COMPLETE",
")",
";",
... | Evaluates a single expression, e.g. "contact.reports * 2"
@param expression the expression string
@param context the evaluation context
@return the evaluated expression value
@throws EvaluationError if an error occurs during evaluation | [
"Evaluates",
"a",
"single",
"expression",
"e",
".",
"g",
".",
"contact",
".",
"reports",
"*",
"2"
] | train | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/evaluator/Evaluator.java#L230-L232 |
infinispan/infinispan | core/src/main/java/org/infinispan/metadata/Metadatas.java | Metadatas.applyVersion | public static Metadata applyVersion(Metadata source, Metadata target) {
"""
Applies version in source metadata to target metadata, if no version
in target metadata. This method can be useful in scenarios where source
version information must be kept around, i.e. write skew, or when
reading metadata from cache s... | java | public static Metadata applyVersion(Metadata source, Metadata target) {
if (target.version() == null && source.version() != null)
return target.builder().version(source.version()).build();
return target;
} | [
"public",
"static",
"Metadata",
"applyVersion",
"(",
"Metadata",
"source",
",",
"Metadata",
"target",
")",
"{",
"if",
"(",
"target",
".",
"version",
"(",
")",
"==",
"null",
"&&",
"source",
".",
"version",
"(",
")",
"!=",
"null",
")",
"return",
"target",
... | Applies version in source metadata to target metadata, if no version
in target metadata. This method can be useful in scenarios where source
version information must be kept around, i.e. write skew, or when
reading metadata from cache store.
@param source Metadata object which is source, whose version might be
is of i... | [
"Applies",
"version",
"in",
"source",
"metadata",
"to",
"target",
"metadata",
"if",
"no",
"version",
"in",
"target",
"metadata",
".",
"This",
"method",
"can",
"be",
"useful",
"in",
"scenarios",
"where",
"source",
"version",
"information",
"must",
"be",
"kept",... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/metadata/Metadatas.java#L29-L34 |
Scout24/appmon4j | core/src/main/java/de/is24/util/monitoring/Math.java | Math.stdDeviation | public static double stdDeviation(final long n, final double sum, final double sumOfSquares) {
"""
Calculate the standard deviation from an amount of values n, a sum and a sum of squares.
@param n the number of values measured.
@param sum the total sum of values measured.
@param sumOfSquares the total sum of ... | java | public static double stdDeviation(final long n, final double sum, final double sumOfSquares) {
double stdDev = 0;
if (n > 1) { // std deviation for 1 entry is 0 by definition
final double numerator = sumOfSquares - ((sum * sum) / n);
stdDev = java.lang.Math.sqrt(numerator / (n - 1));
}
... | [
"public",
"static",
"double",
"stdDeviation",
"(",
"final",
"long",
"n",
",",
"final",
"double",
"sum",
",",
"final",
"double",
"sumOfSquares",
")",
"{",
"double",
"stdDev",
"=",
"0",
";",
"if",
"(",
"n",
">",
"1",
")",
"{",
"// std deviation for 1 entry i... | Calculate the standard deviation from an amount of values n, a sum and a sum of squares.
@param n the number of values measured.
@param sum the total sum of values measured.
@param sumOfSquares the total sum of squares of the values measured.
@return the standard deviation of a number of values. | [
"Calculate",
"the",
"standard",
"deviation",
"from",
"an",
"amount",
"of",
"values",
"n",
"a",
"sum",
"and",
"a",
"sum",
"of",
"squares",
"."
] | train | https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/Math.java#L41-L49 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java | SnowflakeStatementV1.executeQueryInternal | ResultSet executeQueryInternal(
String sql,
Map<String, ParameterBindingDTO> parameterBindings)
throws SQLException {
"""
Internal method for executing a query with bindings accepted.
@param sql sql statement
@param parameterBindings parameters bindings
@return query result set
@t... | java | ResultSet executeQueryInternal(
String sql,
Map<String, ParameterBindingDTO> parameterBindings)
throws SQLException
{
SFBaseResultSet sfResultSet;
try
{
sfResultSet = sfStatement.execute(sql, parameterBindings,
SFStatement.CallingMethod.EXECUTE_Q... | [
"ResultSet",
"executeQueryInternal",
"(",
"String",
"sql",
",",
"Map",
"<",
"String",
",",
"ParameterBindingDTO",
">",
"parameterBindings",
")",
"throws",
"SQLException",
"{",
"SFBaseResultSet",
"sfResultSet",
";",
"try",
"{",
"sfResultSet",
"=",
"sfStatement",
".",... | Internal method for executing a query with bindings accepted.
@param sql sql statement
@param parameterBindings parameters bindings
@return query result set
@throws SQLException if @link{SFStatement.execute(String)} throws exception | [
"Internal",
"method",
"for",
"executing",
"a",
"query",
"with",
"bindings",
"accepted",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java#L232-L257 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ClassGenericsUtil.java | ClassGenericsUtil.tryInstantiate | public static <C> C tryInstantiate(Class<C> r, Class<?> c, Parameterization config) throws ClassInstantiationException {
"""
Instantiate a parameterizable class. When using this, consider using
{@link Parameterization#descend}!
@param <C> base type
@param r Base (restriction) class
@param c Class to instanti... | java | public static <C> C tryInstantiate(Class<C> r, Class<?> c, Parameterization config) throws ClassInstantiationException {
if(c == null) {
throw new ClassInstantiationException("Trying to instantiate 'null' class!");
}
try {
// Try a V3 parameterization class
Parameterizer par = getParameter... | [
"public",
"static",
"<",
"C",
">",
"C",
"tryInstantiate",
"(",
"Class",
"<",
"C",
">",
"r",
",",
"Class",
"<",
"?",
">",
"c",
",",
"Parameterization",
"config",
")",
"throws",
"ClassInstantiationException",
"{",
"if",
"(",
"c",
"==",
"null",
")",
"{",
... | Instantiate a parameterizable class. When using this, consider using
{@link Parameterization#descend}!
@param <C> base type
@param r Base (restriction) class
@param c Class to instantiate
@param config Configuration to use for instantiation.
@return Instance
@throws ClassInstantiationException When a class cannot be i... | [
"Instantiate",
"a",
"parameterizable",
"class",
".",
"When",
"using",
"this",
"consider",
"using",
"{",
"@link",
"Parameterization#descend",
"}",
"!"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ClassGenericsUtil.java#L170-L187 |
WASdev/ci.maven | liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/utils/MavenProjectUtil.java | MavenProjectUtil.getPluginGoalExecution | public static PluginExecution getPluginGoalExecution(Plugin plugin, String goal) throws PluginScenarioException {
"""
Get an execution of a plugin
@param plugin
@param goal
@return the execution object
@throws PluginScenarioException
"""
List<PluginExecution> executions = plugin.getExecutions();
... | java | public static PluginExecution getPluginGoalExecution(Plugin plugin, String goal) throws PluginScenarioException {
List<PluginExecution> executions = plugin.getExecutions();
for(Iterator<PluginExecution> iterator = executions.iterator(); iterator.hasNext();) {
PluginExecution executi... | [
"public",
"static",
"PluginExecution",
"getPluginGoalExecution",
"(",
"Plugin",
"plugin",
",",
"String",
"goal",
")",
"throws",
"PluginScenarioException",
"{",
"List",
"<",
"PluginExecution",
">",
"executions",
"=",
"plugin",
".",
"getExecutions",
"(",
")",
";",
"... | Get an execution of a plugin
@param plugin
@param goal
@return the execution object
@throws PluginScenarioException | [
"Get",
"an",
"execution",
"of",
"a",
"plugin"
] | train | https://github.com/WASdev/ci.maven/blob/4fcf2d314299a4c02e2c740e4fc99a4f6aba6918/liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/utils/MavenProjectUtil.java#L80-L90 |
vkostyukov/la4j | src/main/java/org/la4j/Matrices.java | Matrices.asSumFunctionAccumulator | public static MatrixAccumulator asSumFunctionAccumulator(final double neutral, final MatrixFunction function) {
"""
Creates a sum function accumulator, that calculates the sum of all
elements in the matrix after applying given {@code function} to each of them.
@param neutral the neutral value
@param function ... | java | public static MatrixAccumulator asSumFunctionAccumulator(final double neutral, final MatrixFunction function) {
return new MatrixAccumulator() {
private final MatrixAccumulator sumAccumulator = Matrices.asSumAccumulator(neutral);
@Override
public void update(int i, int j, do... | [
"public",
"static",
"MatrixAccumulator",
"asSumFunctionAccumulator",
"(",
"final",
"double",
"neutral",
",",
"final",
"MatrixFunction",
"function",
")",
"{",
"return",
"new",
"MatrixAccumulator",
"(",
")",
"{",
"private",
"final",
"MatrixAccumulator",
"sumAccumulator",
... | Creates a sum function accumulator, that calculates the sum of all
elements in the matrix after applying given {@code function} to each of them.
@param neutral the neutral value
@param function the matrix function
@return a sum function accumulator | [
"Creates",
"a",
"sum",
"function",
"accumulator",
"that",
"calculates",
"the",
"sum",
"of",
"all",
"elements",
"in",
"the",
"matrix",
"after",
"applying",
"given",
"{",
"@code",
"function",
"}",
"to",
"each",
"of",
"them",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrices.java#L692-L706 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.getImpersonationToken | public ImpersonationToken getImpersonationToken(Object userIdOrUsername, Integer tokenId) throws GitLabApiException {
"""
Get an impersonation token of a user. Available only for admin users.
<pre><code>GitLab Endpoint: GET /users/:user_id/impersonation_tokens/:impersonation_token_id</code></pre>
@param use... | java | public ImpersonationToken getImpersonationToken(Object userIdOrUsername, Integer tokenId) throws GitLabApiException {
if (tokenId == null) {
throw new RuntimeException("tokenId cannot be null");
}
Response response = get(Response.Status.OK, null, "users", getUserIdOrUsername(userId... | [
"public",
"ImpersonationToken",
"getImpersonationToken",
"(",
"Object",
"userIdOrUsername",
",",
"Integer",
"tokenId",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"tokenId",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"tokenId cannot be... | Get an impersonation token of a user. Available only for admin users.
<pre><code>GitLab Endpoint: GET /users/:user_id/impersonation_tokens/:impersonation_token_id</code></pre>
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param tokenId the impersonation token ID ... | [
"Get",
"an",
"impersonation",
"token",
"of",
"a",
"user",
".",
"Available",
"only",
"for",
"admin",
"users",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L768-L776 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/util/ReflectionUtils.java | ReflectionUtils.invokeJdbcMethod | public static Object invokeJdbcMethod(Method method, Object target) throws SQLException {
"""
Invoke the specified JDBC API {@link Method} against the supplied target
object with no arguments.
@param method the method to invoke
@param target the target object to invoke the method on
@return the invocation resu... | java | public static Object invokeJdbcMethod(Method method, Object target) throws SQLException {
return invokeJdbcMethod(method, target, new Object[0]);
} | [
"public",
"static",
"Object",
"invokeJdbcMethod",
"(",
"Method",
"method",
",",
"Object",
"target",
")",
"throws",
"SQLException",
"{",
"return",
"invokeJdbcMethod",
"(",
"method",
",",
"target",
",",
"new",
"Object",
"[",
"0",
"]",
")",
";",
"}"
] | Invoke the specified JDBC API {@link Method} against the supplied target
object with no arguments.
@param method the method to invoke
@param target the target object to invoke the method on
@return the invocation result, if any
@throws SQLException the JDBC API SQLException to rethrow (if any)
@see #invokeJdbcMethod(ja... | [
"Invoke",
"the",
"specified",
"JDBC",
"API",
"{"
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/ReflectionUtils.java#L214-L216 |
zxing/zxing | core/src/main/java/com/google/zxing/pdf417/PDF417Writer.java | PDF417Writer.bitMatrixFromBitArray | private static BitMatrix bitMatrixFromBitArray(byte[][] input, int margin) {
"""
This takes an array holding the values of the PDF 417
@param input a byte array of information with 0 is black, and 1 is white
@param margin border around the barcode
@return BitMatrix of the input
"""
// Creates the bit ... | java | private static BitMatrix bitMatrixFromBitArray(byte[][] input, int margin) {
// Creates the bit matrix with extra space for whitespace
BitMatrix output = new BitMatrix(input[0].length + 2 * margin, input.length + 2 * margin);
output.clear();
for (int y = 0, yOutput = output.getHeight() - margin - 1; y <... | [
"private",
"static",
"BitMatrix",
"bitMatrixFromBitArray",
"(",
"byte",
"[",
"]",
"[",
"]",
"input",
",",
"int",
"margin",
")",
"{",
"// Creates the bit matrix with extra space for whitespace",
"BitMatrix",
"output",
"=",
"new",
"BitMatrix",
"(",
"input",
"[",
"0",
... | This takes an array holding the values of the PDF 417
@param input a byte array of information with 0 is black, and 1 is white
@param margin border around the barcode
@return BitMatrix of the input | [
"This",
"takes",
"an",
"array",
"holding",
"the",
"values",
"of",
"the",
"PDF",
"417"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/pdf417/PDF417Writer.java#L145-L159 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/logging/MdcInjectionFilter.java | MdcInjectionFilter.setProperty | public static void setProperty(IoSession session, String key, String value) {
"""
Add a property to the context for the given session
This property will be added to the MDC for all subsequent events
@param session The session for which you want to set a property
@param key The name of the property (should not ... | java | public static void setProperty(IoSession session, String key, String value) {
if (key == null) {
throw new NullPointerException("key should not be null");
}
if (value == null) {
removeProperty(session, key);
}
Map<String, String> context = getContext(sessi... | [
"public",
"static",
"void",
"setProperty",
"(",
"IoSession",
"session",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"key should not be null\"",
")",
";",
"}"... | Add a property to the context for the given session
This property will be added to the MDC for all subsequent events
@param session The session for which you want to set a property
@param key The name of the property (should not be null)
@param value The value of the property | [
"Add",
"a",
"property",
"to",
"the",
"context",
"for",
"the",
"given",
"session",
"This",
"property",
"will",
"be",
"added",
"to",
"the",
"MDC",
"for",
"all",
"subsequent",
"events"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/logging/MdcInjectionFilter.java#L229-L239 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/core/DJJRDesignHelper.java | DJJRDesignHelper.populateReportOptionsFromDesign | protected static void populateReportOptionsFromDesign(DynamicJasperDesign jd, DynamicReport dr) {
"""
Because all the layout calculations are made from the Domain Model of DynamicJasper, when loading
a template file, we have to populate the "ReportOptions" with the settings from the template file (ie: margins, et... | java | protected static void populateReportOptionsFromDesign(DynamicJasperDesign jd, DynamicReport dr) {
DynamicReportOptions options = dr.getOptions();
options.setBottomMargin(jd.getBottomMargin());
options.setTopMargin(jd.getTopMargin());
options.setLeftMargin(jd.getLeftMargin());
op... | [
"protected",
"static",
"void",
"populateReportOptionsFromDesign",
"(",
"DynamicJasperDesign",
"jd",
",",
"DynamicReport",
"dr",
")",
"{",
"DynamicReportOptions",
"options",
"=",
"dr",
".",
"getOptions",
"(",
")",
";",
"options",
".",
"setBottomMargin",
"(",
"jd",
... | Because all the layout calculations are made from the Domain Model of DynamicJasper, when loading
a template file, we have to populate the "ReportOptions" with the settings from the template file (ie: margins, etc)
@param jd
@param dr | [
"Because",
"all",
"the",
"layout",
"calculations",
"are",
"made",
"from",
"the",
"Domain",
"Model",
"of",
"DynamicJasper",
"when",
"loading",
"a",
"template",
"file",
"we",
"have",
"to",
"populate",
"the",
"ReportOptions",
"with",
"the",
"settings",
"from",
"t... | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/core/DJJRDesignHelper.java#L257-L283 |
pravega/pravega | common/src/main/java/io/pravega/common/util/BitConverter.java | BitConverter.readUUID | public static UUID readUUID(ArrayView source, int position) {
"""
Reads a 128-bit UUID from the given ArrayView starting at the given position.
@param source The ArrayView to read from.
@param position The position in the ArrayView to start reading at.
@return The read UUID.
"""
long msb = readL... | java | public static UUID readUUID(ArrayView source, int position) {
long msb = readLong(source, position);
long lsb = readLong(source, position + Long.BYTES);
return new UUID(msb, lsb);
} | [
"public",
"static",
"UUID",
"readUUID",
"(",
"ArrayView",
"source",
",",
"int",
"position",
")",
"{",
"long",
"msb",
"=",
"readLong",
"(",
"source",
",",
"position",
")",
";",
"long",
"lsb",
"=",
"readLong",
"(",
"source",
",",
"position",
"+",
"Long",
... | Reads a 128-bit UUID from the given ArrayView starting at the given position.
@param source The ArrayView to read from.
@param position The position in the ArrayView to start reading at.
@return The read UUID. | [
"Reads",
"a",
"128",
"-",
"bit",
"UUID",
"from",
"the",
"given",
"ArrayView",
"starting",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L216-L220 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ContextServiceImpl.java | ContextServiceImpl.ignoreWarnOrFail | private <T extends Throwable> T ignoreWarnOrFail(Throwable throwable, final Class<T> exceptionClassToRaise, String msgKey, Object... objs) {
"""
Ignore, warn, or fail when a configuration error occurs.
This is copied from Tim's code in tWAS and updated slightly to
override with the Liberty ignore/warn/fail setti... | java | private <T extends Throwable> T ignoreWarnOrFail(Throwable throwable, final Class<T> exceptionClassToRaise, String msgKey, Object... objs) {
// Read the value each time in order to allow for changes to the onError setting
switch ((OnError) properties.get(OnErrorUtil.CFG_KEY_ON_ERROR)) {
cas... | [
"private",
"<",
"T",
"extends",
"Throwable",
">",
"T",
"ignoreWarnOrFail",
"(",
"Throwable",
"throwable",
",",
"final",
"Class",
"<",
"T",
">",
"exceptionClassToRaise",
",",
"String",
"msgKey",
",",
"Object",
"...",
"objs",
")",
"{",
"// Read the value each time... | Ignore, warn, or fail when a configuration error occurs.
This is copied from Tim's code in tWAS and updated slightly to
override with the Liberty ignore/warn/fail setting.
Precondition: invoker must have lock on this context service, in order to read the onError property.
@param throwable an already created Throwable ... | [
"Ignore",
"warn",
"or",
"fail",
"when",
"a",
"configuration",
"error",
"occurs",
".",
"This",
"is",
"copied",
"from",
"Tim",
"s",
"code",
"in",
"tWAS",
"and",
"updated",
"slightly",
"to",
"override",
"with",
"the",
"Liberty",
"ignore",
"/",
"warn",
"/",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ContextServiceImpl.java#L500-L536 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/ReadOnlyRecordHandler.java | ReadOnlyRecordHandler.init | public void init(Record record, BaseField field, boolean bNewOnChange) {
"""
Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param iMainFilesField The sequence of the date changed field in this record.
@param field The date changed field in this record.
@par... | java | public void init(Record record, BaseField field, boolean bNewOnChange)
{
super.init(record);
m_field = field;
m_bNewOnChange = bNewOnChange;
} | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"BaseField",
"field",
",",
"boolean",
"bNewOnChange",
")",
"{",
"super",
".",
"init",
"(",
"record",
")",
";",
"m_field",
"=",
"field",
";",
"m_bNewOnChange",
"=",
"bNewOnChange",
";",
"}"
] | Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param iMainFilesField The sequence of the date changed field in this record.
@param field The date changed field in this record.
@param bNewOnChange If true, create a new record on change. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/ReadOnlyRecordHandler.java#L76-L81 |
jayantk/jklol | src/com/jayantkrish/jklol/util/IoUtils.java | IoUtils.serializeObjectToFile | public static void serializeObjectToFile(Object object, String filename) {
"""
Serializes {@code object} into {@code filename}.
@param filename
@param object
"""
FileOutputStream fos = null;
ObjectOutputStream out = null;
try {
fos = new FileOutputStream(filename);
out = new ObjectO... | java | public static void serializeObjectToFile(Object object, String filename) {
FileOutputStream fos = null;
ObjectOutputStream out = null;
try {
fos = new FileOutputStream(filename);
out = new ObjectOutputStream(fos);
out.writeObject(object);
out.close();
} catch(IOException ex) {
... | [
"public",
"static",
"void",
"serializeObjectToFile",
"(",
"Object",
"object",
",",
"String",
"filename",
")",
"{",
"FileOutputStream",
"fos",
"=",
"null",
";",
"ObjectOutputStream",
"out",
"=",
"null",
";",
"try",
"{",
"fos",
"=",
"new",
"FileOutputStream",
"(... | Serializes {@code object} into {@code filename}.
@param filename
@param object | [
"Serializes",
"{",
"@code",
"object",
"}",
"into",
"{",
"@code",
"filename",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IoUtils.java#L144-L156 |
adessoAG/wicked-charts | wicket/wicked-charts-wicket7/src/main/java/de/adesso/wickedcharts/wicket7/chartjs/features/basic/ChartBehavior.java | ChartBehavior.includeChartJavascript | protected void includeChartJavascript(final IHeaderResponse response, final ChartConfiguration options,
final JsonRenderer renderer, final String markupId) {
"""
Includes the javascript that calls the Highcharts library to visualize the
chart.
@param response the Wicke... | java | protected void includeChartJavascript(final IHeaderResponse response, final ChartConfiguration options,
final JsonRenderer renderer, final String markupId) {
String chartVarname = this.chart.getJavaScriptVarName();
String optionsVarname = markupId + "Options";
... | [
"protected",
"void",
"includeChartJavascript",
"(",
"final",
"IHeaderResponse",
"response",
",",
"final",
"ChartConfiguration",
"options",
",",
"final",
"JsonRenderer",
"renderer",
",",
"final",
"String",
"markupId",
")",
"{",
"String",
"chartVarname",
"=",
"this",
... | Includes the javascript that calls the Highcharts library to visualize the
chart.
@param response the Wicket HeaderResponse
@param options the options containing the data to display
@param renderer the JsonRenderer responsible for rendering the options
@param markupId the DOM ID of the chart component. | [
"Includes",
"the",
"javascript",
"that",
"calls",
"the",
"Highcharts",
"library",
"to",
"visualize",
"the",
"chart",
"."
] | train | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/wicket/wicked-charts-wicket7/src/main/java/de/adesso/wickedcharts/wicket7/chartjs/features/basic/ChartBehavior.java#L62-L85 |
qiniu/java-sdk | src/main/java/com/qiniu/util/Auth.java | Auth.privateDownloadUrl | public String privateDownloadUrl(String baseUrl, long expires) {
"""
下载签名
@param baseUrl 待签名文件url,如 http://img.domain.com/u/3.jpg 、
http://img.domain.com/u/3.jpg?imageView2/1/w/120
@param expires 有效时长,单位秒。默认3600s
@return
"""
long deadline = System.currentTimeMillis() / 1000 + expires;
ret... | java | public String privateDownloadUrl(String baseUrl, long expires) {
long deadline = System.currentTimeMillis() / 1000 + expires;
return privateDownloadUrlWithDeadline(baseUrl, deadline);
} | [
"public",
"String",
"privateDownloadUrl",
"(",
"String",
"baseUrl",
",",
"long",
"expires",
")",
"{",
"long",
"deadline",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"1000",
"+",
"expires",
";",
"return",
"privateDownloadUrlWithDeadline",
"(",
"baseU... | 下载签名
@param baseUrl 待签名文件url,如 http://img.domain.com/u/3.jpg 、
http://img.domain.com/u/3.jpg?imageView2/1/w/120
@param expires 有效时长,单位秒。默认3600s
@return | [
"下载签名"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/util/Auth.java#L178-L181 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java | NameNode.validateCheckpointerAddress | protected void validateCheckpointerAddress(InetAddress configuredRemoteAddress)
throws IOException {
"""
Checks if the ip of the caller is equal to the given configured address.
@param configuredRemoteAddress
@throws IOException
"""
InetAddress remoteAddress = Server.getRemoteIp();
InjectionH... | java | protected void validateCheckpointerAddress(InetAddress configuredRemoteAddress)
throws IOException {
InetAddress remoteAddress = Server.getRemoteIp();
InjectionHandler.processEvent(InjectionEvent.NAMENODE_VERIFY_CHECKPOINTER,
remoteAddress);
LOG.info("Verify: received request from: " + remote... | [
"protected",
"void",
"validateCheckpointerAddress",
"(",
"InetAddress",
"configuredRemoteAddress",
")",
"throws",
"IOException",
"{",
"InetAddress",
"remoteAddress",
"=",
"Server",
".",
"getRemoteIp",
"(",
")",
";",
"InjectionHandler",
".",
"processEvent",
"(",
"Injecti... | Checks if the ip of the caller is equal to the given configured address.
@param configuredRemoteAddress
@throws IOException | [
"Checks",
"if",
"the",
"ip",
"of",
"the",
"caller",
"is",
"equal",
"to",
"the",
"given",
"configured",
"address",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java#L2295-L2325 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.removeIgnoreCase | public static String removeIgnoreCase(final String str, final String remove) {
"""
<p>
Case insensitive removal of all occurrences of a substring from within
the source string.
</p>
<p>
A {@code null} source string will return {@code null}. An empty ("")
source string will return the empty string. A {@code... | java | public static String removeIgnoreCase(final String str, final String remove) {
if (isEmpty(str) || isEmpty(remove)) {
return str;
}
return replaceIgnoreCase(str, remove, EMPTY, -1);
} | [
"public",
"static",
"String",
"removeIgnoreCase",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"remove",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
"||",
"isEmpty",
"(",
"remove",
")",
")",
"{",
"return",
"str",
";",
"}",
"return",
"rep... | <p>
Case insensitive removal of all occurrences of a substring from within
the source string.
</p>
<p>
A {@code null} source string will return {@code null}. An empty ("")
source string will return the empty string. A {@code null} remove string
will return the source string. An empty ("") remove string will return
the... | [
"<p",
">",
"Case",
"insensitive",
"removal",
"of",
"all",
"occurrences",
"of",
"a",
"substring",
"from",
"within",
"the",
"source",
"string",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L5008-L5013 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_lsolve.java | DZcs_lsolve.cs_lsolve | public static boolean cs_lsolve(DZcs L, DZcsa x) {
"""
Solves a lower triangular system Lx=b where x and b are dense. x=b on
input, solution on output.
@param L
column-compressed, lower triangular matrix
@param x
size n, right hand side on input, solution on output
@return true if successful, false on erro... | java | public static boolean cs_lsolve(DZcs L, DZcsa x)
{
int p, j, n, Lp[], Li[] ;
DZcsa Lx = new DZcsa() ;
if (!CS_CSC (L) || x == null) return (false); /* check inputs */
n = L.n ; Lp = L.p ; Li = L.i ; Lx.x = L.x ;
for (j = 0 ; j < n ; j++)
{
x.set(j, cs_cdiv(x.get(j), Lx.get(Lp [j]))) ;
for (p... | [
"public",
"static",
"boolean",
"cs_lsolve",
"(",
"DZcs",
"L",
",",
"DZcsa",
"x",
")",
"{",
"int",
"p",
",",
"j",
",",
"n",
",",
"Lp",
"[",
"]",
",",
"Li",
"[",
"]",
";",
"DZcsa",
"Lx",
"=",
"new",
"DZcsa",
"(",
")",
";",
"if",
"(",
"!",
"CS... | Solves a lower triangular system Lx=b where x and b are dense. x=b on
input, solution on output.
@param L
column-compressed, lower triangular matrix
@param x
size n, right hand side on input, solution on output
@return true if successful, false on error | [
"Solves",
"a",
"lower",
"triangular",
"system",
"Lx",
"=",
"b",
"where",
"x",
"and",
"b",
"are",
"dense",
".",
"x",
"=",
"b",
"on",
"input",
"solution",
"on",
"output",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_lsolve.java#L54-L69 |
jdillon/gshell | gshell-util/src/main/java/org/apache/tools/ant/taskdefs/PumpStreamHandler.java | PumpStreamHandler.createPump | protected Thread createPump(InputStream is, OutputStream os,
boolean closeWhenExhausted, boolean nonBlockingIO) {
"""
Creates a stream pumper to copy the given input stream to the
given output stream.
@param is the input stream to copy from.
@param os the output stream to copy to.
@param closeWhenExhausted... | java | protected Thread createPump(InputStream is, OutputStream os,
boolean closeWhenExhausted, boolean nonBlockingIO) {
StreamPumper pumper = new StreamPumper(is, os, closeWhenExhausted, nonBlockingIO);
pumper.setAutoflush(true);
final Thread result = new ThreadWithPumper(pumper);
result.setDaemon(true);
... | [
"protected",
"Thread",
"createPump",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
",",
"boolean",
"closeWhenExhausted",
",",
"boolean",
"nonBlockingIO",
")",
"{",
"StreamPumper",
"pumper",
"=",
"new",
"StreamPumper",
"(",
"is",
",",
"os",
",",
"closeWhen... | Creates a stream pumper to copy the given input stream to the
given output stream.
@param is the input stream to copy from.
@param os the output stream to copy to.
@param closeWhenExhausted if true close the inputstream.
@param nonBlockingIO set it to <code>true</code> to use simulated non
blocking IO.
@return a thread... | [
"Creates",
"a",
"stream",
"pumper",
"to",
"copy",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-util/src/main/java/org/apache/tools/ant/taskdefs/PumpStreamHandler.java#L274-L281 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/cache/JsCacheAnnotationServices.java | JsCacheAnnotationServices.computeCacheKey | String computeCacheKey(Class cls, String methodName, String argpart) {
"""
Compute the cache key from classname, methodname, and args
@param cls
@param methodName
@param argpart
@return
"""
String cachekey = keyMaker.getMd5(cls.getName() + "." + methodName);
if (!argpart.isEmpty()) {
cachekey +... | java | String computeCacheKey(Class cls, String methodName, String argpart) {
String cachekey = keyMaker.getMd5(cls.getName() + "." + methodName);
if (!argpart.isEmpty()) {
cachekey += "_" + keyMaker.getMd5(argpart);
}
logger.debug("CACHEID : {}.{}_{} = {}", cls.getName(), methodName, argpart, cachekey);
re... | [
"String",
"computeCacheKey",
"(",
"Class",
"cls",
",",
"String",
"methodName",
",",
"String",
"argpart",
")",
"{",
"String",
"cachekey",
"=",
"keyMaker",
".",
"getMd5",
"(",
"cls",
".",
"getName",
"(",
")",
"+",
"\".\"",
"+",
"methodName",
")",
";",
"if"... | Compute the cache key from classname, methodname, and args
@param cls
@param methodName
@param argpart
@return | [
"Compute",
"the",
"cache",
"key",
"from",
"classname",
"methodname",
"and",
"args"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/cache/JsCacheAnnotationServices.java#L127-L134 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java | FDBigInteger.valueOfPow2 | private static FDBigInteger valueOfPow2(int p2) {
"""
/*@
@ requires p2 >= 0;
@ assignable \nothing;
@ ensures \result.value() == pow52(0, p2);
@
"""
int wordcount = p2 >> 5;
int bitcount = p2 & 0x1f;
return new FDBigInteger(new int[]{1 << bitcount}, wordcount);
} | java | private static FDBigInteger valueOfPow2(int p2) {
int wordcount = p2 >> 5;
int bitcount = p2 & 0x1f;
return new FDBigInteger(new int[]{1 << bitcount}, wordcount);
} | [
"private",
"static",
"FDBigInteger",
"valueOfPow2",
"(",
"int",
"p2",
")",
"{",
"int",
"wordcount",
"=",
"p2",
">>",
"5",
";",
"int",
"bitcount",
"=",
"p2",
"&",
"0x1f",
";",
"return",
"new",
"FDBigInteger",
"(",
"new",
"int",
"[",
"]",
"{",
"1",
"<<... | /*@
@ requires p2 >= 0;
@ assignable \nothing;
@ ensures \result.value() == pow52(0, p2);
@ | [
"/",
"*"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L352-L356 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java | WebDriverHelper.waitForTextPresentWithinPage | public void waitForTextPresentWithinPage(final String text,
final int maximumSeconds) {
"""
Waits until a text will be displayed within the page.
@param text
text to wait for
@param maximumSeconds
maximum number of seconds to wait for the text to be present
"""
WebDriverWait wait = new WebDriverWait... | java | public void waitForTextPresentWithinPage(final String text,
final int maximumSeconds) {
WebDriverWait wait = new WebDriverWait(driver, maximumSeconds);
wait.until(ExpectedConditions.textToBePresentInElement(
By.tagName("body"), text));
} | [
"public",
"void",
"waitForTextPresentWithinPage",
"(",
"final",
"String",
"text",
",",
"final",
"int",
"maximumSeconds",
")",
"{",
"WebDriverWait",
"wait",
"=",
"new",
"WebDriverWait",
"(",
"driver",
",",
"maximumSeconds",
")",
";",
"wait",
".",
"until",
"(",
... | Waits until a text will be displayed within the page.
@param text
text to wait for
@param maximumSeconds
maximum number of seconds to wait for the text to be present | [
"Waits",
"until",
"a",
"text",
"will",
"be",
"displayed",
"within",
"the",
"page",
"."
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L483-L488 |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java | AVIMConversation.queryMessagesByType | public void queryMessagesByType(int msgType, int limit, final AVIMMessagesQueryCallback callback) {
"""
获取特停类型的历史消息。
注意:这个操作总是会从云端获取记录。
另,该函数和 queryMessagesByType(type, msgId, timestamp, limit, callback) 配合使用可以实现翻页效果。
@param msgType 消息类型,可以参看 `AVIMMessageType` 里的定义。
@param limit 本批次希望获取的消息数量。
@pa... | java | public void queryMessagesByType(int msgType, int limit, final AVIMMessagesQueryCallback callback) {
queryMessagesByType(msgType, null, 0, limit, callback);
} | [
"public",
"void",
"queryMessagesByType",
"(",
"int",
"msgType",
",",
"int",
"limit",
",",
"final",
"AVIMMessagesQueryCallback",
"callback",
")",
"{",
"queryMessagesByType",
"(",
"msgType",
",",
"null",
",",
"0",
",",
"limit",
",",
"callback",
")",
";",
"}"
] | 获取特停类型的历史消息。
注意:这个操作总是会从云端获取记录。
另,该函数和 queryMessagesByType(type, msgId, timestamp, limit, callback) 配合使用可以实现翻页效果。
@param msgType 消息类型,可以参看 `AVIMMessageType` 里的定义。
@param limit 本批次希望获取的消息数量。
@param callback 结果回调函数 | [
"获取特停类型的历史消息。",
"注意:这个操作总是会从云端获取记录。",
"另,该函数和",
"queryMessagesByType",
"(",
"type",
"msgId",
"timestamp",
"limit",
"callback",
")",
"配合使用可以实现翻页效果。"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java#L787-L789 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelCBEFormatter.java | HpelCBEFormatter.createExtendedElement | private void createExtendedElement(StringBuilder sb, RepositoryLogRecord record) {
"""
Appends the CBE Extended Data Element of a record to a String buffer
@param sb the string buffer the element will be added to
@param record the record that represents the common base event
"""
sb.append(lineSep... | java | private void createExtendedElement(StringBuilder sb, RepositoryLogRecord record){
sb.append(lineSeparator).append(INDENT[0]).append("<extendedDataElements name=\"CommonBaseEventLogRecord:level\" type=\"noValue\">");
sb.append(lineSeparator).append(INDENT[1]).append("<children name=\"CommonBaseEventLogRecord:name\" ... | [
"private",
"void",
"createExtendedElement",
"(",
"StringBuilder",
"sb",
",",
"RepositoryLogRecord",
"record",
")",
"{",
"sb",
".",
"append",
"(",
"lineSeparator",
")",
".",
"append",
"(",
"INDENT",
"[",
"0",
"]",
")",
".",
"append",
"(",
"\"<extendedDataElemen... | Appends the CBE Extended Data Element of a record to a String buffer
@param sb the string buffer the element will be added to
@param record the record that represents the common base event | [
"Appends",
"the",
"CBE",
"Extended",
"Data",
"Element",
"of",
"a",
"record",
"to",
"a",
"String",
"buffer"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelCBEFormatter.java#L246-L255 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java | GrafeasV1Beta1Client.updateNote | public final Note updateNote(NoteName name, Note note, FieldMask updateMask) {
"""
Updates the specified note.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
Note note = Note.newBuilder().bui... | java | public final Note updateNote(NoteName name, Note note, FieldMask updateMask) {
UpdateNoteRequest request =
UpdateNoteRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setNote(note)
.setUpdateMask(updateMask)
.build();
return updateNote... | [
"public",
"final",
"Note",
"updateNote",
"(",
"NoteName",
"name",
",",
"Note",
"note",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateNoteRequest",
"request",
"=",
"UpdateNoteRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
"==",
"null",
... | Updates the specified note.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
Note note = Note.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Note response = grafeasV1Beta1Clie... | [
"Updates",
"the",
"specified",
"note",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java#L1505-L1514 |
Netflix/governator | governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java | InjectorBuilder.createInjector | public <I extends Injector> I createInjector(Stage stage, InjectorCreator<I> creator) {
"""
Create the injector in the specified stage using the specified InjectorCreator
strategy. The InjectorCreator will most likely perform additional error handling on top
of the call to {@link Guice#createInjector}.
@para... | java | public <I extends Injector> I createInjector(Stage stage, InjectorCreator<I> creator) {
return creator.createInjector(stage, module);
} | [
"public",
"<",
"I",
"extends",
"Injector",
">",
"I",
"createInjector",
"(",
"Stage",
"stage",
",",
"InjectorCreator",
"<",
"I",
">",
"creator",
")",
"{",
"return",
"creator",
".",
"createInjector",
"(",
"stage",
",",
"module",
")",
";",
"}"
] | Create the injector in the specified stage using the specified InjectorCreator
strategy. The InjectorCreator will most likely perform additional error handling on top
of the call to {@link Guice#createInjector}.
@param stage Stage in which the injector is running. It is recommended to run in Stage.DEVELOPEMENT
s... | [
"Create",
"the",
"injector",
"in",
"the",
"specified",
"stage",
"using",
"the",
"specified",
"InjectorCreator",
"strategy",
".",
"The",
"InjectorCreator",
"will",
"most",
"likely",
"perform",
"additional",
"error",
"handling",
"on",
"top",
"of",
"the",
"call",
"... | train | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java#L208-L210 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/OrmElf.java | OrmElf.getColumnsCsvExclude | public static <T> String getColumnsCsvExclude(Class<T> clazz, String... excludeColumns) {
"""
Get a comma separated values list of column names for the given class -- <i>excluding
the column names specified</i>, suitable for inclusion into a SQL SELECT statement.
Note the excluded column names must exactly match... | java | public static <T> String getColumnsCsvExclude(Class<T> clazz, String... excludeColumns)
{
return OrmReader.getColumnsCsvExclude(clazz, excludeColumns);
} | [
"public",
"static",
"<",
"T",
">",
"String",
"getColumnsCsvExclude",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"...",
"excludeColumns",
")",
"{",
"return",
"OrmReader",
".",
"getColumnsCsvExclude",
"(",
"clazz",
",",
"excludeColumns",
")",
";",
"}... | Get a comma separated values list of column names for the given class -- <i>excluding
the column names specified</i>, suitable for inclusion into a SQL SELECT statement.
Note the excluded column names must exactly match annotated column names in the class
in a case-sensitive manner.
@param clazz the annotated class
@p... | [
"Get",
"a",
"comma",
"separated",
"values",
"list",
"of",
"column",
"names",
"for",
"the",
"given",
"class",
"--",
"<i",
">",
"excluding",
"the",
"column",
"names",
"specified<",
"/",
"i",
">",
"suitable",
"for",
"inclusion",
"into",
"a",
"SQL",
"SELECT",
... | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/OrmElf.java#L335-L338 |
davidmoten/rxjava-jdbc | src/main/java/com/github/davidmoten/rx/jdbc/QueryUpdateOnSubscribe.java | QueryUpdateOnSubscribe.performCommit | @SuppressWarnings("unchecked")
private void performCommit(Subscriber<? super T> subscriber, State state) {
"""
Commits the current transaction. Throws {@link RuntimeException} if
connection is in autoCommit mode.
@param subscriber
@param state
"""
getConnection(state);
query.context().... | java | @SuppressWarnings("unchecked")
private void performCommit(Subscriber<? super T> subscriber, State state) {
getConnection(state);
query.context().endTransactionObserve();
if (subscriber.isUnsubscribed())
return;
debug("committing");
Conditions.checkTrue(!Util.isAu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"performCommit",
"(",
"Subscriber",
"<",
"?",
"super",
"T",
">",
"subscriber",
",",
"State",
"state",
")",
"{",
"getConnection",
"(",
"state",
")",
";",
"query",
".",
"context",
"(",
")... | Commits the current transaction. Throws {@link RuntimeException} if
connection is in autoCommit mode.
@param subscriber
@param state | [
"Commits",
"the",
"current",
"transaction",
".",
"Throws",
"{",
"@link",
"RuntimeException",
"}",
"if",
"connection",
"is",
"in",
"autoCommit",
"mode",
"."
] | train | https://github.com/davidmoten/rxjava-jdbc/blob/81e157d7071a825086bde81107b8694684cdff14/src/main/java/com/github/davidmoten/rx/jdbc/QueryUpdateOnSubscribe.java#L159-L179 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.