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 |
|---|---|---|---|---|---|---|---|---|---|---|
petergeneric/stdlib | guice/webapp/src/main/java/com/peterphi/std/guice/web/rest/resteasy/ResteasyDispatcher.java | ResteasyDispatcher.startInitialise | private void startInitialise() {
"""
<p>
Start a background process to initialise Guice
</p>
<p>
This means that our servlet/filter does not block the startup of other Tomcat webapps. If we block startup we can cause a
deadlock (we're waiting for them to come up but Tomcat will only let
them start once we've... | java | private void startInitialise()
{
final Runnable worker = new GuiceInitThreadWorker(this.dispatcher);
final Thread thread = new Thread(worker, "GuiceInit-" + dispatcher.getWebappPath());
thread.setDaemon(true);
thread.start();
} | [
"private",
"void",
"startInitialise",
"(",
")",
"{",
"final",
"Runnable",
"worker",
"=",
"new",
"GuiceInitThreadWorker",
"(",
"this",
".",
"dispatcher",
")",
";",
"final",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"worker",
",",
"\"GuiceInit-\"",
"+",
"... | <p>
Start a background process to initialise Guice
</p>
<p>
This means that our servlet/filter does not block the startup of other Tomcat webapps. If we block startup we can cause a
deadlock (we're waiting for them to come up but Tomcat will only let
them start once we've returned from <code>init</code>)
</p>
<p>
Circu... | [
"<p",
">",
"Start",
"a",
"background",
"process",
"to",
"initialise",
"Guice",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"means",
"that",
"our",
"servlet",
"/",
"filter",
"does",
"not",
"block",
"the",
"startup",
"of",
"other",
"Tomcat",
"webapps",
".",
"... | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/webapp/src/main/java/com/peterphi/std/guice/web/rest/resteasy/ResteasyDispatcher.java#L75-L82 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/manager/action/UpdateConfigAction.java | UpdateConfigAction.addCommand | public void addCommand(String action, String cat, String var, String value, String match) {
"""
Adds a command to update a config file while sparing you the details of
the Manager's required syntax. If you want to omit one of the command's
sections, provide a null value to this method. The command index will be
... | java | public void addCommand(String action, String cat, String var, String value, String match)
{
// for convienence of reference, shorter!
final String stringCounter = String.format("%06d", this.actionCounter);
if (action != null)
{
actions.put("Action-" + stringCounter, acti... | [
"public",
"void",
"addCommand",
"(",
"String",
"action",
",",
"String",
"cat",
",",
"String",
"var",
",",
"String",
"value",
",",
"String",
"match",
")",
"{",
"// for convienence of reference, shorter!",
"final",
"String",
"stringCounter",
"=",
"String",
".",
"f... | Adds a command to update a config file while sparing you the details of
the Manager's required syntax. If you want to omit one of the command's
sections, provide a null value to this method. The command index will be
incremented even if you supply a null for all parameters, though the map
will be unaffected.
@param ac... | [
"Adds",
"a",
"command",
"to",
"update",
"a",
"config",
"file",
"while",
"sparing",
"you",
"the",
"details",
"of",
"the",
"Manager",
"s",
"required",
"syntax",
".",
"If",
"you",
"want",
"to",
"omit",
"one",
"of",
"the",
"command",
"s",
"sections",
"provid... | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/manager/action/UpdateConfigAction.java#L107-L138 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.computeStartGalleryPreselection | private String computeStartGalleryPreselection(HttpServletRequest request, String galleryType) {
"""
Returns the preferred editor preselection value either from the request, if not present, from the user settings.<p>
@param request the current http servlet request
@param galleryType the preferred gallery type
... | java | private String computeStartGalleryPreselection(HttpServletRequest request, String galleryType) {
// first check presence of the setting in request parameter
String preSelection = request.getParameter(PARAM_STARTGALLERY_PREFIX + galleryType);
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(preSelec... | [
"private",
"String",
"computeStartGalleryPreselection",
"(",
"HttpServletRequest",
"request",
",",
"String",
"galleryType",
")",
"{",
"// first check presence of the setting in request parameter",
"String",
"preSelection",
"=",
"request",
".",
"getParameter",
"(",
"PARAM_STARTG... | Returns the preferred editor preselection value either from the request, if not present, from the user settings.<p>
@param request the current http servlet request
@param galleryType the preferred gallery type
@return the preferred editor preselection value or null, if none found | [
"Returns",
"the",
"preferred",
"editor",
"preselection",
"value",
"either",
"from",
"the",
"request",
"if",
"not",
"present",
"from",
"the",
"user",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L2308-L2320 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java | ZooKeeper.getChildren | public List<String> getChildren(String path, boolean watch)
throws KeeperException, InterruptedException {
"""
Return the list of the children of the node of the given path.
<p>
If the watch is true and the call is successful (no exception is thrown),
a watch will be left on the node with the given ... | java | public List<String> getChildren(String path, boolean watch)
throws KeeperException, InterruptedException {
return getChildren(path, watch ? watchManager.defaultWatcher : null);
} | [
"public",
"List",
"<",
"String",
">",
"getChildren",
"(",
"String",
"path",
",",
"boolean",
"watch",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"return",
"getChildren",
"(",
"path",
",",
"watch",
"?",
"watchManager",
".",
"defaultWatcher... | Return the list of the children of the node of the given path.
<p>
If the watch is true and the call is successful (no exception is thrown),
a watch will be left on the node with the given path. The watch willbe
triggered by a successful operation that deletes the node of the given
path or creates/delete a child under ... | [
"Return",
"the",
"list",
"of",
"the",
"children",
"of",
"the",
"node",
"of",
"the",
"given",
"path",
".",
"<p",
">",
"If",
"the",
"watch",
"is",
"true",
"and",
"the",
"call",
"is",
"successful",
"(",
"no",
"exception",
"is",
"thrown",
")",
"a",
"watc... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L1334-L1337 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.getJobs | public Map<String, Job> getJobs(String view) throws IOException {
"""
Get a list of all the defined jobs on the server (at the specified view
level)
@param view The view to get jobs from.
@return list of defined jobs (view level, for details @see Job#details
@throws IOException in case of an error.
"""
... | java | public Map<String, Job> getJobs(String view) throws IOException {
return getJobs(null, view);
} | [
"public",
"Map",
"<",
"String",
",",
"Job",
">",
"getJobs",
"(",
"String",
"view",
")",
"throws",
"IOException",
"{",
"return",
"getJobs",
"(",
"null",
",",
"view",
")",
";",
"}"
] | Get a list of all the defined jobs on the server (at the specified view
level)
@param view The view to get jobs from.
@return list of defined jobs (view level, for details @see Job#details
@throws IOException in case of an error. | [
"Get",
"a",
"list",
"of",
"all",
"the",
"defined",
"jobs",
"on",
"the",
"server",
"(",
"at",
"the",
"specified",
"view",
"level",
")"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L152-L154 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java | RedisJobStore.storeJob | @Override
public void storeJob(final JobDetail newJob, final boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException {
"""
Store the given <code>{@link org.quartz.JobDetail}</code>.
@param newJob The <code>JobDetail</code> to be stored.
@param replaceExisting If <code... | java | @Override
public void storeJob(final JobDetail newJob, final boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException {
try {
doWithLock(new LockCallbackWithoutResult() {
@Override
public Void doWithLock(JedisCommands jedis) throws Job... | [
"@",
"Override",
"public",
"void",
"storeJob",
"(",
"final",
"JobDetail",
"newJob",
",",
"final",
"boolean",
"replaceExisting",
")",
"throws",
"ObjectAlreadyExistsException",
",",
"JobPersistenceException",
"{",
"try",
"{",
"doWithLock",
"(",
"new",
"LockCallbackWitho... | Store the given <code>{@link org.quartz.JobDetail}</code>.
@param newJob The <code>JobDetail</code> to be stored.
@param replaceExisting If <code>true</code>, any <code>Job</code> existing in the
<code>JobStore</code> with the same name & group should be
over-written.
@throws org.quartz.ObjectAlreadyExistsExc... | [
"Store",
"the",
"given",
"<code",
">",
"{",
"@link",
"org",
".",
"quartz",
".",
"JobDetail",
"}",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java#L287-L304 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.longToIntFunction | public static LongToIntFunction longToIntFunction(CheckedLongToIntFunction function, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedLongToIntFunction} in a {@link LongToIntFunction} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
LongStream.of(1L, 2L, 3L).mapToInt(Unchecked.long... | java | public static LongToIntFunction longToIntFunction(CheckedLongToIntFunction function, Consumer<Throwable> handler) {
return t -> {
try {
return function.applyAsInt(t);
}
catch (Throwable e) {
handler.accept(e);
throw new Illegal... | [
"public",
"static",
"LongToIntFunction",
"longToIntFunction",
"(",
"CheckedLongToIntFunction",
"function",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"t",
"->",
"{",
"try",
"{",
"return",
"function",
".",
"applyAsInt",
"(",
"t",
")",
... | Wrap a {@link CheckedLongToIntFunction} in a {@link LongToIntFunction} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
LongStream.of(1L, 2L, 3L).mapToInt(Unchecked.longToIntFunction(
l -> {
if (l < 0L)
throw new Exception("Only positive numbers allowed");
return (int) l;
},
e -> {
throw new I... | [
"Wrap",
"a",
"{",
"@link",
"CheckedLongToIntFunction",
"}",
"in",
"a",
"{",
"@link",
"LongToIntFunction",
"}",
"with",
"a",
"custom",
"handler",
"for",
"checked",
"exceptions",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"LongStream",
".",
"... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1259-L1270 |
lastaflute/lastaflute | src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java | LaTypicalPostcard.dryrunByGivenText | public void dryrunByGivenText(String subject, String plainBody) {
"""
Set up as dry-run by given text. <br>
Not send it actually, only preparation, e.g. for preview. <br>
You can get complete plain or HTML text from postcard.
@param subject The subject as given text. (NotNull)
@param plainBody The plain body (... | java | public void dryrunByGivenText(String subject, String plainBody) {
postcard.dryrun();
postcard.overrideBodyFile(subject, plainBody);
} | [
"public",
"void",
"dryrunByGivenText",
"(",
"String",
"subject",
",",
"String",
"plainBody",
")",
"{",
"postcard",
".",
"dryrun",
"(",
")",
";",
"postcard",
".",
"overrideBodyFile",
"(",
"subject",
",",
"plainBody",
")",
";",
"}"
] | Set up as dry-run by given text. <br>
Not send it actually, only preparation, e.g. for preview. <br>
You can get complete plain or HTML text from postcard.
@param subject The subject as given text. (NotNull)
@param plainBody The plain body (template) as given text. (NotNull) | [
"Set",
"up",
"as",
"dry",
"-",
"run",
"by",
"given",
"text",
".",
"<br",
">",
"Not",
"send",
"it",
"actually",
"only",
"preparation",
"e",
".",
"g",
".",
"for",
"preview",
".",
"<br",
">",
"You",
"can",
"get",
"complete",
"plain",
"or",
"HTML",
"te... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java#L327-L330 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassButtonUI.java | SeaGlassButtonUI.getSynthDisabledIcon | private Icon getSynthDisabledIcon(AbstractButton b, Icon defaultIcon) {
"""
DOCUMENT ME!
@param b DOCUMENT ME!
@param defaultIcon DOCUMENT ME!
@return DOCUMENT ME!
"""
ButtonModel model = b.getModel();
Icon icon;
if (model.isSelected()) {
icon = ge... | java | private Icon getSynthDisabledIcon(AbstractButton b, Icon defaultIcon) {
ButtonModel model = b.getModel();
Icon icon;
if (model.isSelected()) {
icon = getIcon(b, b.getDisabledSelectedIcon(), defaultIcon, SynthConstants.DISABLED | SynthConstants.SELECTED);
} else {
... | [
"private",
"Icon",
"getSynthDisabledIcon",
"(",
"AbstractButton",
"b",
",",
"Icon",
"defaultIcon",
")",
"{",
"ButtonModel",
"model",
"=",
"b",
".",
"getModel",
"(",
")",
";",
"Icon",
"icon",
";",
"if",
"(",
"model",
".",
"isSelected",
"(",
")",
")",
"{",... | DOCUMENT ME!
@param b DOCUMENT ME!
@param defaultIcon DOCUMENT ME!
@return DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassButtonUI.java#L512-L523 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/MessageStore.java | MessageStore._setMembership | protected void _setMembership(Membership membership, AbstractItem item) {
"""
/*
Used to call the (package-private) {@link AbstractItem#setMembership()}
method from inside the implementation package. A sneaky trick.
@param membership
@param item
"""
if (TraceComponent.isAnyTracingEnabled() && t... | java | protected void _setMembership(Membership membership, AbstractItem item)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "_setMembership", new Object[] { membership, item });
item._setMembership(membership);
if (TraceComponent.isAnyTracin... | [
"protected",
"void",
"_setMembership",
"(",
"Membership",
"membership",
",",
"AbstractItem",
"item",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"t... | /*
Used to call the (package-private) {@link AbstractItem#setMembership()}
method from inside the implementation package. A sneaky trick.
@param membership
@param item | [
"/",
"*",
"Used",
"to",
"call",
"the",
"(",
"package",
"-",
"private",
")",
"{",
"@link",
"AbstractItem#setMembership",
"()",
"}",
"method",
"from",
"inside",
"the",
"implementation",
"package",
".",
"A",
"sneaky",
"trick",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/MessageStore.java#L186-L195 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.bigDecimalMax | public static <Key, Value> Aggregation<Key, BigDecimal, BigDecimal> bigDecimalMax() {
"""
Returns an aggregation to find the {@link java.math.BigDecimal} maximum
of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT MAX(value) FROM x</pre>
@param <Key> the input key type
@param <Value> t... | java | public static <Key, Value> Aggregation<Key, BigDecimal, BigDecimal> bigDecimalMax() {
return new AggregationAdapter(new BigDecimalMaxAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"BigDecimal",
",",
"BigDecimal",
">",
"bigDecimalMax",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"BigDecimalMaxAggregation",
"<",
"Key",
",",
"Value",
... | Returns an aggregation to find the {@link java.math.BigDecimal} maximum
of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT MAX(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the maximum value over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"find",
"the",
"{",
"@link",
"java",
".",
"math",
".",
"BigDecimal",
"}",
"maximum",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELECT",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L286-L288 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/PaxDate.java | PaxDate.plusMonths | @Override
PaxDate plusMonths(long monthsToAdd) {
"""
Returns a copy of this {@code PaxDate} with the specified period in months added.
<p>
This method adds the specified amount to the months field in three steps:
<ol>
<li>Add the input months to the month-of-year field</li>
<li>Check if the resulting date... | java | @Override
PaxDate plusMonths(long monthsToAdd) {
if (monthsToAdd == 0) {
return this;
}
long calcMonths = Math.addExact(getProlepticMonth(), monthsToAdd);
// "Regularize" the month count, as if years were all 13 months long.
long monthsRegularized = calcMonths - g... | [
"@",
"Override",
"PaxDate",
"plusMonths",
"(",
"long",
"monthsToAdd",
")",
"{",
"if",
"(",
"monthsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"calcMonths",
"=",
"Math",
".",
"addExact",
"(",
"getProlepticMonth",
"(",
")",
",",
"month... | Returns a copy of this {@code PaxDate} with the specified period in months added.
<p>
This method adds the specified amount to the months field in three steps:
<ol>
<li>Add the input months to the month-of-year field</li>
<li>Check if the resulting date would be invalid</li>
<li>Adjust the day-of-month to the last vali... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"PaxDate",
"}",
"with",
"the",
"specified",
"period",
"in",
"months",
"added",
".",
"<p",
">",
"This",
"method",
"adds",
"the",
"specified",
"amount",
"to",
"the",
"months",
"field",
"in",
"three",
"ste... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/PaxDate.java#L598-L609 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java | PrincipalUser.findByUserName | public static PrincipalUser findByUserName(EntityManager em, String userName) {
"""
Finds the application database user account for the provided user name.
@param em The entity manager to use.
@param userName The user name for which to retrieve the account information for.
@return The user acco... | java | public static PrincipalUser findByUserName(EntityManager em, String userName) {
Class<PrincipalUser> type = PrincipalUser.class;
TypedQuery<PrincipalUser> query = em.createNamedQuery("PrincipalUser.findByUserName", type);
try {
return query.setParameter("userName", userName).getSing... | [
"public",
"static",
"PrincipalUser",
"findByUserName",
"(",
"EntityManager",
"em",
",",
"String",
"userName",
")",
"{",
"Class",
"<",
"PrincipalUser",
">",
"type",
"=",
"PrincipalUser",
".",
"class",
";",
"TypedQuery",
"<",
"PrincipalUser",
">",
"query",
"=",
... | Finds the application database user account for the provided user name.
@param em The entity manager to use.
@param userName The user name for which to retrieve the account information for.
@return The user account or null if no account exists. | [
"Finds",
"the",
"application",
"database",
"user",
"account",
"for",
"the",
"provided",
"user",
"name",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java#L260-L269 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.convertStringToURL | @Pure
public static URL convertStringToURL(String urlDescription, boolean allowResourceSearch) {
"""
Convert a string to an URL according to several rules.
<p>The rules are (the first succeeded is replied):
<ul>
<li>if {@code urlDescription} is <code>null</code> or empty, return <code>null</code>;</li>
<li>... | java | @Pure
public static URL convertStringToURL(String urlDescription, boolean allowResourceSearch) {
return convertStringToURL(urlDescription, allowResourceSearch, true, true);
} | [
"@",
"Pure",
"public",
"static",
"URL",
"convertStringToURL",
"(",
"String",
"urlDescription",
",",
"boolean",
"allowResourceSearch",
")",
"{",
"return",
"convertStringToURL",
"(",
"urlDescription",
",",
"allowResourceSearch",
",",
"true",
",",
"true",
")",
";",
"... | Convert a string to an URL according to several rules.
<p>The rules are (the first succeeded is replied):
<ul>
<li>if {@code urlDescription} is <code>null</code> or empty, return <code>null</code>;</li>
<li>try to build an {@link URL} with {@code urlDescription} as parameter;</li>
<li>if {@code allowResourceSearch} is... | [
"Convert",
"a",
"string",
"to",
"an",
"URL",
"according",
"to",
"several",
"rules",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L1977-L1980 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsMacroResolverDialog.java | CmsMacroResolverDialog.getLocalizedBundle | private Properties getLocalizedBundle(CmsObject cms, String path) throws CmsException, IOException {
"""
Gets localized property object.<p>
@param cms CmsObject
@param path of resource
@return Properties object
@throws CmsException exception
@throws IOException exception
"""
CmsResource bundleR... | java | private Properties getLocalizedBundle(CmsObject cms, String path) throws CmsException, IOException {
CmsResource bundleResource = cms.readResource(path
+ CmsSiteManager.MACRO_FOLDER
+ "/"
+ getAvailableLocalVariant(cms, path + CmsSiteManager.MACRO_FOLDER + "/", CmsSiteManage... | [
"private",
"Properties",
"getLocalizedBundle",
"(",
"CmsObject",
"cms",
",",
"String",
"path",
")",
"throws",
"CmsException",
",",
"IOException",
"{",
"CmsResource",
"bundleResource",
"=",
"cms",
".",
"readResource",
"(",
"path",
"+",
"CmsSiteManager",
".",
"MACRO... | Gets localized property object.<p>
@param cms CmsObject
@param path of resource
@return Properties object
@throws CmsException exception
@throws IOException exception | [
"Gets",
"localized",
"property",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsMacroResolverDialog.java#L206-L220 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.configureNamingStrategy | public static void configureNamingStrategy(final String datasourceName, final Object strategy) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
"""
Override the default naming strategy given a Class or a full class name,
or an instance of a NamingStrategy.
@param datasourceName t... | java | public static void configureNamingStrategy(final String datasourceName, final Object strategy) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
Class<?> namingStrategyClass = null;
NamingStrategy namingStrategy;
if (strategy instanceof Class<?>) {
namin... | [
"public",
"static",
"void",
"configureNamingStrategy",
"(",
"final",
"String",
"datasourceName",
",",
"final",
"Object",
"strategy",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"Class",
"<",
"?",
">",
"na... | Override the default naming strategy given a Class or a full class name,
or an instance of a NamingStrategy.
@param datasourceName the datasource name
@param strategy the class, name, or instance
@throws ClassNotFoundException When the class was not found for specified strategy
@throws InstantiationException When an ... | [
"Override",
"the",
"default",
"naming",
"strategy",
"given",
"a",
"Class",
"or",
"a",
"full",
"class",
"name",
"or",
"an",
"instance",
"of",
"a",
"NamingStrategy",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L190-L208 |
redisson/redisson | redisson/src/main/java/org/redisson/api/BatchOptions.java | BatchOptions.syncSlaves | public BatchOptions syncSlaves(int slaves, long timeout, TimeUnit unit) {
"""
Synchronize write operations execution within defined timeout
across specified amount of Redis slave nodes.
<p>
NOTE: Redis 3.0+ required
@param slaves - synchronization timeout
@param timeout - synchronization timeout
@param uni... | java | public BatchOptions syncSlaves(int slaves, long timeout, TimeUnit unit) {
this.syncSlaves = slaves;
this.syncTimeout = unit.toMillis(timeout);
return this;
} | [
"public",
"BatchOptions",
"syncSlaves",
"(",
"int",
"slaves",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"syncSlaves",
"=",
"slaves",
";",
"this",
".",
"syncTimeout",
"=",
"unit",
".",
"toMillis",
"(",
"timeout",
")",
";",
"r... | Synchronize write operations execution within defined timeout
across specified amount of Redis slave nodes.
<p>
NOTE: Redis 3.0+ required
@param slaves - synchronization timeout
@param timeout - synchronization timeout
@param unit - synchronization timeout time unit
@return self instance | [
"Synchronize",
"write",
"operations",
"execution",
"within",
"defined",
"timeout",
"across",
"specified",
"amount",
"of",
"Redis",
"slave",
"nodes",
".",
"<p",
">",
"NOTE",
":",
"Redis",
"3",
".",
"0",
"+",
"required"
] | train | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/BatchOptions.java#L152-L156 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java | AbstractEntityReader.compareTo | private boolean compareTo(Object relationalEntity, Object originalEntity) {
"""
Compares original with relational entity.
@param relationalEntity
@param originalEntity
@return
"""
if (relationalEntity != null && originalEntity != null
&& relationalEntity.getClass().isAssignableFrom... | java | private boolean compareTo(Object relationalEntity, Object originalEntity)
{
if (relationalEntity != null && originalEntity != null
&& relationalEntity.getClass().isAssignableFrom(originalEntity.getClass()))
{
EntityMetadata metadata = KunderaMetadataManager.getEntityMetad... | [
"private",
"boolean",
"compareTo",
"(",
"Object",
"relationalEntity",
",",
"Object",
"originalEntity",
")",
"{",
"if",
"(",
"relationalEntity",
"!=",
"null",
"&&",
"originalEntity",
"!=",
"null",
"&&",
"relationalEntity",
".",
"getClass",
"(",
")",
".",
"isAssig... | Compares original with relational entity.
@param relationalEntity
@param originalEntity
@return | [
"Compares",
"original",
"with",
"relational",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java#L647-L662 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/copy/CopyFileExtensions.java | CopyFileExtensions.copyDirectoryWithFileFilter | public static boolean copyDirectoryWithFileFilter(final File source, final File destination,
final FileFilter fileFilter, final boolean lastModified)
throws IOException, FileIsNotADirectoryException, FileIsADirectoryException,
FileIsSecurityRestrictedException, DirectoryAlreadyExistsException {
"""
Copies al... | java | public static boolean copyDirectoryWithFileFilter(final File source, final File destination,
final FileFilter fileFilter, final boolean lastModified)
throws IOException, FileIsNotADirectoryException, FileIsADirectoryException,
FileIsSecurityRestrictedException, DirectoryAlreadyExistsException
{
return copyDire... | [
"public",
"static",
"boolean",
"copyDirectoryWithFileFilter",
"(",
"final",
"File",
"source",
",",
"final",
"File",
"destination",
",",
"final",
"FileFilter",
"fileFilter",
",",
"final",
"boolean",
"lastModified",
")",
"throws",
"IOException",
",",
"FileIsNotADirector... | Copies all files that match to the FileFilter from the given source directory to the given
destination directory with the option to set the lastModified time from the given destination
file or directory.
@param source
The source directory.
@param destination
The destination directory.
@param fileFilter
The FileFilter ... | [
"Copies",
"all",
"files",
"that",
"match",
"to",
"the",
"FileFilter",
"from",
"the",
"given",
"source",
"directory",
"to",
"the",
"given",
"destination",
"directory",
"with",
"the",
"option",
"to",
"set",
"the",
"lastModified",
"time",
"from",
"the",
"given",
... | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/copy/CopyFileExtensions.java#L145-L151 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java | ElementMatchers.nameEndsWith | public static <T extends NamedElement> ElementMatcher.Junction<T> nameEndsWith(String suffix) {
"""
Matches a {@link NamedElement} for its name's suffix.
@param suffix The expected name's suffix.
@param <T> The type of the matched object.
@return An element matcher for a named element's name's suffix.
... | java | public static <T extends NamedElement> ElementMatcher.Junction<T> nameEndsWith(String suffix) {
return new NameMatcher<T>(new StringMatcher(suffix, StringMatcher.Mode.ENDS_WITH));
} | [
"public",
"static",
"<",
"T",
"extends",
"NamedElement",
">",
"ElementMatcher",
".",
"Junction",
"<",
"T",
">",
"nameEndsWith",
"(",
"String",
"suffix",
")",
"{",
"return",
"new",
"NameMatcher",
"<",
"T",
">",
"(",
"new",
"StringMatcher",
"(",
"suffix",
",... | Matches a {@link NamedElement} for its name's suffix.
@param suffix The expected name's suffix.
@param <T> The type of the matched object.
@return An element matcher for a named element's name's suffix. | [
"Matches",
"a",
"{",
"@link",
"NamedElement",
"}",
"for",
"its",
"name",
"s",
"suffix",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java#L700-L702 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java | CommercePriceListPersistenceImpl.fetchByUUID_G | @Override
public CommercePriceList fetchByUUID_G(String uuid, long groupId) {
"""
Returns the commerce price list where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce... | java | @Override
public CommercePriceList fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CommercePriceList",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the commerce price list where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce price list, or <code>null</code> if a matching commerce price list could not be found | [
"Returns",
"the",
"commerce",
"price",
"list",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"... | 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/CommercePriceListPersistenceImpl.java#L707-L710 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/products/Bond.java | Bond.getValue | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is ofte... | java | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
// Get random variables
RandomVariableInterface numeraire = model.getNumeraire(maturity);
RandomVariableInterface monteCarloProbabilities = model.getMonteCarlo... | [
"@",
"Override",
"public",
"RandomVariableInterface",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationInterface",
"model",
")",
"throws",
"CalculationException",
"{",
"// Get random variables",
"RandomVariableInterface",
"numeraire",
"=",
"model... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/products/Bond.java#L39-L57 |
amzn/ion-java | src/com/amazon/ion/facet/Facets.java | Facets.assumeFacet | public static <T> T assumeFacet(Class<T> facetType, Faceted subject) {
"""
Returns a facet of the given subject if supported, throwing an
exception otherwise.
<p>
This does not attempt to cast the subject to the requested type, since
the {@link Faceted} interface declares the intent to control the
conversion.... | java | public static <T> T assumeFacet(Class<T> facetType, Faceted subject)
{
if (subject != null)
{
T facet = subject.asFacet(facetType);
if (facet != null) return facet;
}
throw new UnsupportedFacetException(facetType, subject);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"assumeFacet",
"(",
"Class",
"<",
"T",
">",
"facetType",
",",
"Faceted",
"subject",
")",
"{",
"if",
"(",
"subject",
"!=",
"null",
")",
"{",
"T",
"facet",
"=",
"subject",
".",
"asFacet",
"(",
"facetType",
")",
... | Returns a facet of the given subject if supported, throwing an
exception otherwise.
<p>
This does not attempt to cast the subject to the requested type, since
the {@link Faceted} interface declares the intent to control the
conversion.
@return not null.
@throws UnsupportedFacetException if {@code subject} is null or ... | [
"Returns",
"a",
"facet",
"of",
"the",
"given",
"subject",
"if",
"supported",
"throwing",
"an",
"exception",
"otherwise",
".",
"<p",
">",
"This",
"does",
"not",
"attempt",
"to",
"cast",
"the",
"subject",
"to",
"the",
"requested",
"type",
"since",
"the",
"{"... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/facet/Facets.java#L90-L99 |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductPartitionNode.java | ProductPartitionNode.appendDetailedString | private void appendDetailedString(int level, StringBuilder stringBuilder) {
"""
Appends to {@code stringBuidler} a String representation of this node and all of its children.
@param level the level of this node
@param stringBuilder the StringBuilder to append to
"""
String pad = Strings.repeat("--", le... | java | private void appendDetailedString(int level, StringBuilder stringBuilder) {
String pad = Strings.repeat("--", level);
stringBuilder.append(pad).append(this).append(SystemUtils.LINE_SEPARATOR);
for (ProductPartitionNode childNode : getChildren()) {
childNode.appendDetailedString(level + 1, stringBuilde... | [
"private",
"void",
"appendDetailedString",
"(",
"int",
"level",
",",
"StringBuilder",
"stringBuilder",
")",
"{",
"String",
"pad",
"=",
"Strings",
".",
"repeat",
"(",
"\"--\"",
",",
"level",
")",
";",
"stringBuilder",
".",
"append",
"(",
"pad",
")",
".",
"a... | Appends to {@code stringBuidler} a String representation of this node and all of its children.
@param level the level of this node
@param stringBuilder the StringBuilder to append to | [
"Appends",
"to",
"{",
"@code",
"stringBuidler",
"}",
"a",
"String",
"representation",
"of",
"this",
"node",
"and",
"all",
"of",
"its",
"children",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductPartitionNode.java#L257-L263 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/AppendRule.java | AppendRule.newInstance | public static AppendRule newInstance(String file, String resource, String url, String format, String profile)
throws IllegalRuleException {
"""
Create a new AppendRule.
@param file the rule file to append
@param resource the rule resource to append
@param url the rule url to append
@param format ... | java | public static AppendRule newInstance(String file, String resource, String url, String format, String profile)
throws IllegalRuleException {
AppendRule appendRule = new AppendRule();
if (StringUtils.hasText(file)) {
appendRule.setFile(file);
} else if (StringUtils.hasText... | [
"public",
"static",
"AppendRule",
"newInstance",
"(",
"String",
"file",
",",
"String",
"resource",
",",
"String",
"url",
",",
"String",
"format",
",",
"String",
"profile",
")",
"throws",
"IllegalRuleException",
"{",
"AppendRule",
"appendRule",
"=",
"new",
"Appen... | Create a new AppendRule.
@param file the rule file to append
@param resource the rule resource to append
@param url the rule url to append
@param format the rule file type ('xml' or 'apon')
@param profile the environment profile name
@return an {@code AppendRule} object
@throws IllegalRuleException if an illegal rule ... | [
"Create",
"a",
"new",
"AppendRule",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/AppendRule.java#L113-L138 |
arquillian/arquillian-extension-warp | impl/src/main/java/org/jboss/arquillian/warp/impl/utils/URLUtils.java | URLUtils.buildUrl | public static URL buildUrl(URL context, String... relocations) {
"""
Use URL context and one or more relocations to build end URL.
@param context first URL used like a context root for all relocation changes
@param relocations array of relocation URLs
@return end url after all changes made on context with... | java | public static URL buildUrl(URL context, String... relocations) {
URL url = context;
for (String move : relocations) {
try {
url = new URL(url, move);
} catch (MalformedURLException e) {
throw new AssertionError("URL('" + url + "', '" + move + "') ... | [
"public",
"static",
"URL",
"buildUrl",
"(",
"URL",
"context",
",",
"String",
"...",
"relocations",
")",
"{",
"URL",
"url",
"=",
"context",
";",
"for",
"(",
"String",
"move",
":",
"relocations",
")",
"{",
"try",
"{",
"url",
"=",
"new",
"URL",
"(",
"ur... | Use URL context and one or more relocations to build end URL.
@param context first URL used like a context root for all relocation changes
@param relocations array of relocation URLs
@return end url after all changes made on context with relocations
@throws AssertionError when context or some of relocations are ma... | [
"Use",
"URL",
"context",
"and",
"one",
"or",
"more",
"relocations",
"to",
"build",
"end",
"URL",
"."
] | train | https://github.com/arquillian/arquillian-extension-warp/blob/e958f4d782851baf7f40e39835d3d1ad185b74dd/impl/src/main/java/org/jboss/arquillian/warp/impl/utils/URLUtils.java#L56-L68 |
google/closure-compiler | src/com/google/javascript/jscomp/ProcessDefines.java | ProcessDefines.setDefineInfoNotAssignable | private static void setDefineInfoNotAssignable(DefineInfo info, NodeTraversal t) {
"""
Records the fact that because of the current node in the node traversal, the define can't ever
be assigned again.
@param info Represents the define variable.
@param t The current traversal.
"""
info.setNotAssignable... | java | private static void setDefineInfoNotAssignable(DefineInfo info, NodeTraversal t) {
info.setNotAssignable(
format(REASON_DEFINE_NOT_ASSIGNABLE, t.getLineNumber(), t.getSourceName()));
} | [
"private",
"static",
"void",
"setDefineInfoNotAssignable",
"(",
"DefineInfo",
"info",
",",
"NodeTraversal",
"t",
")",
"{",
"info",
".",
"setNotAssignable",
"(",
"format",
"(",
"REASON_DEFINE_NOT_ASSIGNABLE",
",",
"t",
".",
"getLineNumber",
"(",
")",
",",
"t",
".... | Records the fact that because of the current node in the node traversal, the define can't ever
be assigned again.
@param info Represents the define variable.
@param t The current traversal. | [
"Records",
"the",
"fact",
"that",
"because",
"of",
"the",
"current",
"node",
"in",
"the",
"node",
"traversal",
"the",
"define",
"can",
"t",
"ever",
"be",
"assigned",
"again",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ProcessDefines.java#L639-L642 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.addColumns | private void addColumns(MpxjTreeNode parentNode, Table table) {
"""
Add columns to the tree.
@param parentNode parent tree node
@param table columns container
"""
for (Column column : table.getColumns())
{
final Column c = column;
MpxjTreeNode childNode = new MpxjTreeNode(colu... | java | private void addColumns(MpxjTreeNode parentNode, Table table)
{
for (Column column : table.getColumns())
{
final Column c = column;
MpxjTreeNode childNode = new MpxjTreeNode(column)
{
@Override public String toString()
{
return c.getTitle(... | [
"private",
"void",
"addColumns",
"(",
"MpxjTreeNode",
"parentNode",
",",
"Table",
"table",
")",
"{",
"for",
"(",
"Column",
"column",
":",
"table",
".",
"getColumns",
"(",
")",
")",
"{",
"final",
"Column",
"c",
"=",
"column",
";",
"MpxjTreeNode",
"childNode... | Add columns to the tree.
@param parentNode parent tree node
@param table columns container | [
"Add",
"columns",
"to",
"the",
"tree",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L444-L458 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/ant/DdlUtilsDataHandling.java | DdlUtilsDataHandling.setModel | public void setModel(Database databaseModel, DescriptorRepository objModel) {
"""
Sets the model that the handling works on.
@param databaseModel The database model
@param objModel The object model
"""
_dbModel = databaseModel;
_preparedModel = new PreparedModel(objModel, datab... | java | public void setModel(Database databaseModel, DescriptorRepository objModel)
{
_dbModel = databaseModel;
_preparedModel = new PreparedModel(objModel, databaseModel);
} | [
"public",
"void",
"setModel",
"(",
"Database",
"databaseModel",
",",
"DescriptorRepository",
"objModel",
")",
"{",
"_dbModel",
"=",
"databaseModel",
";",
"_preparedModel",
"=",
"new",
"PreparedModel",
"(",
"objModel",
",",
"databaseModel",
")",
";",
"}"
] | Sets the model that the handling works on.
@param databaseModel The database model
@param objModel The object model | [
"Sets",
"the",
"model",
"that",
"the",
"handling",
"works",
"on",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/ant/DdlUtilsDataHandling.java#L134-L138 |
knowm/XChange | xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceMarketDataService.java | BinanceMarketDataService.getTrades | @Override
public Trades getTrades(CurrencyPair pair, Object... args) throws IOException {
"""
optional parameters provided in the args array:
<ul>
<li>0: Long fromId optional, ID to get aggregate trades from INCLUSIVE.
<li>1: Long startTime optional, Timestamp in ms to get aggregate trades from INCLUSIVE.
... | java | @Override
public Trades getTrades(CurrencyPair pair, Object... args) throws IOException {
try {
Long fromId = tradesArgument(args, 0, Long::valueOf);
Long startTime = tradesArgument(args, 1, Long::valueOf);
Long endTime = tradesArgument(args, 2, Long::valueOf);
Integer limit = tradesArgume... | [
"@",
"Override",
"public",
"Trades",
"getTrades",
"(",
"CurrencyPair",
"pair",
",",
"Object",
"...",
"args",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Long",
"fromId",
"=",
"tradesArgument",
"(",
"args",
",",
"0",
",",
"Long",
"::",
"valueOf",
")",
... | optional parameters provided in the args array:
<ul>
<li>0: Long fromId optional, ID to get aggregate trades from INCLUSIVE.
<li>1: Long startTime optional, Timestamp in ms to get aggregate trades from INCLUSIVE.
<li>2: Long endTime optional, Timestamp in ms to get aggregate trades until INCLUSIVE.
<li>3: Integer limi... | [
"optional",
"parameters",
"provided",
"in",
"the",
"args",
"array",
":"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceMarketDataService.java#L96-L121 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java | MemberEnter.initEnv | Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) {
"""
Create a fresh environment for a variable's initializer.
If the variable is a field, the owner of the environment's scope
is be the variable itself, otherwise the owner is the method
enclosing the variable definition.
@param tree T... | java | Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) {
Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup()));
if (tree.sym.owner.kind == TYP) {
localEnv.info.scope = env.info.scope.dupUnshared(tree.sym);
}
if ((tree.mods.flags & STATIC... | [
"Env",
"<",
"AttrContext",
">",
"initEnv",
"(",
"JCVariableDecl",
"tree",
",",
"Env",
"<",
"AttrContext",
">",
"env",
")",
"{",
"Env",
"<",
"AttrContext",
">",
"localEnv",
"=",
"env",
".",
"dupto",
"(",
"new",
"AttrContextEnv",
"(",
"tree",
",",
"env",
... | Create a fresh environment for a variable's initializer.
If the variable is a field, the owner of the environment's scope
is be the variable itself, otherwise the owner is the method
enclosing the variable definition.
@param tree The variable definition.
@param env The environment current outside of the varia... | [
"Create",
"a",
"fresh",
"environment",
"for",
"a",
"variable",
"s",
"initializer",
".",
"If",
"the",
"variable",
"is",
"a",
"field",
"the",
"owner",
"of",
"the",
"environment",
"s",
"scope",
"is",
"be",
"the",
"variable",
"itself",
"otherwise",
"the",
"own... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java#L411-L420 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZoneRegion.java | ZoneRegion.ofId | static ZoneRegion ofId(String zoneId, boolean checkAvailable) {
"""
Obtains an instance of {@code ZoneId} from an identifier.
@param zoneId the time-zone ID, not null
@param checkAvailable whether to check if the zone ID is available
@return the zone ID, not null
@throws DateTimeException if the ID format ... | java | static ZoneRegion ofId(String zoneId, boolean checkAvailable) {
Objects.requireNonNull(zoneId, "zoneId");
checkName(zoneId);
ZoneRules rules = null;
try {
// always attempt load for better behavior after deserialization
rules = ZoneRulesProvider.getRules(zoneId, t... | [
"static",
"ZoneRegion",
"ofId",
"(",
"String",
"zoneId",
",",
"boolean",
"checkAvailable",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"zoneId",
",",
"\"zoneId\"",
")",
";",
"checkName",
"(",
"zoneId",
")",
";",
"ZoneRules",
"rules",
"=",
"null",
";",
... | Obtains an instance of {@code ZoneId} from an identifier.
@param zoneId the time-zone ID, not null
@param checkAvailable whether to check if the zone ID is available
@return the zone ID, not null
@throws DateTimeException if the ID format is invalid
@throws ZoneRulesException if checking availability and the ID cann... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"ZoneId",
"}",
"from",
"an",
"identifier",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZoneRegion.java#L114-L127 |
amzn/ion-java | src/com/amazon/ion/util/IonTextUtils.java | IonTextUtils.printJsonString | public static void printJsonString(Appendable out, CharSequence text)
throws IOException {
"""
Prints characters as an ASCII-encoded JSON string, including surrounding
double-quotes.
If the {@code text} is null, this prints {@code null}.
@param out the stream to receive the JSON data.
@param text the... | java | public static void printJsonString(Appendable out, CharSequence text)
throws IOException
{
if (text == null)
{
out.append("null");
}
else
{
out.append('"');
printCodePoints(out, text, EscapeMode.JSON);
out.append('"');
... | [
"public",
"static",
"void",
"printJsonString",
"(",
"Appendable",
"out",
",",
"CharSequence",
"text",
")",
"throws",
"IOException",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"out",
".",
"append",
"(",
"\"null\"",
")",
";",
"}",
"else",
"{",
"out",
... | Prints characters as an ASCII-encoded JSON string, including surrounding
double-quotes.
If the {@code text} is null, this prints {@code null}.
@param out the stream to receive the JSON data.
@param text the text to print; may be {@code null}.
@throws IOException if the {@link Appendable} throws an exception.
@throws ... | [
"Prints",
"characters",
"as",
"an",
"ASCII",
"-",
"encoded",
"JSON",
"string",
"including",
"surrounding",
"double",
"-",
"quotes",
".",
"If",
"the",
"{",
"@code",
"text",
"}",
"is",
"null",
"this",
"prints",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L432-L445 |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.insertItem | public void insertItem(T value, int index, boolean reload) {
"""
Inserts an item into the list box. Has the same effect as
<pre>insertItem(value, item, index)</pre>
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}.
@param index the index at which to insert it
@param relo... | java | public void insertItem(T value, int index, boolean reload) {
index += getIndexOffset();
insertItemInternal(value, index, reload);
} | [
"public",
"void",
"insertItem",
"(",
"T",
"value",
",",
"int",
"index",
",",
"boolean",
"reload",
")",
"{",
"index",
"+=",
"getIndexOffset",
"(",
")",
";",
"insertItemInternal",
"(",
"value",
",",
"index",
",",
"reload",
")",
";",
"}"
] | Inserts an item into the list box. Has the same effect as
<pre>insertItem(value, item, index)</pre>
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}.
@param index the index at which to insert it
@param reload perform a 'material select' reload to update the DOM. | [
"Inserts",
"an",
"item",
"into",
"the",
"list",
"box",
".",
"Has",
"the",
"same",
"effect",
"as",
"<pre",
">",
"insertItem",
"(",
"value",
"item",
"index",
")",
"<",
"/",
"pre",
">"
] | train | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L320-L323 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/api/UserResource.java | UserResource.changeEmail | @POST
@Path("me/email")
@RolesAllowed( {
"""
User request changing their email address.
The new email is temporarily stored and an email is sent to the new email address for confirmation.
@param emailRequest new email address
@return 204 if success
""""ROLE_ADMIN", "ROLE_USER"})
public Response chan... | java | @POST
@Path("me/email")
@RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
public Response changeEmail(@Context HttpServletRequest request, EmailRequest emailRequest) {
Long userId = (Long) request.getAttribute(OAuth2Filter.NAME_USER_ID);
return changeEmail(userId, emailRequest);
} | [
"@",
"POST",
"@",
"Path",
"(",
"\"me/email\"",
")",
"@",
"RolesAllowed",
"(",
"{",
"\"ROLE_ADMIN\"",
",",
"\"ROLE_USER\"",
"}",
")",
"public",
"Response",
"changeEmail",
"(",
"@",
"Context",
"HttpServletRequest",
"request",
",",
"EmailRequest",
"emailRequest",
"... | User request changing their email address.
The new email is temporarily stored and an email is sent to the new email address for confirmation.
@param emailRequest new email address
@return 204 if success | [
"User",
"request",
"changing",
"their",
"email",
"address",
".",
"The",
"new",
"email",
"is",
"temporarily",
"stored",
"and",
"an",
"email",
"is",
"sent",
"to",
"the",
"new",
"email",
"address",
"for",
"confirmation",
"."
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/api/UserResource.java#L450-L456 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/ApiUtils.java | ApiUtils.getNonEmptyStringParam | public static String getNonEmptyStringParam(JSONObject params, String paramName) throws ApiException {
"""
Gets the non empty string param with a given name and throws an exception accordingly if not
found or empty.
@param params the params
@param paramName the param name
@return the non empty string param
... | java | public static String getNonEmptyStringParam(JSONObject params, String paramName) throws ApiException {
if (!params.containsKey(paramName)) {
throw new ApiException(Type.MISSING_PARAMETER, paramName);
}
String value = params.getString(paramName);
if (value == null || value.isEmpty()) {
throw new ApiExcepti... | [
"public",
"static",
"String",
"getNonEmptyStringParam",
"(",
"JSONObject",
"params",
",",
"String",
"paramName",
")",
"throws",
"ApiException",
"{",
"if",
"(",
"!",
"params",
".",
"containsKey",
"(",
"paramName",
")",
")",
"{",
"throw",
"new",
"ApiException",
... | Gets the non empty string param with a given name and throws an exception accordingly if not
found or empty.
@param params the params
@param paramName the param name
@return the non empty string param
@throws ApiException the api exception thown if param not found or string empty | [
"Gets",
"the",
"non",
"empty",
"string",
"param",
"with",
"a",
"given",
"name",
"and",
"throws",
"an",
"exception",
"accordingly",
"if",
"not",
"found",
"or",
"empty",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/ApiUtils.java#L104-L113 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/background/BackgroundAbstract.java | BackgroundAbstract.createElement | public static BackgroundElement createElement(String name, int x, int y) {
"""
Create an element from a name, plus its coordinates.
@param name The element name.
@param x The location x.
@param y The location y.
@return The created element.
@throws LionEngineException If media is <code>null</code> or image ... | java | public static BackgroundElement createElement(String name, int x, int y)
{
return new BackgroundElement(x, y, createSprite(Medias.create(name)));
} | [
"public",
"static",
"BackgroundElement",
"createElement",
"(",
"String",
"name",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"new",
"BackgroundElement",
"(",
"x",
",",
"y",
",",
"createSprite",
"(",
"Medias",
".",
"create",
"(",
"name",
")",
")... | Create an element from a name, plus its coordinates.
@param name The element name.
@param x The location x.
@param y The location y.
@return The created element.
@throws LionEngineException If media is <code>null</code> or image cannot be read. | [
"Create",
"an",
"element",
"from",
"a",
"name",
"plus",
"its",
"coordinates",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/background/BackgroundAbstract.java#L45-L48 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/css/CSSModuleBuilder.java | CSSModuleBuilder.createThreadScope | protected Scriptable createThreadScope(Context cx, Scriptable protoScope) {
"""
Creates a thread scope for the PostCSS processor and it's plugins. Thread scopes allow
PostCSS to process multiple CSS modules concurrently, each executing in a separate thread,
without interfering with each other.
@param cx
the ... | java | protected Scriptable createThreadScope(Context cx, Scriptable protoScope) {
// Create the scope object
Scriptable scope = cx.newObject(protoScope);
scope.setPrototype(protoScope);
scope.setParentScope(null);
// Set "global" variable to point to global scope
scope.put("global", scope, scope); //$NO... | [
"protected",
"Scriptable",
"createThreadScope",
"(",
"Context",
"cx",
",",
"Scriptable",
"protoScope",
")",
"{",
"// Create the scope object\r",
"Scriptable",
"scope",
"=",
"cx",
".",
"newObject",
"(",
"protoScope",
")",
";",
"scope",
".",
"setPrototype",
"(",
"pr... | Creates a thread scope for the PostCSS processor and it's plugins. Thread scopes allow
PostCSS to process multiple CSS modules concurrently, each executing in a separate thread,
without interfering with each other.
@param cx
the Rhino Context
@param protoScope
the parent scope object
@return the thread scope | [
"Creates",
"a",
"thread",
"scope",
"for",
"the",
"PostCSS",
"processor",
"and",
"it",
"s",
"plugins",
".",
"Thread",
"scopes",
"allow",
"PostCSS",
"to",
"process",
"multiple",
"CSS",
"modules",
"concurrently",
"each",
"executing",
"in",
"a",
"separate",
"threa... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/css/CSSModuleBuilder.java#L940-L981 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/TypeVariableUtils.java | TypeVariableUtils.resolveAllTypeVariables | public static Type resolveAllTypeVariables(final Type type) {
"""
In contrast to {@link #resolveAllTypeVariables(Type, Map)} which replace generics in type according to
generics map, this method replace variables with their upper bound. For example, variable defined as
{@code class Root<T extends String>} and fo... | java | public static Type resolveAllTypeVariables(final Type type) {
final List<TypeVariable> vars = GenericsUtils.findVariables(type);
if (vars.isEmpty()) {
// no variables in type - nothing to replace
return type;
}
final LinkedHashMap<String, Type> generics = new Lin... | [
"public",
"static",
"Type",
"resolveAllTypeVariables",
"(",
"final",
"Type",
"type",
")",
"{",
"final",
"List",
"<",
"TypeVariable",
">",
"vars",
"=",
"GenericsUtils",
".",
"findVariables",
"(",
"type",
")",
";",
"if",
"(",
"vars",
".",
"isEmpty",
"(",
")"... | In contrast to {@link #resolveAllTypeVariables(Type, Map)} which replace generics in type according to
generics map, this method replace variables with their upper bound. For example, variable defined as
{@code class Root<T extends String>} and for type {@code List<T>} result will be {@code List<String>}
(variable T re... | [
"In",
"contrast",
"to",
"{",
"@link",
"#resolveAllTypeVariables",
"(",
"Type",
"Map",
")",
"}",
"which",
"replace",
"generics",
"in",
"type",
"according",
"to",
"generics",
"map",
"this",
"method",
"replace",
"variables",
"with",
"their",
"upper",
"bound",
"."... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/TypeVariableUtils.java#L176-L190 |
httl/httl | httl/src/main/java/httl/Engine.java | Engine.getResource | public Resource getResource(String name, String encoding) throws IOException {
"""
Get template resource.
@param name - template name
@param encoding - template encoding
@return template resource
@throws IOException - If an I/O error occurs
@see #getEngine()
"""
return getResource(name, null... | java | public Resource getResource(String name, String encoding) throws IOException {
return getResource(name, null, encoding);
} | [
"public",
"Resource",
"getResource",
"(",
"String",
"name",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"return",
"getResource",
"(",
"name",
",",
"null",
",",
"encoding",
")",
";",
"}"
] | Get template resource.
@param name - template name
@param encoding - template encoding
@return template resource
@throws IOException - If an I/O error occurs
@see #getEngine() | [
"Get",
"template",
"resource",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/Engine.java#L269-L271 |
jamesagnew/hapi-fhir | hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/IniFile.java | IniFile.getStringProperty | public String getStringProperty(String pstrSection, String pstrProp) {
"""
Returns the specified string property from the specified section.
@param pstrSection the INI section name.
@param pstrProp the property to be retrieved.
@return the string property value.
"""
String strRet = null;
... | java | public String getStringProperty(String pstrSection, String pstrProp)
{
String strRet = null;
INIProperty objProp = null;
INISection objSec = null;
objSec = (INISection) this.mhmapSections.get(pstrSection);
if (objSec != null)
{
objProp... | [
"public",
"String",
"getStringProperty",
"(",
"String",
"pstrSection",
",",
"String",
"pstrProp",
")",
"{",
"String",
"strRet",
"=",
"null",
";",
"INIProperty",
"objProp",
"=",
"null",
";",
"INISection",
"objSec",
"=",
"null",
";",
"objSec",
"=",
"(",
"INISe... | Returns the specified string property from the specified section.
@param pstrSection the INI section name.
@param pstrProp the property to be retrieved.
@return the string property value. | [
"Returns",
"the",
"specified",
"string",
"property",
"from",
"the",
"specified",
"section",
"."
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/IniFile.java#L113-L131 |
weld/core | impl/src/main/java/org/jboss/weld/util/Preconditions.java | Preconditions.checkArgumentNotNull | public static void checkArgumentNotNull(Object reference, String argumentName) {
"""
Throws {@link IllegalArgumentException} with an appropriate message if the reference is null.
@param reference the reference to be checked
@param argumentName name of the argument that is being checked. The name used in the er... | java | public static void checkArgumentNotNull(Object reference, String argumentName) {
if (reference == null) {
throw ValidatorLogger.LOG.argumentNull(argumentName);
}
} | [
"public",
"static",
"void",
"checkArgumentNotNull",
"(",
"Object",
"reference",
",",
"String",
"argumentName",
")",
"{",
"if",
"(",
"reference",
"==",
"null",
")",
"{",
"throw",
"ValidatorLogger",
".",
"LOG",
".",
"argumentNull",
"(",
"argumentName",
")",
";",... | Throws {@link IllegalArgumentException} with an appropriate message if the reference is null.
@param reference the reference to be checked
@param argumentName name of the argument that is being checked. The name used in the error message. | [
"Throws",
"{",
"@link",
"IllegalArgumentException",
"}",
"with",
"an",
"appropriate",
"message",
"if",
"the",
"reference",
"is",
"null",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Preconditions.java#L38-L42 |
Wikidata/Wikidata-Toolkit | wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFileManager.java | WmfDumpFileManager.findDumpDatesOnline | List<String> findDumpDatesOnline(DumpContentType dumpContentType) {
"""
Finds out which dump files are available for download in a given
directory. The result is a list of YYYYMMDD date stamps, ordered newest
to oldest. The list is based on the directories or files found at the
target location, without consider... | java | List<String> findDumpDatesOnline(DumpContentType dumpContentType) {
List<String> result = new ArrayList<>();
try (InputStream in = this.webResourceFetcher
.getInputStreamForUrl(WmfDumpFile.getDumpFileWebDirectory(
dumpContentType, this.projectName))) {
BufferedReader bufferedReader = new BufferedReade... | [
"List",
"<",
"String",
">",
"findDumpDatesOnline",
"(",
"DumpContentType",
"dumpContentType",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"(",
"InputStream",
"in",
"=",
"this",
".",
"webResourceFetcher... | Finds out which dump files are available for download in a given
directory. The result is a list of YYYYMMDD date stamps, ordered newest
to oldest. The list is based on the directories or files found at the
target location, without considering whether or not each dump is actually
available.
<p>
The implementation is ra... | [
"Finds",
"out",
"which",
"dump",
"files",
"are",
"available",
"for",
"download",
"in",
"a",
"given",
"directory",
".",
"The",
"result",
"is",
"a",
"list",
"of",
"YYYYMMDD",
"date",
"stamps",
"ordered",
"newest",
"to",
"oldest",
".",
"The",
"list",
"is",
... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFileManager.java#L333-L362 |
Twitter4J/Twitter4J | twitter4j-core/src/internal-json/java/twitter4j/JSONImplFactory.java | JSONImplFactory.createHashtagEntity | public static HashtagEntity createHashtagEntity(int start, int end, String text) {
"""
static factory method for twitter-text-java
@return hashtag entity
@since Twitter4J 2.2.6
"""
return new HashtagEntityJSONImpl(start, end, text);
} | java | public static HashtagEntity createHashtagEntity(int start, int end, String text) {
return new HashtagEntityJSONImpl(start, end, text);
} | [
"public",
"static",
"HashtagEntity",
"createHashtagEntity",
"(",
"int",
"start",
",",
"int",
"end",
",",
"String",
"text",
")",
"{",
"return",
"new",
"HashtagEntityJSONImpl",
"(",
"start",
",",
"end",
",",
"text",
")",
";",
"}"
] | static factory method for twitter-text-java
@return hashtag entity
@since Twitter4J 2.2.6 | [
"static",
"factory",
"method",
"for",
"twitter",
"-",
"text",
"-",
"java"
] | train | https://github.com/Twitter4J/Twitter4J/blob/8376fade8d557896bb9319fb46e39a55b134b166/twitter4j-core/src/internal-json/java/twitter4j/JSONImplFactory.java#L274-L276 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.getValue | public Double getValue(GriddedTile griddedTile, short pixelValue) {
"""
Get the coverage data value for the "unsigned short" pixel value
@param griddedTile
gridded tile
@param pixelValue
pixel value as an unsigned short
@return coverage data value
"""
int unsignedPixelValue = getUnsignedPixelValue(pix... | java | public Double getValue(GriddedTile griddedTile, short pixelValue) {
int unsignedPixelValue = getUnsignedPixelValue(pixelValue);
Double value = getValue(griddedTile, unsignedPixelValue);
return value;
} | [
"public",
"Double",
"getValue",
"(",
"GriddedTile",
"griddedTile",
",",
"short",
"pixelValue",
")",
"{",
"int",
"unsignedPixelValue",
"=",
"getUnsignedPixelValue",
"(",
"pixelValue",
")",
";",
"Double",
"value",
"=",
"getValue",
"(",
"griddedTile",
",",
"unsignedP... | Get the coverage data value for the "unsigned short" pixel value
@param griddedTile
gridded tile
@param pixelValue
pixel value as an unsigned short
@return coverage data value | [
"Get",
"the",
"coverage",
"data",
"value",
"for",
"the",
"unsigned",
"short",
"pixel",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1417-L1421 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listWorkerPoolSkusAsync | public Observable<Page<SkuInfoInner>> listWorkerPoolSkusAsync(final String resourceGroupName, final String name, final String workerPoolName) {
"""
Get available SKUs for scaling a worker pool.
Get available SKUs for scaling a worker pool.
@param resourceGroupName Name of the resource group to which the resour... | java | public Observable<Page<SkuInfoInner>> listWorkerPoolSkusAsync(final String resourceGroupName, final String name, final String workerPoolName) {
return listWorkerPoolSkusWithServiceResponseAsync(resourceGroupName, name, workerPoolName)
.map(new Func1<ServiceResponse<Page<SkuInfoInner>>, Page<SkuInfoI... | [
"public",
"Observable",
"<",
"Page",
"<",
"SkuInfoInner",
">",
">",
"listWorkerPoolSkusAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",
"workerPoolName",
")",
"{",
"return",
"listWorkerPoolSkusWithServiceResp... | Get available SKUs for scaling a worker pool.
Get available SKUs for scaling a worker pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@throws IllegalArgumentException thrown if param... | [
"Get",
"available",
"SKUs",
"for",
"scaling",
"a",
"worker",
"pool",
".",
"Get",
"available",
"SKUs",
"for",
"scaling",
"a",
"worker",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L6388-L6396 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/TypeUtils.java | TypeUtils.getMoreSpecificType | public static Type getMoreSpecificType(final Type one, final Type two) {
"""
Not resolved type variables are resolved to Object.
@param one first type
@param two second type
@return more specific type or first type if they are equal
@see #isMoreSpecific(Type, Type)
"""
return isMoreSpecific(one, ... | java | public static Type getMoreSpecificType(final Type one, final Type two) {
return isMoreSpecific(one, two) ? one : two;
} | [
"public",
"static",
"Type",
"getMoreSpecificType",
"(",
"final",
"Type",
"one",
",",
"final",
"Type",
"two",
")",
"{",
"return",
"isMoreSpecific",
"(",
"one",
",",
"two",
")",
"?",
"one",
":",
"two",
";",
"}"
] | Not resolved type variables are resolved to Object.
@param one first type
@param two second type
@return more specific type or first type if they are equal
@see #isMoreSpecific(Type, Type) | [
"Not",
"resolved",
"type",
"variables",
"are",
"resolved",
"to",
"Object",
"."
] | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/TypeUtils.java#L185-L187 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java | SceneStructureCommon.setPoint | public void setPoint( int which , double x , double y , double z ) {
"""
Specifies the location of a point in 3D space
@param which Which point is being specified
@param x coordinate along x-axis
@param y coordinate along y-axis
@param z coordinate along z-axis
"""
points[which].set(x,y,z);
} | java | public void setPoint( int which , double x , double y , double z ) {
points[which].set(x,y,z);
} | [
"public",
"void",
"setPoint",
"(",
"int",
"which",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"points",
"[",
"which",
"]",
".",
"set",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"}"
] | Specifies the location of a point in 3D space
@param which Which point is being specified
@param x coordinate along x-axis
@param y coordinate along y-axis
@param z coordinate along z-axis | [
"Specifies",
"the",
"location",
"of",
"a",
"point",
"in",
"3D",
"space"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureCommon.java#L52-L54 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java | FourierTransform.FFT | private static void FFT(double[] real, double[] imag) {
"""
/*
Computes the discrete Fourier transform (DFT) of the given complex vector, storing the result back into the vector.
The vector can have any length. This is a wrapper function.
"""
int n = real.length;
if (n == 0) {
... | java | private static void FFT(double[] real, double[] imag) {
int n = real.length;
if (n == 0) {
return;
} else if ((n & (n - 1)) == 0) // Is power of 2
transformRadix2(real, imag);
else // More complicated algorithm for arbitrary sizes
transformBlu... | [
"private",
"static",
"void",
"FFT",
"(",
"double",
"[",
"]",
"real",
",",
"double",
"[",
"]",
"imag",
")",
"{",
"int",
"n",
"=",
"real",
".",
"length",
";",
"if",
"(",
"n",
"==",
"0",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"(",
"n",... | /*
Computes the discrete Fourier transform (DFT) of the given complex vector, storing the result back into the vector.
The vector can have any length. This is a wrapper function. | [
"/",
"*",
"Computes",
"the",
"discrete",
"Fourier",
"transform",
"(",
"DFT",
")",
"of",
"the",
"given",
"complex",
"vector",
"storing",
"the",
"result",
"back",
"into",
"the",
"vector",
".",
"The",
"vector",
"can",
"have",
"any",
"length",
".",
"This",
"... | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java#L229-L237 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java | SpiderService.termIndexRowKey | public static String termIndexRowKey(TableDefinition tableDef, DBObject dbObj, String fieldName, String term) {
"""
Create the Terms row key for the given table, object, field name, and term.
@param tableDef {@link TableDefinition} of table that owns object.
@param dbObj DBObject that owns field.
@param ... | java | public static String termIndexRowKey(TableDefinition tableDef, DBObject dbObj, String fieldName, String term) {
StringBuilder termRecKey = new StringBuilder();
int shardNumber = tableDef.getShardNumber(dbObj);
if (shardNumber > 0) {
termRecKey.append(shardNumber);
te... | [
"public",
"static",
"String",
"termIndexRowKey",
"(",
"TableDefinition",
"tableDef",
",",
"DBObject",
"dbObj",
",",
"String",
"fieldName",
",",
"String",
"term",
")",
"{",
"StringBuilder",
"termRecKey",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"shardNu... | Create the Terms row key for the given table, object, field name, and term.
@param tableDef {@link TableDefinition} of table that owns object.
@param dbObj DBObject that owns field.
@param fieldName Field name.
@param term Term to be indexed.
@return | [
"Create",
"the",
"Terms",
"row",
"key",
"for",
"the",
"given",
"table",
"object",
"field",
"name",
"and",
"term",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java#L380-L389 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/DBManagerService.java | DBManagerService.sameTenantDefs | private static boolean sameTenantDefs(TenantDefinition tenantDef1, TenantDefinition tenantDef2) {
"""
stamps, allowing for either property to be null for older definitions.
"""
return isEqual(tenantDef1.getProperty(TenantService.CREATED_ON_PROP),
tenantDef2.getProperty(TenantServ... | java | private static boolean sameTenantDefs(TenantDefinition tenantDef1, TenantDefinition tenantDef2) {
return isEqual(tenantDef1.getProperty(TenantService.CREATED_ON_PROP),
tenantDef2.getProperty(TenantService.CREATED_ON_PROP)) &&
isEqual(tenantDef1.getProperty(TenantService.CRE... | [
"private",
"static",
"boolean",
"sameTenantDefs",
"(",
"TenantDefinition",
"tenantDef1",
",",
"TenantDefinition",
"tenantDef2",
")",
"{",
"return",
"isEqual",
"(",
"tenantDef1",
".",
"getProperty",
"(",
"TenantService",
".",
"CREATED_ON_PROP",
")",
",",
"tenantDef2",
... | stamps, allowing for either property to be null for older definitions. | [
"stamps",
"allowing",
"for",
"either",
"property",
"to",
"be",
"null",
"for",
"older",
"definitions",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBManagerService.java#L260-L265 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MessageListenerSetter.java | MessageListenerSetter.setMessageListener | public void setMessageListener(MessageConsumer consumer, MessageListener listener) throws JMSException {
"""
Assign a messageListener to the message consumer.
@see com.ibm.wsspi.jms.JmsMessageListenerSupport.MessageListenerSetter#setMessageListener(javax.jms.MessageConsumer, javax.jms.MessageListener)
"""
... | java | public void setMessageListener(MessageConsumer consumer, MessageListener listener) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setMessageListener", new Object[]{consumer, listener});
if (!(consumer instanceof JmsMsgConsumerImpl)) {
// This... | [
"public",
"void",
"setMessageListener",
"(",
"MessageConsumer",
"consumer",
",",
"MessageListener",
"listener",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",... | Assign a messageListener to the message consumer.
@see com.ibm.wsspi.jms.JmsMessageListenerSupport.MessageListenerSetter#setMessageListener(javax.jms.MessageConsumer, javax.jms.MessageListener) | [
"Assign",
"a",
"messageListener",
"to",
"the",
"message",
"consumer",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MessageListenerSetter.java#L36-L57 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/DiagnosticRenderUtil.java | DiagnosticRenderUtil.renderDiagnostics | public static void renderDiagnostics(final Diagnosable component, final WebXmlRenderContext renderContext) {
"""
Render diagnostics for the component.
@param component the component being rendered
@param renderContext the RenderContext to paint to.
"""
List<Diagnostic> diags = component.getDiagnostics(Diag... | java | public static void renderDiagnostics(final Diagnosable component, final WebXmlRenderContext renderContext) {
List<Diagnostic> diags = component.getDiagnostics(Diagnostic.ERROR);
if (diags != null) {
renderHelper(renderContext, component, diags, Diagnostic.ERROR);
}
diags = component.getDiagnostics(Diagnostic... | [
"public",
"static",
"void",
"renderDiagnostics",
"(",
"final",
"Diagnosable",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"List",
"<",
"Diagnostic",
">",
"diags",
"=",
"component",
".",
"getDiagnostics",
"(",
"Diagnostic",
".",
"ER... | Render diagnostics for the component.
@param component the component being rendered
@param renderContext the RenderContext to paint to. | [
"Render",
"diagnostics",
"for",
"the",
"component",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/DiagnosticRenderUtil.java#L87-L104 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.exclusiveBetween | public static double exclusiveBetween(double start, double end, double value, String message) {
"""
Validate that the specified primitive value falls between the two exclusive values specified; otherwise, throws an exception with the specified message.
<pre>Validate.exclusiveBetween(0.1, 2.1, 1.1, "Not in range")... | java | public static double exclusiveBetween(double start, double end, double value, String message) {
return INSTANCE.exclusiveBetween(start, end, value, message);
} | [
"public",
"static",
"double",
"exclusiveBetween",
"(",
"double",
"start",
",",
"double",
"end",
",",
"double",
"value",
",",
"String",
"message",
")",
"{",
"return",
"INSTANCE",
".",
"exclusiveBetween",
"(",
"start",
",",
"end",
",",
"value",
",",
"message",... | Validate that the specified primitive value falls between the two exclusive values specified; otherwise, throws an exception with the specified message.
<pre>Validate.exclusiveBetween(0.1, 2.1, 1.1, "Not in range");</pre>
@param start
the exclusive start value
@param end
the exclusive end value
@param value
the value ... | [
"Validate",
"that",
"the",
"specified",
"primitive",
"value",
"falls",
"between",
"the",
"two",
"exclusive",
"values",
"specified",
";",
"otherwise",
"throws",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<pre",
">",
"Validate",
".",
"exclusiv... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L1685-L1687 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/launchable/LauncherModel.java | LauncherModel.computeVector | private Force computeVector(Force vector, Localizable target) {
"""
Compute the force vector depending of the target.
@param vector The initial vector used for launch.
@param target The target reference.
@return The computed force to reach target.
"""
final double sx = localizable.getX();
... | java | private Force computeVector(Force vector, Localizable target)
{
final double sx = localizable.getX();
final double sy = localizable.getY();
double dx = target.getX();
double dy = target.getY();
if (target instanceof Transformable)
{
final Trans... | [
"private",
"Force",
"computeVector",
"(",
"Force",
"vector",
",",
"Localizable",
"target",
")",
"{",
"final",
"double",
"sx",
"=",
"localizable",
".",
"getX",
"(",
")",
";",
"final",
"double",
"sy",
"=",
"localizable",
".",
"getY",
"(",
")",
";",
"double... | Compute the force vector depending of the target.
@param vector The initial vector used for launch.
@param target The target reference.
@return The computed force to reach target. | [
"Compute",
"the",
"force",
"vector",
"depending",
"of",
"the",
"target",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/launchable/LauncherModel.java#L205-L233 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/net/NetworkUtils.java | NetworkUtils.parsePort | public static int parsePort(String port, Integer defaultPort) {
"""
Parses the given {@link String} as a numeric port number.
@param port {@link String} to parse as a numeric port number.
@param defaultPort {@link Integer} value used as the default port number
if the {@link String} port number is not valid.
... | java | public static int parsePort(String port, Integer defaultPort) {
try {
return Integer.parseInt(trim(port));
}
catch (NumberFormatException cause) {
return Optional.ofNullable(defaultPort)
.orElseThrow(() -> newIllegalArgumentException(cause, "Port [%s] is not valid", port));
}
} | [
"public",
"static",
"int",
"parsePort",
"(",
"String",
"port",
",",
"Integer",
"defaultPort",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"trim",
"(",
"port",
")",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"cause",
")",
"... | Parses the given {@link String} as a numeric port number.
@param port {@link String} to parse as a numeric port number.
@param defaultPort {@link Integer} value used as the default port number
if the {@link String} port number is not valid.
@return a numeric port number from the given {@link String}.
@throws IllegalAr... | [
"Parses",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"a",
"numeric",
"port",
"number",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/net/NetworkUtils.java#L170-L178 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withByteArray | public Postcard withByteArray(@Nullable String key, @Nullable byte[] value) {
"""
Inserts a byte array value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a byte array object, or null
@return curr... | java | public Postcard withByteArray(@Nullable String key, @Nullable byte[] value) {
mBundle.putByteArray(key, value);
return this;
} | [
"public",
"Postcard",
"withByteArray",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"byte",
"[",
"]",
"value",
")",
"{",
"mBundle",
".",
"putByteArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a byte array value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a byte array object, or null
@return current | [
"Inserts",
"a",
"byte",
"array",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L481-L484 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java | PickerUtilities.localDateToString | static public String localDateToString(LocalDate date, String emptyDateString) {
"""
localDateToString, This returns the supplied date in the ISO-8601 format (uuuu-MM-dd). For
any CE years that are between 0 and 9999 inclusive, the output will have a fixed length of 10
characters. Years before or after that rang... | java | static public String localDateToString(LocalDate date, String emptyDateString) {
return (date == null) ? emptyDateString : date.toString();
} | [
"static",
"public",
"String",
"localDateToString",
"(",
"LocalDate",
"date",
",",
"String",
"emptyDateString",
")",
"{",
"return",
"(",
"date",
"==",
"null",
")",
"?",
"emptyDateString",
":",
"date",
".",
"toString",
"(",
")",
";",
"}"
] | localDateToString, This returns the supplied date in the ISO-8601 format (uuuu-MM-dd). For
any CE years that are between 0 and 9999 inclusive, the output will have a fixed length of 10
characters. Years before or after that range will output longer strings. If the date is null,
this will return the value of emptyDateSt... | [
"localDateToString",
"This",
"returns",
"the",
"supplied",
"date",
"in",
"the",
"ISO",
"-",
"8601",
"format",
"(",
"uuuu",
"-",
"MM",
"-",
"dd",
")",
".",
"For",
"any",
"CE",
"years",
"that",
"are",
"between",
"0",
"and",
"9999",
"inclusive",
"the",
"o... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java#L190-L192 |
arquillian/arquillian-extension-warp | impl/src/main/java/org/jboss/arquillian/warp/impl/utils/Rethrow.java | Rethrow.asUnchecked | public static void asUnchecked(Throwable t, Class<? extends RuntimeException> checkedExceptionWrapper) {
"""
Checks whether given throwable is unchecked and if not, it will be wrapped as unchecked exception of given type
"""
if (t instanceof AssertionError) {
throw (AssertionError) t;
... | java | public static void asUnchecked(Throwable t, Class<? extends RuntimeException> checkedExceptionWrapper) {
if (t instanceof AssertionError) {
throw (AssertionError) t;
} else if (t instanceof RuntimeException) {
throw (RuntimeException) t;
} else {
RuntimeExcept... | [
"public",
"static",
"void",
"asUnchecked",
"(",
"Throwable",
"t",
",",
"Class",
"<",
"?",
"extends",
"RuntimeException",
">",
"checkedExceptionWrapper",
")",
"{",
"if",
"(",
"t",
"instanceof",
"AssertionError",
")",
"{",
"throw",
"(",
"AssertionError",
")",
"t... | Checks whether given throwable is unchecked and if not, it will be wrapped as unchecked exception of given type | [
"Checks",
"whether",
"given",
"throwable",
"is",
"unchecked",
"and",
"if",
"not",
"it",
"will",
"be",
"wrapped",
"as",
"unchecked",
"exception",
"of",
"given",
"type"
] | train | https://github.com/arquillian/arquillian-extension-warp/blob/e958f4d782851baf7f40e39835d3d1ad185b74dd/impl/src/main/java/org/jboss/arquillian/warp/impl/utils/Rethrow.java#L41-L55 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/UserLayoutManagerFactory.java | UserLayoutManagerFactory.getUserLayoutManager | public IUserLayoutManager getUserLayoutManager(IPerson person, IUserProfile profile)
throws PortalException {
"""
Obtain a regular user layout manager implementation (which allows transient layout
alterations). The specific layout type depends on whether the user is a guest user.
@return an <code>I... | java | public IUserLayoutManager getUserLayoutManager(IPerson person, IUserProfile profile)
throws PortalException {
final IUserLayoutManager userLayoutManager =
(IUserLayoutManager)
this.beanFactory.getBean(
USER_LAYOUT_MANAGER_PROTOT... | [
"public",
"IUserLayoutManager",
"getUserLayoutManager",
"(",
"IPerson",
"person",
",",
"IUserProfile",
"profile",
")",
"throws",
"PortalException",
"{",
"final",
"IUserLayoutManager",
"userLayoutManager",
"=",
"(",
"IUserLayoutManager",
")",
"this",
".",
"beanFactory",
... | Obtain a regular user layout manager implementation (which allows transient layout
alterations). The specific layout type depends on whether the user is a guest user.
@return an <code>IUserLayoutManager</code> value | [
"Obtain",
"a",
"regular",
"user",
"layout",
"manager",
"implementation",
"(",
"which",
"allows",
"transient",
"layout",
"alterations",
")",
".",
"The",
"specific",
"layout",
"type",
"depends",
"on",
"whether",
"the",
"user",
"is",
"a",
"guest",
"user",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/UserLayoutManagerFactory.java#L44-L55 |
yan74/afplib | org.afplib/src/main/java/org/afplib/base/util/BaseValidator.java | BaseValidator.validateModcaString4_MinLength | public boolean validateModcaString4_MinLength(String modcaString4, DiagnosticChain diagnostics, Map<Object, Object> context) {
"""
Validates the MinLength constraint of '<em>Modca String4</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated
"""
int length = modcaString4.length();
boolean resu... | java | public boolean validateModcaString4_MinLength(String modcaString4, DiagnosticChain diagnostics, Map<Object, Object> context) {
int length = modcaString4.length();
boolean result = length >= 4;
if (!result && diagnostics != null)
reportMinLengthViolation(BasePackage.Literals.MODCA_STRING4, modcaString4, length,... | [
"public",
"boolean",
"validateModcaString4_MinLength",
"(",
"String",
"modcaString4",
",",
"DiagnosticChain",
"diagnostics",
",",
"Map",
"<",
"Object",
",",
"Object",
">",
"context",
")",
"{",
"int",
"length",
"=",
"modcaString4",
".",
"length",
"(",
")",
";",
... | Validates the MinLength constraint of '<em>Modca String4</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"Validates",
"the",
"MinLength",
"constraint",
"of",
"<em",
">",
"Modca",
"String4<",
"/",
"em",
">",
".",
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | train | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/base/util/BaseValidator.java#L186-L192 |
square/javapoet | src/main/java/com/squareup/javapoet/CodeWriter.java | CodeWriter.emitModifiers | public void emitModifiers(Set<Modifier> modifiers, Set<Modifier> implicitModifiers)
throws IOException {
"""
Emits {@code modifiers} in the standard order. Modifiers in {@code implicitModifiers} will not
be emitted.
"""
if (modifiers.isEmpty()) return;
for (Modifier modifier : EnumSet.copyOf(mod... | java | public void emitModifiers(Set<Modifier> modifiers, Set<Modifier> implicitModifiers)
throws IOException {
if (modifiers.isEmpty()) return;
for (Modifier modifier : EnumSet.copyOf(modifiers)) {
if (implicitModifiers.contains(modifier)) continue;
emitAndIndent(modifier.name().toLowerCase(Locale.U... | [
"public",
"void",
"emitModifiers",
"(",
"Set",
"<",
"Modifier",
">",
"modifiers",
",",
"Set",
"<",
"Modifier",
">",
"implicitModifiers",
")",
"throws",
"IOException",
"{",
"if",
"(",
"modifiers",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"for",
"(",
... | Emits {@code modifiers} in the standard order. Modifiers in {@code implicitModifiers} will not
be emitted. | [
"Emits",
"{"
] | train | https://github.com/square/javapoet/blob/0f93da9a3d9a1da8d29fc993409fcf83d40452bc/src/main/java/com/squareup/javapoet/CodeWriter.java#L170-L178 |
wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getBooleanWithDefault | @Override
public Boolean getBooleanWithDefault(final String key, Boolean defaultValue) {
"""
Get a Boolean property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value... | java | @Override
public Boolean getBooleanWithDefault(final String key, Boolean defaultValue) {
return retrieve(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return configuration.getBoolean(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"Boolean",
"getBooleanWithDefault",
"(",
"final",
"String",
"key",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boolean",
"c... | Get a Boolean property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"Boolean",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L227-L236 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java | AbstractFlagEncoder.createEncodedValues | public void createEncodedValues(List<EncodedValue> registerNewEncodedValue, String prefix, int index) {
"""
Defines bits used for edge flags used for access, speed etc.
@return incremented shift value pointing behind the last used bit
"""
// define the first 2 speedBits in flags for routing
... | java | public void createEncodedValues(List<EncodedValue> registerNewEncodedValue, String prefix, int index) {
// define the first 2 speedBits in flags for routing
registerNewEncodedValue.add(accessEnc = new SimpleBooleanEncodedValue(prefix + "access", true));
roundaboutEnc = getBooleanEncodedValue(Enc... | [
"public",
"void",
"createEncodedValues",
"(",
"List",
"<",
"EncodedValue",
">",
"registerNewEncodedValue",
",",
"String",
"prefix",
",",
"int",
"index",
")",
"{",
"// define the first 2 speedBits in flags for routing",
"registerNewEncodedValue",
".",
"add",
"(",
"accessEn... | Defines bits used for edge flags used for access, speed etc.
@return incremented shift value pointing behind the last used bit | [
"Defines",
"bits",
"used",
"for",
"edge",
"flags",
"used",
"for",
"access",
"speed",
"etc",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java#L168-L173 |
VoltDB/voltdb | src/frontend/org/voltdb/export/ExportGeneration.java | ExportGeneration.sendDummyTakeMastershipResponse | private void sendDummyTakeMastershipResponse(long sourceHsid, long requestId, int partitionId, byte[] signatureBytes) {
"""
Auto reply a response when the requested stream is no longer exists
"""
// msg type(1) + partition:int(4) + length:int(4) + signaturesBytes.length
// requestId(8)
... | java | private void sendDummyTakeMastershipResponse(long sourceHsid, long requestId, int partitionId, byte[] signatureBytes) {
// msg type(1) + partition:int(4) + length:int(4) + signaturesBytes.length
// requestId(8)
int msgLen = 1 + 4 + 4 + signatureBytes.length + 8;
ByteBuffer buf = ByteBuff... | [
"private",
"void",
"sendDummyTakeMastershipResponse",
"(",
"long",
"sourceHsid",
",",
"long",
"requestId",
",",
"int",
"partitionId",
",",
"byte",
"[",
"]",
"signatureBytes",
")",
"{",
"// msg type(1) + partition:int(4) + length:int(4) + signaturesBytes.length",
"// requestId... | Auto reply a response when the requested stream is no longer exists | [
"Auto",
"reply",
"a",
"response",
"when",
"the",
"requested",
"stream",
"is",
"no",
"longer",
"exists"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/export/ExportGeneration.java#L447-L465 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addClosedListAsync | public Observable<UUID> addClosedListAsync(UUID appId, String versionId, ClosedListModelCreateObject closedListModelCreateObject) {
"""
Adds a closed list model to the application.
@param appId The application ID.
@param versionId The version ID.
@param closedListModelCreateObject A model containing the name ... | java | public Observable<UUID> addClosedListAsync(UUID appId, String versionId, ClosedListModelCreateObject closedListModelCreateObject) {
return addClosedListWithServiceResponseAsync(appId, versionId, closedListModelCreateObject).map(new Func1<ServiceResponse<UUID>, UUID>() {
@Override
public ... | [
"public",
"Observable",
"<",
"UUID",
">",
"addClosedListAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ClosedListModelCreateObject",
"closedListModelCreateObject",
")",
"{",
"return",
"addClosedListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId"... | Adds a closed list model to the application.
@param appId The application ID.
@param versionId The version ID.
@param closedListModelCreateObject A model containing the name and words for the new closed list entity extractor.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observa... | [
"Adds",
"a",
"closed",
"list",
"model",
"to",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2025-L2032 |
networknt/light-4j | client/src/main/java/org/apache/hc/core5/http/message/copied/TokenParser.java | TokenParser.skipWhiteSpace | public void skipWhiteSpace(final CharSequence buf, final ParserCursor cursor) {
"""
Skips semantically insignificant whitespace characters and moves the cursor to the closest
non-whitespace character.
@param buf buffer with the sequence of chars to be parsed
@param cursor defines the bounds and current positi... | java | public void skipWhiteSpace(final CharSequence buf, final ParserCursor cursor) {
Args.notNull(buf, "Char sequence");
Args.notNull(cursor, "Parser cursor");
int pos = cursor.getPos();
final int indexFrom = cursor.getPos();
final int indexTo = cursor.getUpperBound();
for (in... | [
"public",
"void",
"skipWhiteSpace",
"(",
"final",
"CharSequence",
"buf",
",",
"final",
"ParserCursor",
"cursor",
")",
"{",
"Args",
".",
"notNull",
"(",
"buf",
",",
"\"Char sequence\"",
")",
";",
"Args",
".",
"notNull",
"(",
"cursor",
",",
"\"Parser cursor\"",
... | Skips semantically insignificant whitespace characters and moves the cursor to the closest
non-whitespace character.
@param buf buffer with the sequence of chars to be parsed
@param cursor defines the bounds and current position of the buffer | [
"Skips",
"semantically",
"insignificant",
"whitespace",
"characters",
"and",
"moves",
"the",
"cursor",
"to",
"the",
"closest",
"non",
"-",
"whitespace",
"character",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/org/apache/hc/core5/http/message/copied/TokenParser.java#L138-L152 |
alkacon/opencms-core | src/org/opencms/module/CmsModuleUpdater.java | CmsModuleUpdater.deleteConflictingResources | protected void deleteConflictingResources(CmsObject cms, CmsModule module, Map<CmsUUID, CmsUUID> conflictingIds)
throws CmsException, Exception {
"""
Deletes and publishes resources with ID conflicts.
@param cms the CMS context to use
@param module the module
@param conflictingIds the conflicting ids
@th... | java | protected void deleteConflictingResources(CmsObject cms, CmsModule module, Map<CmsUUID, CmsUUID> conflictingIds)
throws CmsException, Exception {
CmsProject conflictProject = cms.createProject(
"Deletion of conflicting resources for " + module.getName(),
"Deletion of conflicting res... | [
"protected",
"void",
"deleteConflictingResources",
"(",
"CmsObject",
"cms",
",",
"CmsModule",
"module",
",",
"Map",
"<",
"CmsUUID",
",",
"CmsUUID",
">",
"conflictingIds",
")",
"throws",
"CmsException",
",",
"Exception",
"{",
"CmsProject",
"conflictProject",
"=",
"... | Deletes and publishes resources with ID conflicts.
@param cms the CMS context to use
@param module the module
@param conflictingIds the conflicting ids
@throws CmsException if something goes wrong
@throws Exception if something goes wrong | [
"Deletes",
"and",
"publishes",
"resources",
"with",
"ID",
"conflicts",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModuleUpdater.java#L424-L442 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/temperature/TemperatureConversion.java | TemperatureConversion.convertToRankine | public static double convertToRankine(TemperatureScale from, double temperature) {
"""
Convert a temperature value from another temperature scale into the Rankine temperature scale.
@param from TemperatureScale
@param temperature value from other scale
@return converted temperature value in degrees Rankine
... | java | public static double convertToRankine(TemperatureScale from, double temperature) {
switch(from) {
case FARENHEIT:
return convertFarenheitToRankine(temperature);
case CELSIUS:
return convertCelsiusToRankine(temperature);
case KELVIN:
... | [
"public",
"static",
"double",
"convertToRankine",
"(",
"TemperatureScale",
"from",
",",
"double",
"temperature",
")",
"{",
"switch",
"(",
"from",
")",
"{",
"case",
"FARENHEIT",
":",
"return",
"convertFarenheitToRankine",
"(",
"temperature",
")",
";",
"case",
"CE... | Convert a temperature value from another temperature scale into the Rankine temperature scale.
@param from TemperatureScale
@param temperature value from other scale
@return converted temperature value in degrees Rankine | [
"Convert",
"a",
"temperature",
"value",
"from",
"another",
"temperature",
"scale",
"into",
"the",
"Rankine",
"temperature",
"scale",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/temperature/TemperatureConversion.java#L241-L256 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/CopySoundexHandler.java | CopySoundexHandler.init | public void init(BaseField field, String iFieldSeq) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param iFieldSeq The field to move the destination soundex to.
"""
super.init(field);
m_iFieldSeq = iFieldSeq;
m_bReadMove = ... | java | public void init(BaseField field, String iFieldSeq)
{
super.init(field);
m_iFieldSeq = iFieldSeq;
m_bReadMove = false;
} | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"String",
"iFieldSeq",
")",
"{",
"super",
".",
"init",
"(",
"field",
")",
";",
"m_iFieldSeq",
"=",
"iFieldSeq",
";",
"m_bReadMove",
"=",
"false",
";",
"}"
] | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param iFieldSeq The field to move the destination soundex to. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CopySoundexHandler.java#L49-L55 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java | ArrayUtil.countSameElements | public static int countSameElements(byte[] arra, int start, byte[] arrb) {
"""
Returns the count of elements in arra from position start that are
sequentially equal to the elements of arrb.
"""
int k = 0;
int limit = arra.length - start;
if (limit > arrb.length) {
lim... | java | public static int countSameElements(byte[] arra, int start, byte[] arrb) {
int k = 0;
int limit = arra.length - start;
if (limit > arrb.length) {
limit = arrb.length;
}
for (int i = 0; i < limit; i++) {
if (arra[i + start] == arrb[i]) {
... | [
"public",
"static",
"int",
"countSameElements",
"(",
"byte",
"[",
"]",
"arra",
",",
"int",
"start",
",",
"byte",
"[",
"]",
"arrb",
")",
"{",
"int",
"k",
"=",
"0",
";",
"int",
"limit",
"=",
"arra",
".",
"length",
"-",
"start",
";",
"if",
"(",
"lim... | Returns the count of elements in arra from position start that are
sequentially equal to the elements of arrb. | [
"Returns",
"the",
"count",
"of",
"elements",
"in",
"arra",
"from",
"position",
"start",
"that",
"are",
"sequentially",
"equal",
"to",
"the",
"elements",
"of",
"arrb",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java#L518-L536 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/util/RequestParameterBuilder.java | RequestParameterBuilder.encodeJson | public String encodeJson(Object value, String type) throws UnsupportedEncodingException {
"""
Convertes give value to JSON and encodes the converted value with a proper encoding. Data type is sometimes required, especially for Java generic types,
because type information is erased at runtime and the conversion to... | java | public String encodeJson(Object value, String type) throws UnsupportedEncodingException {
jsonConverter.setType(type);
String jsonValue;
if (value == null) {
jsonValue = "null";
}
else {
jsonValue = jsonConverter.getAsString(null, null, value);
}
... | [
"public",
"String",
"encodeJson",
"(",
"Object",
"value",
",",
"String",
"type",
")",
"throws",
"UnsupportedEncodingException",
"{",
"jsonConverter",
".",
"setType",
"(",
"type",
")",
";",
"String",
"jsonValue",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{... | Convertes give value to JSON and encodes the converted value with a proper encoding. Data type is sometimes required, especially for Java generic types,
because type information is erased at runtime and the conversion to JSON will not work properly.
@param value value to be converted and encoded
@param type data type ... | [
"Convertes",
"give",
"value",
"to",
"JSON",
"and",
"encodes",
"the",
"converted",
"value",
"with",
"a",
"proper",
"encoding",
".",
"Data",
"type",
"is",
"sometimes",
"required",
"especially",
"for",
"Java",
"generic",
"types",
"because",
"type",
"information",
... | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/util/RequestParameterBuilder.java#L202-L214 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator._generate | protected void _generate(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param enumeration the enumeration.
@param it the target for the generated content.
@param context the context.
"""
generateEnumerationDeclaration(enumeration, ... | java | protected void _generate(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
generateEnumerationDeclaration(enumeration, it, context);
} | [
"protected",
"void",
"_generate",
"(",
"SarlEnumeration",
"enumeration",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"generateEnumerationDeclaration",
"(",
"enumeration",
",",
"it",
",",
"context",
")",
";",
"}"
] | Generate the given object.
@param enumeration the enumeration.
@param it the target for the generated content.
@param context the context. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L913-L915 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.updateMultiRolePool | public WorkerPoolResourceInner updateMultiRolePool(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) {
"""
Create or update a multi-role pool.
Create or update a multi-role pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name ... | java | public WorkerPoolResourceInner updateMultiRolePool(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) {
return updateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).toBlocking().single().body();
} | [
"public",
"WorkerPoolResourceInner",
"updateMultiRolePool",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"WorkerPoolResourceInner",
"multiRolePoolEnvelope",
")",
"{",
"return",
"updateMultiRolePoolWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"nam... | Create or update a multi-role pool.
Create or update a multi-role pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param multiRolePoolEnvelope Properties of the multi-role pool.
@throws IllegalArgumentException thrown if paramete... | [
"Create",
"or",
"update",
"a",
"multi",
"-",
"role",
"pool",
".",
"Create",
"or",
"update",
"a",
"multi",
"-",
"role",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L2456-L2458 |
guardtime/ksi-java-sdk | ksi-service-client-apache-http/src/main/java/com/guardtime/ksi/service/client/http/apache/AbstractApacheHttpClient.java | AbstractApacheHttpClient.createClient | private CloseableHttpAsyncClient createClient(HttpSettings settings, ApacheHttpClientConfiguration conf) {
"""
Creates asynchronous Apache HTTP client.
@param settings
settings to use to create client.
@param conf
configuration related to async connection.
@return Instance of {@link CloseableHttpAsyncClient... | java | private CloseableHttpAsyncClient createClient(HttpSettings settings, ApacheHttpClientConfiguration conf) {
IOReactorConfig ioReactor = IOReactorConfig.custom().setIoThreadCount(conf.getMaxThreadCount()).build();
HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClients.custom()
.useSys... | [
"private",
"CloseableHttpAsyncClient",
"createClient",
"(",
"HttpSettings",
"settings",
",",
"ApacheHttpClientConfiguration",
"conf",
")",
"{",
"IOReactorConfig",
"ioReactor",
"=",
"IOReactorConfig",
".",
"custom",
"(",
")",
".",
"setIoThreadCount",
"(",
"conf",
".",
... | Creates asynchronous Apache HTTP client.
@param settings
settings to use to create client.
@param conf
configuration related to async connection.
@return Instance of {@link CloseableHttpAsyncClient}. | [
"Creates",
"asynchronous",
"Apache",
"HTTP",
"client",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-service-client-apache-http/src/main/java/com/guardtime/ksi/service/client/http/apache/AbstractApacheHttpClient.java#L128-L142 |
pravega/pravega | common/src/main/java/io/pravega/common/function/Callbacks.java | Callbacks.invokeSafely | public static <T1, T2> void invokeSafely(BiConsumer<T1, T2> consumer, T1 argument1, T2 argument2, Consumer<Throwable> failureHandler) {
"""
Invokes the given Consumer with the given argument, and catches any exceptions that it may throw.
@param consumer The consumer to invoke.
@param argument1 The f... | java | public static <T1, T2> void invokeSafely(BiConsumer<T1, T2> consumer, T1 argument1, T2 argument2, Consumer<Throwable> failureHandler) {
Preconditions.checkNotNull(consumer, "consumer");
try {
consumer.accept(argument1, argument2);
} catch (Exception ex) {
if (failureHand... | [
"public",
"static",
"<",
"T1",
",",
"T2",
">",
"void",
"invokeSafely",
"(",
"BiConsumer",
"<",
"T1",
",",
"T2",
">",
"consumer",
",",
"T1",
"argument1",
",",
"T2",
"argument2",
",",
"Consumer",
"<",
"Throwable",
">",
"failureHandler",
")",
"{",
"Precondi... | Invokes the given Consumer with the given argument, and catches any exceptions that it may throw.
@param consumer The consumer to invoke.
@param argument1 The first argument to pass to the consumer.
@param argument2 The second argument to pass to the consumer.
@param failureHandler An optional callback... | [
"Invokes",
"the",
"given",
"Consumer",
"with",
"the",
"given",
"argument",
"and",
"catches",
"any",
"exceptions",
"that",
"it",
"may",
"throw",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/function/Callbacks.java#L73-L83 |
kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/PatternCacheControl.java | PatternCacheControl.parseDirectiveWithValue | private void parseDirectiveWithValue(String directiveName, String directiveValue) {
"""
Adds a directive with the associated value to the directives map, after parsing the value from the configuration file
@param directiveName
@param directiveValue
"""
Directive directive;
if (directiveName.e... | java | private void parseDirectiveWithValue(String directiveName, String directiveValue) {
Directive directive;
if (directiveName.equals(Directive.MAX_AGE.getName())) {
if (directiveValue.startsWith(M_PLUS_STRING)) {
directiveValue = directiveValue.replace(M_PLUS_STRING, EMPTY_STRIN... | [
"private",
"void",
"parseDirectiveWithValue",
"(",
"String",
"directiveName",
",",
"String",
"directiveValue",
")",
"{",
"Directive",
"directive",
";",
"if",
"(",
"directiveName",
".",
"equals",
"(",
"Directive",
".",
"MAX_AGE",
".",
"getName",
"(",
")",
")",
... | Adds a directive with the associated value to the directives map, after parsing the value from the configuration file
@param directiveName
@param directiveValue | [
"Adds",
"a",
"directive",
"with",
"the",
"associated",
"value",
"to",
"the",
"directives",
"map",
"after",
"parsing",
"the",
"value",
"from",
"the",
"configuration",
"file"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/PatternCacheControl.java#L134-L148 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDataJsonFieldBo.java | BaseDataJsonFieldBo.setDataAttr | public BaseDataJsonFieldBo setDataAttr(String dPath, Object value) {
"""
Set a "data"'s sub-attribute using d-path.
@param dPath
@param value
@return
@see DPathUtils
"""
if (value == null) {
return removeDataAttr(dPath);
}
Lock lock = lockForWrite();
try {
... | java | public BaseDataJsonFieldBo setDataAttr(String dPath, Object value) {
if (value == null) {
return removeDataAttr(dPath);
}
Lock lock = lockForWrite();
try {
if (dataJson == null || dataJson instanceof MissingNode
|| dataJson instanceof NullNode)... | [
"public",
"BaseDataJsonFieldBo",
"setDataAttr",
"(",
"String",
"dPath",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"removeDataAttr",
"(",
"dPath",
")",
";",
"}",
"Lock",
"lock",
"=",
"lockForWrite",
"(",
")",
... | Set a "data"'s sub-attribute using d-path.
@param dPath
@param value
@return
@see DPathUtils | [
"Set",
"a",
"data",
"s",
"sub",
"-",
"attribute",
"using",
"d",
"-",
"path",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDataJsonFieldBo.java#L187-L209 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.createAggregate | @NonNull
public static CreateAggregateStart createAggregate(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier aggregateName) {
"""
Starts a CREATE AGGREGATE query with the given aggregate name for the given keyspace name.
"""
return new DefaultCreateAggregate(keyspace, aggregateName);
} | java | @NonNull
public static CreateAggregateStart createAggregate(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier aggregateName) {
return new DefaultCreateAggregate(keyspace, aggregateName);
} | [
"@",
"NonNull",
"public",
"static",
"CreateAggregateStart",
"createAggregate",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"aggregateName",
")",
"{",
"return",
"new",
"DefaultCreateAggregate",
"(",
"keyspace",
",",
"aggrega... | Starts a CREATE AGGREGATE query with the given aggregate name for the given keyspace name. | [
"Starts",
"a",
"CREATE",
"AGGREGATE",
"query",
"with",
"the",
"given",
"aggregate",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L552-L556 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/network/Connection.java | Connection.notifySender | protected void notifySender(Integer xid, Xdr response) {
"""
Update the response map with the response and notify the thread waiting for the
response. Do nothing if the future has been removed.
@param xid
@param response
"""
ChannelFuture future = _futureMap.get(xid);
if (future != null) {... | java | protected void notifySender(Integer xid, Xdr response) {
ChannelFuture future = _futureMap.get(xid);
if (future != null) {
_responseMap.put(xid, response);
future.setSuccess();
}
} | [
"protected",
"void",
"notifySender",
"(",
"Integer",
"xid",
",",
"Xdr",
"response",
")",
"{",
"ChannelFuture",
"future",
"=",
"_futureMap",
".",
"get",
"(",
"xid",
")",
";",
"if",
"(",
"future",
"!=",
"null",
")",
"{",
"_responseMap",
".",
"put",
"(",
... | Update the response map with the response and notify the thread waiting for the
response. Do nothing if the future has been removed.
@param xid
@param response | [
"Update",
"the",
"response",
"map",
"with",
"the",
"response",
"and",
"notify",
"the",
"thread",
"waiting",
"for",
"the",
"response",
".",
"Do",
"nothing",
"if",
"the",
"future",
"has",
"been",
"removed",
"."
] | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/network/Connection.java#L365-L371 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/GuavaSerIteratorFactory.java | GuavaSerIteratorFactory.listMultimap | public static final SerIterable listMultimap(final Class<?> keyType, final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
"""
Gets an iterable wrapper for {@code ListMultimap}.
@param keyType the key type, not null
@param valueType the value type, not null
@param valueTypeTypes the generic para... | java | public static final SerIterable listMultimap(final Class<?> keyType, final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
final ListMultimap<Object, Object> map = ArrayListMultimap.create();
return new SerIterable() {
@Override
public SerIterator iterator() {
... | [
"public",
"static",
"final",
"SerIterable",
"listMultimap",
"(",
"final",
"Class",
"<",
"?",
">",
"keyType",
",",
"final",
"Class",
"<",
"?",
">",
"valueType",
",",
"final",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"valueTypeTypes",
")",
"{",
"final",
... | Gets an iterable wrapper for {@code ListMultimap}.
@param keyType the key type, not null
@param valueType the value type, not null
@param valueTypeTypes the generic parameters of the value type
@return the iterable, not null | [
"Gets",
"an",
"iterable",
"wrapper",
"for",
"{",
"@code",
"ListMultimap",
"}",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/GuavaSerIteratorFactory.java#L387-L425 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/StringUtils.java | StringUtils.replaceBefor | public static String replaceBefor(String str, int end, String rp) {
"""
替换指定结束位置之前的所有字符
@param str 字符串
@param end 要替换的结束位置(包含该位置)
@param rp 替换字符串
@return 替换后的字符串,例如对123456替换3,*,结果为*56
"""
return replace(str, 0, end, rp);
} | java | public static String replaceBefor(String str, int end, String rp) {
return replace(str, 0, end, rp);
} | [
"public",
"static",
"String",
"replaceBefor",
"(",
"String",
"str",
",",
"int",
"end",
",",
"String",
"rp",
")",
"{",
"return",
"replace",
"(",
"str",
",",
"0",
",",
"end",
",",
"rp",
")",
";",
"}"
] | 替换指定结束位置之前的所有字符
@param str 字符串
@param end 要替换的结束位置(包含该位置)
@param rp 替换字符串
@return 替换后的字符串,例如对123456替换3,*,结果为*56 | [
"替换指定结束位置之前的所有字符"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/StringUtils.java#L81-L83 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java | SRTPCryptoContext.authenticatePacketHMCSHA1 | private void authenticatePacketHMCSHA1(RawPacket pkt, int rocIn) {
"""
Authenticate a packet. Calculated authentication tag is returned.
@param pkt
the RTP packet to be authenticated
@param rocIn
Roll-Over-Counter
"""
ByteBuffer buf = pkt.getBuffer();
buf.rewind();
int len = buf.remaining();
buf.... | java | private void authenticatePacketHMCSHA1(RawPacket pkt, int rocIn) {
ByteBuffer buf = pkt.getBuffer();
buf.rewind();
int len = buf.remaining();
buf.get(tempBuffer, 0, len);
mac.update(tempBuffer, 0, len);
rbStore[0] = (byte) (rocIn >> 24);
rbStore[1] = (byte) (rocIn >> 16);
rbStore[2] = (byte) (rocIn >> 8... | [
"private",
"void",
"authenticatePacketHMCSHA1",
"(",
"RawPacket",
"pkt",
",",
"int",
"rocIn",
")",
"{",
"ByteBuffer",
"buf",
"=",
"pkt",
".",
"getBuffer",
"(",
")",
";",
"buf",
".",
"rewind",
"(",
")",
";",
"int",
"len",
"=",
"buf",
".",
"remaining",
"... | Authenticate a packet. Calculated authentication tag is returned.
@param pkt
the RTP packet to be authenticated
@param rocIn
Roll-Over-Counter | [
"Authenticate",
"a",
"packet",
".",
"Calculated",
"authentication",
"tag",
"is",
"returned",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java#L522-L534 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.createTempDirectory | public static File createTempDirectory(String _path, String _prefix, int _length, boolean _timestamp, boolean _deleteOnExit) {
"""
Creates a temporary directory in the given path.
You can specify certain files to get a random unique name.
@param _path where to place the temp folder
@param _prefix prefix of the... | java | public static File createTempDirectory(String _path, String _prefix, int _length, boolean _timestamp, boolean _deleteOnExit) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd_HHmmss-SSS");
String randomStr = StringUtil.randomString(_length);
StringBuilder fileName = new StringBuilde... | [
"public",
"static",
"File",
"createTempDirectory",
"(",
"String",
"_path",
",",
"String",
"_prefix",
",",
"int",
"_length",
",",
"boolean",
"_timestamp",
",",
"boolean",
"_deleteOnExit",
")",
"{",
"SimpleDateFormat",
"formatter",
"=",
"new",
"SimpleDateFormat",
"(... | Creates a temporary directory in the given path.
You can specify certain files to get a random unique name.
@param _path where to place the temp folder
@param _prefix prefix of the folder
@param _length length of random chars
@param _timestamp add timestamp (yyyyMMdd_HHmmss-SSS) to directory name
@param _deleteOnExit ... | [
"Creates",
"a",
"temporary",
"directory",
"in",
"the",
"given",
"path",
".",
"You",
"can",
"specify",
"certain",
"files",
"to",
"get",
"a",
"random",
"unique",
"name",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L228-L247 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.projectiveToMetric | public static void projectiveToMetric( DMatrixRMaj cameraMatrix , DMatrixRMaj H ,
Se3_F64 worldToView , DMatrixRMaj K ) {
"""
Elevates a projective camera matrix into a metric one using the rectifying homography.
Extracts calibration and Se3 pose.
<pre>
P'=P*H
K,R,t = decompose(P')
</pre>
wher... | java | public static void projectiveToMetric( DMatrixRMaj cameraMatrix , DMatrixRMaj H ,
Se3_F64 worldToView , DMatrixRMaj K )
{
DMatrixRMaj tmp = new DMatrixRMaj(3,4);
CommonOps_DDRM.mult(cameraMatrix,H,tmp);
MultiViewOps.decomposeMetricCamera(tmp,K,worldToView);
} | [
"public",
"static",
"void",
"projectiveToMetric",
"(",
"DMatrixRMaj",
"cameraMatrix",
",",
"DMatrixRMaj",
"H",
",",
"Se3_F64",
"worldToView",
",",
"DMatrixRMaj",
"K",
")",
"{",
"DMatrixRMaj",
"tmp",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
",",
"4",
")",
";",
"C... | Elevates a projective camera matrix into a metric one using the rectifying homography.
Extracts calibration and Se3 pose.
<pre>
P'=P*H
K,R,t = decompose(P')
</pre>
where P is the camera matrix, H is the homography, (K,R,t) are the intrinsic calibration matrix, rotation,
and translation
@see MultiViewOps#absoluteQuadr... | [
"Elevates",
"a",
"projective",
"camera",
"matrix",
"into",
"a",
"metric",
"one",
"using",
"the",
"rectifying",
"homography",
".",
"Extracts",
"calibration",
"and",
"Se3",
"pose",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L1358-L1365 |
redkale/redkale | src/org/redkale/util/ResourceFactory.java | ResourceFactory.register | public <A> A register(final boolean autoSync, final Class<? extends A> clazz, final A rs) {
"""
将对象指定类型且name=""注入到资源池中
@param <A> 泛型
@param autoSync 是否同步已被注入的资源
@param clazz 资源类型
@param rs 资源对象
@return 旧资源对象
"""
return register(autoSync, "", clazz, rs);
} | java | public <A> A register(final boolean autoSync, final Class<? extends A> clazz, final A rs) {
return register(autoSync, "", clazz, rs);
} | [
"public",
"<",
"A",
">",
"A",
"register",
"(",
"final",
"boolean",
"autoSync",
",",
"final",
"Class",
"<",
"?",
"extends",
"A",
">",
"clazz",
",",
"final",
"A",
"rs",
")",
"{",
"return",
"register",
"(",
"autoSync",
",",
"\"\"",
",",
"clazz",
",",
... | 将对象指定类型且name=""注入到资源池中
@param <A> 泛型
@param autoSync 是否同步已被注入的资源
@param clazz 资源类型
@param rs 资源对象
@return 旧资源对象 | [
"将对象指定类型且name",
"=",
"注入到资源池中"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L134-L136 |
beangle/beangle3 | commons/model/src/main/java/org/beangle/commons/transfer/excel/ExcelTools.java | ExcelTools.object2Excel | public <T> HSSFWorkbook object2Excel(Collection<T> list, String propertyKeys, String propertyShowKeys,
PropertyExtractor exporter) throws Exception {
"""
List数据集导出生成Excel文件
@param list 对象数据列表
@param propertyKeys 对象属字符串,中间以","间隔
@param propertyShowKeys 显示字段的名字字符串,中间以","间隔
@return 返回单个HSSFWorkbook(excel)... | java | public <T> HSSFWorkbook object2Excel(Collection<T> list, String propertyKeys, String propertyShowKeys,
PropertyExtractor exporter) throws Exception {
HSSFWorkbook wb = new HSSFWorkbook(); // 建立新HSSFWorkbook对象
object2Excel(wb, "export result", list, propertyKeys, propertyShowKeys, exporter);
return wb;... | [
"public",
"<",
"T",
">",
"HSSFWorkbook",
"object2Excel",
"(",
"Collection",
"<",
"T",
">",
"list",
",",
"String",
"propertyKeys",
",",
"String",
"propertyShowKeys",
",",
"PropertyExtractor",
"exporter",
")",
"throws",
"Exception",
"{",
"HSSFWorkbook",
"wb",
"=",... | List数据集导出生成Excel文件
@param list 对象数据列表
@param propertyKeys 对象属字符串,中间以","间隔
@param propertyShowKeys 显示字段的名字字符串,中间以","间隔
@return 返回单个HSSFWorkbook(excel)
@throws java.lang.Exception if any.
@param exporter a {@link org.beangle.commons.transfer.exporter.PropertyExtractor} object.
@param <T> a T object. | [
"List数据集导出生成Excel文件"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/model/src/main/java/org/beangle/commons/transfer/excel/ExcelTools.java#L120-L125 |
GerdHolz/TOVAL | src/de/invation/code/toval/file/FileWriter.java | FileWriter.checkFileName | private synchronized void checkFileName(String fileName) throws ParameterException {
"""
Sets the name for the output file.
@param fileName Desired file name.
@throws IllegalArgumentException if the given file name is empty.
"""
Validate.notNull(fileName);
File cFile = new File(fileName);
if(cFile.getN... | java | private synchronized void checkFileName(String fileName) throws ParameterException{
Validate.notNull(fileName);
File cFile = new File(fileName);
if(cFile.getName().length()==0)
throw new ParameterException(ErrorCode.INCOMPATIBILITY, fileName + " is not a valid file-name!");
} | [
"private",
"synchronized",
"void",
"checkFileName",
"(",
"String",
"fileName",
")",
"throws",
"ParameterException",
"{",
"Validate",
".",
"notNull",
"(",
"fileName",
")",
";",
"File",
"cFile",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"if",
"(",
"cFile"... | Sets the name for the output file.
@param fileName Desired file name.
@throws IllegalArgumentException if the given file name is empty. | [
"Sets",
"the",
"name",
"for",
"the",
"output",
"file",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/file/FileWriter.java#L316-L321 |
dita-ot/dita-ot | src/main/java/org/dita/dost/pipeline/PipelineHashIO.java | PipelineHashIO.setAttribute | @Override
public void setAttribute(final String name, final String value) {
"""
Set the attribute vale with name into hash map.
@param name name
@param value value
"""
hash.put(name, value);
} | java | @Override
public void setAttribute(final String name, final String value) {
hash.put(name, value);
} | [
"@",
"Override",
"public",
"void",
"setAttribute",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"hash",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set the attribute vale with name into hash map.
@param name name
@param value value | [
"Set",
"the",
"attribute",
"vale",
"with",
"name",
"into",
"hash",
"map",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/pipeline/PipelineHashIO.java#L42-L45 |
canoo/dolphin-platform | platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/DolphinPlatformApplication.java | DolphinPlatformApplication.onRuntimeError | protected void onRuntimeError(final Stage primaryStage, final DolphinRuntimeException runtimeException) {
"""
This method is called if the connection to the Dolphin Platform server throws an exception at runtime. This can
for example happen if the server is shut down while the client is still running or if the se... | java | protected void onRuntimeError(final Stage primaryStage, final DolphinRuntimeException runtimeException) {
Assert.requireNonNull(runtimeException, "runtimeException");
LOG.error("Dolphin Platform runtime error in thread " + runtimeException.getThread().getName(), runtimeException);
Platform.exit(... | [
"protected",
"void",
"onRuntimeError",
"(",
"final",
"Stage",
"primaryStage",
",",
"final",
"DolphinRuntimeException",
"runtimeException",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"runtimeException",
",",
"\"runtimeException\"",
")",
";",
"LOG",
".",
"error",
... | This method is called if the connection to the Dolphin Platform server throws an exception at runtime. This can
for example happen if the server is shut down while the client is still running or if the server responses with
an error code.
@param primaryStage the primary stage
@param runtimeException the exception | [
"This",
"method",
"is",
"called",
"if",
"the",
"connection",
"to",
"the",
"Dolphin",
"Platform",
"server",
"throws",
"an",
"exception",
"at",
"runtime",
".",
"This",
"can",
"for",
"example",
"happen",
"if",
"the",
"server",
"is",
"shut",
"down",
"while",
"... | train | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-client-javafx/src/main/java/com/canoo/platform/remoting/client/javafx/DolphinPlatformApplication.java#L255-L259 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java | CertificatesImpl.addAsync | public Observable<Void> addAsync(CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions) {
"""
Adds a certificate to the specified account.
@param certificate The certificate to be added.
@param certificateAddOptions Additional parameters for the operation
@throws IllegalArgumentExce... | java | public Observable<Void> addAsync(CertificateAddParameter certificate, CertificateAddOptions certificateAddOptions) {
return addWithServiceResponseAsync(certificate, certificateAddOptions).map(new Func1<ServiceResponseWithHeaders<Void, CertificateAddHeaders>, Void>() {
@Override
public Vo... | [
"public",
"Observable",
"<",
"Void",
">",
"addAsync",
"(",
"CertificateAddParameter",
"certificate",
",",
"CertificateAddOptions",
"certificateAddOptions",
")",
"{",
"return",
"addWithServiceResponseAsync",
"(",
"certificate",
",",
"certificateAddOptions",
")",
".",
"map"... | Adds a certificate to the specified account.
@param certificate The certificate to be added.
@param certificateAddOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponseWithHeaders} object if successful. | [
"Adds",
"a",
"certificate",
"to",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java#L221-L228 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.optLong | public long optLong( String key, long defaultValue ) {
"""
Get an optional long value associated with a key, or the default if there
is no such key or if the value is not a number. If the value is a string,
an attempt will be made to evaluate it as a number.
@param key A key string.
@param defaultValue The d... | java | public long optLong( String key, long defaultValue ) {
verifyIsNull();
try{
return getLong( key );
}catch( Exception e ){
return defaultValue;
}
} | [
"public",
"long",
"optLong",
"(",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"verifyIsNull",
"(",
")",
";",
"try",
"{",
"return",
"getLong",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"defaultValue",
";"... | Get an optional long value associated with a key, or the default if there
is no such key or if the value is not a number. If the value is a string,
an attempt will be made to evaluate it as a number.
@param key A key string.
@param defaultValue The default.
@return An object which is the value. | [
"Get",
"an",
"optional",
"long",
"value",
"associated",
"with",
"a",
"key",
"or",
"the",
"default",
"if",
"there",
"is",
"no",
"such",
"key",
"or",
"if",
"the",
"value",
"is",
"not",
"a",
"number",
".",
"If",
"the",
"value",
"is",
"a",
"string",
"an"... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L2259-L2266 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/DoubleBindingChecker.java | DoubleBindingChecker.findSource | private GinjectorBindings findSource(GinjectorBindings ginjector, Key<?> key) {
"""
Find the ginjector that we "really" get the binding for key from. That is,
if it is inherited from a child/parent, return that injector.
"""
Set<GinjectorBindings> visited = new LinkedHashSet<GinjectorBindings>();
Gi... | java | private GinjectorBindings findSource(GinjectorBindings ginjector, Key<?> key) {
Set<GinjectorBindings> visited = new LinkedHashSet<GinjectorBindings>();
GinjectorBindings lastGinjector = null;
while (ginjector != null) {
if (!visited.add(ginjector)) {
logger.log(Type.ERROR, PrettyPrinter.form... | [
"private",
"GinjectorBindings",
"findSource",
"(",
"GinjectorBindings",
"ginjector",
",",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"Set",
"<",
"GinjectorBindings",
">",
"visited",
"=",
"new",
"LinkedHashSet",
"<",
"GinjectorBindings",
">",
"(",
")",
";",
"Ginjec... | Find the ginjector that we "really" get the binding for key from. That is,
if it is inherited from a child/parent, return that injector. | [
"Find",
"the",
"ginjector",
"that",
"we",
"really",
"get",
"the",
"binding",
"for",
"key",
"from",
".",
"That",
"is",
"if",
"it",
"is",
"inherited",
"from",
"a",
"child",
"/",
"parent",
"return",
"that",
"injector",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/DoubleBindingChecker.java#L93-L111 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArrayFor | public static <T> Level0ArrayOperator<BigDecimal[],BigDecimal> onArrayFor(final BigDecimal... elements) {
"""
<p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining
"""... | java | public static <T> Level0ArrayOperator<BigDecimal[],BigDecimal> onArrayFor(final BigDecimal... elements) {
return onArrayOf(Types.BIG_DECIMAL, VarArgsUtil.asRequiredObjectArray(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"BigDecimal",
"[",
"]",
",",
"BigDecimal",
">",
"onArrayFor",
"(",
"final",
"BigDecimal",
"...",
"elements",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"BIG_DECIMAL",
",",
"VarArgsUtil",
... | <p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"array",
"with",
"the",
"specified",
"elements",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L1010-L1012 |
grpc/grpc-java | stub/src/main/java/io/grpc/stub/AbstractStub.java | AbstractStub.withCompression | @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704")
public final S withCompression(String compressorName) {
"""
Set's the compressor name to use for the call. It is the responsibility of the application
to make sure the server supports decoding the compressor picked by the client. To be clear,
... | java | @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704")
public final S withCompression(String compressorName) {
return build(channel, callOptions.withCompression(compressorName));
} | [
"@",
"ExperimentalApi",
"(",
"\"https://github.com/grpc/grpc-java/issues/1704\"",
")",
"public",
"final",
"S",
"withCompression",
"(",
"String",
"compressorName",
")",
"{",
"return",
"build",
"(",
"channel",
",",
"callOptions",
".",
"withCompression",
"(",
"compressorNa... | Set's the compressor name to use for the call. It is the responsibility of the application
to make sure the server supports decoding the compressor picked by the client. To be clear,
this is the compressor used by the stub to compress messages to the server. To get
compressed responses from the server, set the appro... | [
"Set",
"s",
"the",
"compressor",
"name",
"to",
"use",
"for",
"the",
"call",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"application",
"to",
"make",
"sure",
"the",
"server",
"supports",
"decoding",
"the",
"compressor",
"picked",
"by",
"the",
"cl... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/stub/src/main/java/io/grpc/stub/AbstractStub.java#L148-L151 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java | TransactionableResourceManager.putSharedObject | public void putSharedObject(String key, Object value) {
"""
Registers an object to be shared within the XidContext
@param key the key of the shared object
@param value the shared object
"""
TransactionContext ctx = contexts.get();
if (ctx == null)
{
throw new IllegalStateException(... | java | public void putSharedObject(String key, Object value)
{
TransactionContext ctx = contexts.get();
if (ctx == null)
{
throw new IllegalStateException("There is no active transaction context");
}
XidContext xidCtx = ctx.getXidContext();
if (xidCtx == null)
{
t... | [
"public",
"void",
"putSharedObject",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"TransactionContext",
"ctx",
"=",
"contexts",
".",
"get",
"(",
")",
";",
"if",
"(",
"ctx",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
... | Registers an object to be shared within the XidContext
@param key the key of the shared object
@param value the shared object | [
"Registers",
"an",
"object",
"to",
"be",
"shared",
"within",
"the",
"XidContext"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java#L166-L179 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.getLastInstanceActiveTime | protected long getLastInstanceActiveTime(String instanceId, T jedis) {
"""
Retrieve the last time (in milliseconds) that the instance was active
@param instanceId The instance to check
@param jedis a thread-safe Redis connection
@return a unix timestamp in milliseconds
"""
final String lastActiveTim... | java | protected long getLastInstanceActiveTime(String instanceId, T jedis){
final String lastActiveTime = jedis.hget(redisSchema.lastInstanceActiveTime(), instanceId);
if(lastActiveTime == null){
return 0;
}
return Long.parseLong(lastActiveTime);
} | [
"protected",
"long",
"getLastInstanceActiveTime",
"(",
"String",
"instanceId",
",",
"T",
"jedis",
")",
"{",
"final",
"String",
"lastActiveTime",
"=",
"jedis",
".",
"hget",
"(",
"redisSchema",
".",
"lastInstanceActiveTime",
"(",
")",
",",
"instanceId",
")",
";",
... | Retrieve the last time (in milliseconds) that the instance was active
@param instanceId The instance to check
@param jedis a thread-safe Redis connection
@return a unix timestamp in milliseconds | [
"Retrieve",
"the",
"last",
"time",
"(",
"in",
"milliseconds",
")",
"that",
"the",
"instance",
"was",
"active"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L736-L742 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/BundlesHandlerFactory.java | BundlesHandlerFactory.buildOrphansResourceBundle | private JoinableResourceBundle buildOrphansResourceBundle(String bundleId, List<String> orphanPaths) {
"""
Builds a single bundle containing all the paths specified. Useful to make
a single bundle out of every resource that is orphan after processing
config definitions.
@param bundleId
the bundle Id
@param ... | java | private JoinableResourceBundle buildOrphansResourceBundle(String bundleId, List<String> orphanPaths) {
JoinableResourceBundle newBundle = new JoinableResourceBundleImpl(bundleId,
generateBundleNameFromBundleId(bundleId), null, fileExtension, new InclusionPattern(), orphanPaths,
resourceReaderHandler, jawrConf... | [
"private",
"JoinableResourceBundle",
"buildOrphansResourceBundle",
"(",
"String",
"bundleId",
",",
"List",
"<",
"String",
">",
"orphanPaths",
")",
"{",
"JoinableResourceBundle",
"newBundle",
"=",
"new",
"JoinableResourceBundleImpl",
"(",
"bundleId",
",",
"generateBundleNa... | Builds a single bundle containing all the paths specified. Useful to make
a single bundle out of every resource that is orphan after processing
config definitions.
@param bundleId
the bundle Id
@param orphanPaths
the orphan paths
@return a single bundle containing all the paths specified | [
"Builds",
"a",
"single",
"bundle",
"containing",
"all",
"the",
"paths",
"specified",
".",
"Useful",
"to",
"make",
"a",
"single",
"bundle",
"out",
"of",
"every",
"resource",
"that",
"is",
"orphan",
"after",
"processing",
"config",
"definitions",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/BundlesHandlerFactory.java#L785-L790 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/BigDecimalRangeRandomizer.java | BigDecimalRangeRandomizer.aNewBigDecimalRangeRandomizer | public static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale) {
"""
Create a new {@link BigDecimalRangeRandomizer}. The default rounding mode is {@link RoundingMode#HALF_UP}.
@param min min value
@param max max value
@param scale of the {@co... | java | public static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale) {
return new BigDecimalRangeRandomizer(min, max, scale);
} | [
"public",
"static",
"BigDecimalRangeRandomizer",
"aNewBigDecimalRangeRandomizer",
"(",
"final",
"Double",
"min",
",",
"final",
"Double",
"max",
",",
"final",
"Integer",
"scale",
")",
"{",
"return",
"new",
"BigDecimalRangeRandomizer",
"(",
"min",
",",
"max",
",",
"... | Create a new {@link BigDecimalRangeRandomizer}. The default rounding mode is {@link RoundingMode#HALF_UP}.
@param min min value
@param max max value
@param scale of the {@code BigDecimal} value to be returned.
@return a new {@link BigDecimalRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"BigDecimalRangeRandomizer",
"}",
".",
"The",
"default",
"rounding",
"mode",
"is",
"{",
"@link",
"RoundingMode#HALF_UP",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/BigDecimalRangeRandomizer.java#L105-L107 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/AbstractUdfOperator.java | AbstractUdfOperator.setBroadcastVariables | public <T> void setBroadcastVariables(Map<String, Operator<T>> inputs) {
"""
Clears all previous broadcast inputs and binds the given inputs as
broadcast variables of this operator.
@param inputs The {@code<name, root>} pairs to be set as broadcast inputs.
"""
this.broadcastInputs.clear();
this.broadca... | java | public <T> void setBroadcastVariables(Map<String, Operator<T>> inputs) {
this.broadcastInputs.clear();
this.broadcastInputs.putAll(inputs);
} | [
"public",
"<",
"T",
">",
"void",
"setBroadcastVariables",
"(",
"Map",
"<",
"String",
",",
"Operator",
"<",
"T",
">",
">",
"inputs",
")",
"{",
"this",
".",
"broadcastInputs",
".",
"clear",
"(",
")",
";",
"this",
".",
"broadcastInputs",
".",
"putAll",
"(... | Clears all previous broadcast inputs and binds the given inputs as
broadcast variables of this operator.
@param inputs The {@code<name, root>} pairs to be set as broadcast inputs. | [
"Clears",
"all",
"previous",
"broadcast",
"inputs",
"and",
"binds",
"the",
"given",
"inputs",
"as",
"broadcast",
"variables",
"of",
"this",
"operator",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/AbstractUdfOperator.java#L112-L115 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.