repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 188 | func_name stringlengths 7 127 | whole_func_string stringlengths 77 3.91k | language stringclasses 1
value | func_code_string stringlengths 77 3.91k | func_code_tokens listlengths 20 745 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 477 | split_name stringclasses 1
value | func_code_url stringlengths 111 288 |
|---|---|---|---|---|---|---|---|---|---|---|
h2oai/h2o-3 | h2o-core/src/main/java/hex/Distribution.java | Distribution.gammaDenom | public double gammaDenom(double w, double y, double z, double f) {
switch (distribution) {
case gaussian:
case gamma:
return w;
case bernoulli:
case quasibinomial:
double ff = y-z;
return w * ff*(1-ff);
case multinomial:
double absz = Math.abs(z);
... | java | public double gammaDenom(double w, double y, double z, double f) {
switch (distribution) {
case gaussian:
case gamma:
return w;
case bernoulli:
case quasibinomial:
double ff = y-z;
return w * ff*(1-ff);
case multinomial:
double absz = Math.abs(z);
... | [
"public",
"double",
"gammaDenom",
"(",
"double",
"w",
",",
"double",
"y",
",",
"double",
"z",
",",
"double",
"f",
")",
"{",
"switch",
"(",
"distribution",
")",
"{",
"case",
"gaussian",
":",
"case",
"gamma",
":",
"return",
"w",
";",
"case",
"bernoulli",... | Contribution to denominator for GBM's leaf node prediction
@param w weight
@param y response
@param z residual
@param f predicted value (including offset)
@return weighted contribution to denominator | [
"Contribution",
"to",
"denominator",
"for",
"GBM",
"s",
"leaf",
"node",
"prediction"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/Distribution.java#L291-L315 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/config/ServiceDirectoryConfig.java | ServiceDirectoryConfig.getBoolean | public boolean getBoolean(String name, boolean defaultVal){
if(this.configuration.containsKey(name)){
return this.configuration.getBoolean(name);
} else {
return defaultVal;
}
} | java | public boolean getBoolean(String name, boolean defaultVal){
if(this.configuration.containsKey(name)){
return this.configuration.getBoolean(name);
} else {
return defaultVal;
}
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"name",
",",
"boolean",
"defaultVal",
")",
"{",
"if",
"(",
"this",
".",
"configuration",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"this",
".",
"configuration",
".",
"getBoolean",
"(",
"name... | Get the property object as Boolean, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as boolean, return defaultVal if property is undefined. | [
"Get",
"the",
"property",
"object",
"as",
"Boolean",
"or",
"return",
"defaultVal",
"if",
"property",
"is",
"not",
"defined",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/config/ServiceDirectoryConfig.java#L117-L123 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.updateComputeNodeUser | private void updateComputeNodeUser(String poolId, String nodeId, String userName, NodeUpdateUserParameter nodeUpdateUserParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
ComputeNodeUpdateUserOptions options = new ComputeNodeUpdateUserOptions();
Behav... | java | private void updateComputeNodeUser(String poolId, String nodeId, String userName, NodeUpdateUserParameter nodeUpdateUserParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
ComputeNodeUpdateUserOptions options = new ComputeNodeUpdateUserOptions();
Behav... | [
"private",
"void",
"updateComputeNodeUser",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"userName",
",",
"NodeUpdateUserParameter",
"nodeUpdateUserParameter",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"B... | Updates the specified user account on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node where the user account will be updated.
@param userName The name of the user account to update.
@param nodeUpdateUserParameter The set of changes t... | [
"Updates",
"the",
"specified",
"user",
"account",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L213-L219 |
pravega/pravega | common/src/main/java/io/pravega/common/util/ByteArraySegment.java | ByteArraySegment.copyFrom | public void copyFrom(ByteArraySegment source, int targetOffset, int length) {
Preconditions.checkState(!this.readOnly, "Cannot modify a read-only ByteArraySegment.");
Exceptions.checkArrayRange(targetOffset, length, this.length, "index", "values.length");
Preconditions.checkElementIndex(length, ... | java | public void copyFrom(ByteArraySegment source, int targetOffset, int length) {
Preconditions.checkState(!this.readOnly, "Cannot modify a read-only ByteArraySegment.");
Exceptions.checkArrayRange(targetOffset, length, this.length, "index", "values.length");
Preconditions.checkElementIndex(length, ... | [
"public",
"void",
"copyFrom",
"(",
"ByteArraySegment",
"source",
",",
"int",
"targetOffset",
",",
"int",
"length",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"this",
".",
"readOnly",
",",
"\"Cannot modify a read-only ByteArraySegment.\"",
")",
";",
"E... | Copies a specified number of bytes from the given ByteArraySegment into this ByteArraySegment.
@param source The ByteArraySegment to copy bytes from.
@param targetOffset The offset within this ByteArraySegment to start copying at.
@param length The number of bytes to copy.
@throws IllegalStateException ... | [
"Copies",
"a",
"specified",
"number",
"of",
"bytes",
"from",
"the",
"given",
"ByteArraySegment",
"into",
"this",
"ByteArraySegment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ByteArraySegment.java#L180-L186 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/MonitoringProxy.java | MonitoringProxy.createProxy | public static <T> T createProxy(T facade, String name) {
return createProxy(facade, new MonitoringProxy(facade, name));
} | java | public static <T> T createProxy(T facade, String name) {
return createProxy(facade, new MonitoringProxy(facade, name));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createProxy",
"(",
"T",
"facade",
",",
"String",
"name",
")",
"{",
"return",
"createProxy",
"(",
"facade",
",",
"new",
"MonitoringProxy",
"(",
"facade",
",",
"name",
")",
")",
";",
"}"
] | Création d'un proxy de monitoring pour une façade, en spécifiant le nom qui sera affiché dans le monitoring.
@param <T> Type de la façade (une interface en général).
@param facade Instance de la façade
@param name override of the interface name in the statistics
@return Proxy de la façade | [
"Création",
"d",
"un",
"proxy",
"de",
"monitoring",
"pour",
"une",
"façade",
"en",
"spécifiant",
"le",
"nom",
"qui",
"sera",
"affiché",
"dans",
"le",
"monitoring",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/MonitoringProxy.java#L116-L118 |
OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/client/ClientWorldConnection.java | ClientWorldConnection.getStreamRequest | public synchronized StepResponse getStreamRequest(final String idRegex,
final long start, final long interval, String... attributes) {
StreamRequestMessage req = new StreamRequestMessage();
req.setIdRegex(idRegex);
req.setBeginTimestamp(start);
req.setUpdateInterval(interval);
if (attributes !... | java | public synchronized StepResponse getStreamRequest(final String idRegex,
final long start, final long interval, String... attributes) {
StreamRequestMessage req = new StreamRequestMessage();
req.setIdRegex(idRegex);
req.setBeginTimestamp(start);
req.setUpdateInterval(interval);
if (attributes !... | [
"public",
"synchronized",
"StepResponse",
"getStreamRequest",
"(",
"final",
"String",
"idRegex",
",",
"final",
"long",
"start",
",",
"final",
"long",
"interval",
",",
"String",
"...",
"attributes",
")",
"{",
"StreamRequestMessage",
"req",
"=",
"new",
"StreamReques... | Sends a stream request to the world model for the specified identifier and
attribute regular expressions, beginning with data at time {@code start},
and updating no more frequently than every {@code interval} milliseconds.
@param idRegex
the regular expression for matching identifiers
@param start
the earliest data to... | [
"Sends",
"a",
"stream",
"request",
"to",
"the",
"world",
"model",
"for",
"the",
"specified",
"identifier",
"and",
"attribute",
"regular",
"expressions",
"beginning",
"with",
"data",
"at",
"time",
"{",
"@code",
"start",
"}",
"and",
"updating",
"no",
"more",
"... | train | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/client/ClientWorldConnection.java#L396-L427 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceManager.java | CmsWorkplaceManager.checkWorkplaceRequest | public void checkWorkplaceRequest(HttpServletRequest request, CmsObject cms) {
try {
if ((OpenCms.getSiteManager().getSites().size() > 1)
&& !OpenCms.getSiteManager().isWorkplaceRequest(request)) {
// this is a multi site-configuration, but not a request to the confi... | java | public void checkWorkplaceRequest(HttpServletRequest request, CmsObject cms) {
try {
if ((OpenCms.getSiteManager().getSites().size() > 1)
&& !OpenCms.getSiteManager().isWorkplaceRequest(request)) {
// this is a multi site-configuration, but not a request to the confi... | [
"public",
"void",
"checkWorkplaceRequest",
"(",
"HttpServletRequest",
"request",
",",
"CmsObject",
"cms",
")",
"{",
"try",
"{",
"if",
"(",
"(",
"OpenCms",
".",
"getSiteManager",
"(",
")",
".",
"getSites",
"(",
")",
".",
"size",
"(",
")",
">",
"1",
")",
... | Checks whether the workplace is accessed through the workplace server, and sends an error message otherwise.<p>
@param request the request to check
@param cms the CmsObject to use | [
"Checks",
"whether",
"the",
"workplace",
"is",
"accessed",
"through",
"the",
"workplace",
"server",
"and",
"sends",
"an",
"error",
"message",
"otherwise",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceManager.java#L675-L699 |
ehcache/ehcache3 | clustered/server/src/main/java/org/ehcache/clustered/server/management/ClusterTierManagement.java | ClusterTierManagement.init | private void init() {
ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier);
ServerStoreBinding serverStoreBinding = new ServerStoreBinding(storeIdentifier, serverStore);
CompletableFuture<Void> r1 = managementRegistry.register(serverStoreBinding);
ServerSideConfiguration.Poo... | java | private void init() {
ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier);
ServerStoreBinding serverStoreBinding = new ServerStoreBinding(storeIdentifier, serverStore);
CompletableFuture<Void> r1 = managementRegistry.register(serverStoreBinding);
ServerSideConfiguration.Poo... | [
"private",
"void",
"init",
"(",
")",
"{",
"ServerSideServerStore",
"serverStore",
"=",
"ehcacheStateService",
".",
"getStore",
"(",
"storeIdentifier",
")",
";",
"ServerStoreBinding",
"serverStoreBinding",
"=",
"new",
"ServerStoreBinding",
"(",
"storeIdentifier",
",",
... | the goal of the following code is to send the management metadata from the entity into the monitoring tree AFTER the entity creation | [
"the",
"goal",
"of",
"the",
"following",
"code",
"is",
"to",
"send",
"the",
"management",
"metadata",
"from",
"the",
"entity",
"into",
"the",
"monitoring",
"tree",
"AFTER",
"the",
"entity",
"creation"
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/server/src/main/java/org/ehcache/clustered/server/management/ClusterTierManagement.java#L91-L106 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java | ZooKeeperStateHandleStore.releaseAndTryRemoveAll | public void releaseAndTryRemoveAll() throws Exception {
Collection<String> children = getAllPaths();
Exception exception = null;
for (String child : children) {
try {
releaseAndTryRemove('/' + child);
} catch (Exception e) {
exception = ExceptionUtils.firstOrSuppressed(e, exception);
}
}
i... | java | public void releaseAndTryRemoveAll() throws Exception {
Collection<String> children = getAllPaths();
Exception exception = null;
for (String child : children) {
try {
releaseAndTryRemove('/' + child);
} catch (Exception e) {
exception = ExceptionUtils.firstOrSuppressed(e, exception);
}
}
i... | [
"public",
"void",
"releaseAndTryRemoveAll",
"(",
")",
"throws",
"Exception",
"{",
"Collection",
"<",
"String",
">",
"children",
"=",
"getAllPaths",
"(",
")",
";",
"Exception",
"exception",
"=",
"null",
";",
"for",
"(",
"String",
"child",
":",
"children",
")"... | Releases all lock nodes of this ZooKeeperStateHandleStores and tries to remove all state nodes which
are not locked anymore.
<p>The delete operation is executed asynchronously
@throws Exception if the delete operation fails | [
"Releases",
"all",
"lock",
"nodes",
"of",
"this",
"ZooKeeperStateHandleStores",
"and",
"tries",
"to",
"remove",
"all",
"state",
"nodes",
"which",
"are",
"not",
"locked",
"anymore",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java#L369-L385 |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/BasicFileServlet.java | BasicFileServlet.copyPartialContent | public static void copyPartialContent(InputStream in, OutputStream out, Range r) throws IOException {
IOUtils.copyLarge(in, out, r.start, r.length);
} | java | public static void copyPartialContent(InputStream in, OutputStream out, Range r) throws IOException {
IOUtils.copyLarge(in, out, r.start, r.length);
} | [
"public",
"static",
"void",
"copyPartialContent",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"Range",
"r",
")",
"throws",
"IOException",
"{",
"IOUtils",
".",
"copyLarge",
"(",
"in",
",",
"out",
",",
"r",
".",
"start",
",",
"r",
".",
"leng... | Copies the given range of bytes from the input stream to the output stream.
@param in
@param out
@param r
@throws IOException | [
"Copies",
"the",
"given",
"range",
"of",
"bytes",
"from",
"the",
"input",
"stream",
"to",
"the",
"output",
"stream",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/BasicFileServlet.java#L225-L227 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/util/GwtEventUtil.java | GwtEventUtil.getPosition | public static Coordinate getPosition(MouseEvent<?> event, int offsetX, int offsetY) {
return new Coordinate(event.getX() + offsetX, event.getY() + offsetY);
} | java | public static Coordinate getPosition(MouseEvent<?> event, int offsetX, int offsetY) {
return new Coordinate(event.getX() + offsetX, event.getY() + offsetY);
} | [
"public",
"static",
"Coordinate",
"getPosition",
"(",
"MouseEvent",
"<",
"?",
">",
"event",
",",
"int",
"offsetX",
",",
"int",
"offsetY",
")",
"{",
"return",
"new",
"Coordinate",
"(",
"event",
".",
"getX",
"(",
")",
"+",
"offsetX",
",",
"event",
".",
"... | Get the position of a mouse event.
@param event
The mouse event itself.
@param offsetX
An extra value to be added to the X axis.
@param offsetY
An extra value to be added to the Y axis.
@return Returns a coordinate holding the event's X and Y ordinate, where the origin is the upper left corner of
the DOM element catch... | [
"Get",
"the",
"position",
"of",
"a",
"mouse",
"event",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/util/GwtEventUtil.java#L65-L67 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ToastUtils.java | ToastUtils.quickToast | public static Toast quickToast(Context context, String message, boolean longLength) {
final Toast toast;
if (longLength) {
toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
} else {
toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
}
... | java | public static Toast quickToast(Context context, String message, boolean longLength) {
final Toast toast;
if (longLength) {
toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
} else {
toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
}
... | [
"public",
"static",
"Toast",
"quickToast",
"(",
"Context",
"context",
",",
"String",
"message",
",",
"boolean",
"longLength",
")",
"{",
"final",
"Toast",
"toast",
";",
"if",
"(",
"longLength",
")",
"{",
"toast",
"=",
"Toast",
".",
"makeText",
"(",
"context... | Display a toast with the given message.
@param context The current Context or Activity that this method is called from
@param message Message to display
@param longLength if true, will use Toast.LENGTH_LONG (approx 3.5 sec) instead of
@return Toast object that is being displayed. Note,show() has already been cal... | [
"Display",
"a",
"toast",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ToastUtils.java#L33-L42 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/JobConfigurationUtils.java | JobConfigurationUtils.putPropertiesIntoConfiguration | public static void putPropertiesIntoConfiguration(Properties properties, Configuration configuration) {
for (String name : properties.stringPropertyNames()) {
configuration.set(name, properties.getProperty(name));
}
} | java | public static void putPropertiesIntoConfiguration(Properties properties, Configuration configuration) {
for (String name : properties.stringPropertyNames()) {
configuration.set(name, properties.getProperty(name));
}
} | [
"public",
"static",
"void",
"putPropertiesIntoConfiguration",
"(",
"Properties",
"properties",
",",
"Configuration",
"configuration",
")",
"{",
"for",
"(",
"String",
"name",
":",
"properties",
".",
"stringPropertyNames",
"(",
")",
")",
"{",
"configuration",
".",
"... | Put all configuration properties in a given {@link Properties} object into a given
{@link Configuration} object.
@param properties the given {@link Properties} object
@param configuration the given {@link Configuration} object | [
"Put",
"all",
"configuration",
"properties",
"in",
"a",
"given",
"{",
"@link",
"Properties",
"}",
"object",
"into",
"a",
"given",
"{",
"@link",
"Configuration",
"}",
"object",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/JobConfigurationUtils.java#L66-L70 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/helpers/CustomStickyRecyclerHeadersDecoration.java | CustomStickyRecyclerHeadersDecoration.findHeaderPositionUnder | public int findHeaderPositionUnder(int x, int y) {
for (int i = 0; i < mHeaderRects.size(); i++) {
Rect rect = mHeaderRects.get(mHeaderRects.keyAt(i));
if (rect.contains(x, y)) {
return mHeaderRects.keyAt(i);
}
}
return -1;
} | java | public int findHeaderPositionUnder(int x, int y) {
for (int i = 0; i < mHeaderRects.size(); i++) {
Rect rect = mHeaderRects.get(mHeaderRects.keyAt(i));
if (rect.contains(x, y)) {
return mHeaderRects.keyAt(i);
}
}
return -1;
} | [
"public",
"int",
"findHeaderPositionUnder",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mHeaderRects",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Rect",
"rect",
"=",
"mHeaderRects",
".",
"g... | Gets the position of the header under the specified (x, y) coordinates.
@param x x-coordinate
@param y y-coordinate
@return position of header, or -1 if not found | [
"Gets",
"the",
"position",
"of",
"the",
"header",
"under",
"the",
"specified",
"(",
"x",
"y",
")",
"coordinates",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/helpers/CustomStickyRecyclerHeadersDecoration.java#L134-L142 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/MenuFlyoutExample.java | MenuFlyoutExample.buildMenu | private WMenu buildMenu(final WText selectedMenuText) {
WMenu menu = new WMenu(WMenu.MenuType.FLYOUT);
// The Colours menu just shows simple text
WSubMenu colourMenu = new WSubMenu("Colours");
addMenuItem(colourMenu, "Red", selectedMenuText);
addMenuItem(colourMenu, "Green", selectedMenuText);
addMenuItem(... | java | private WMenu buildMenu(final WText selectedMenuText) {
WMenu menu = new WMenu(WMenu.MenuType.FLYOUT);
// The Colours menu just shows simple text
WSubMenu colourMenu = new WSubMenu("Colours");
addMenuItem(colourMenu, "Red", selectedMenuText);
addMenuItem(colourMenu, "Green", selectedMenuText);
addMenuItem(... | [
"private",
"WMenu",
"buildMenu",
"(",
"final",
"WText",
"selectedMenuText",
")",
"{",
"WMenu",
"menu",
"=",
"new",
"WMenu",
"(",
"WMenu",
".",
"MenuType",
".",
"FLYOUT",
")",
";",
"// The Colours menu just shows simple text",
"WSubMenu",
"colourMenu",
"=",
"new",
... | Builds up a menu bar for inclusion in the example.
@param selectedMenuText the WText to display the selected menu item.
@return a menu for the example. | [
"Builds",
"up",
"a",
"menu",
"bar",
"for",
"inclusion",
"in",
"the",
"example",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/MenuFlyoutExample.java#L64-L129 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/taglib/el/EvalHelper.java | EvalHelper.evalBoolean | public static Boolean evalBoolean(String propertyName, String propertyValue, Tag tag, PageContext pageContext) throws JspException{
return (Boolean) ExpressionEvaluatorManager.evaluate(propertyName,
propertyValue, Boolean.class, tag, pageContext);
} | java | public static Boolean evalBoolean(String propertyName, String propertyValue, Tag tag, PageContext pageContext) throws JspException{
return (Boolean) ExpressionEvaluatorManager.evaluate(propertyName,
propertyValue, Boolean.class, tag, pageContext);
} | [
"public",
"static",
"Boolean",
"evalBoolean",
"(",
"String",
"propertyName",
",",
"String",
"propertyValue",
",",
"Tag",
"tag",
",",
"PageContext",
"pageContext",
")",
"throws",
"JspException",
"{",
"return",
"(",
"Boolean",
")",
"ExpressionEvaluatorManager",
".",
... | Evaluate the boolean EL expression passed as parameter
@param propertyName the property name
@param propertyValue the property value
@param tag the tag
@param pageContext the page context
@return the value corresponding to the EL expression passed as parameter
@throws JspException if an exception occurs | [
"Evaluate",
"the",
"boolean",
"EL",
"expression",
"passed",
"as",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/taglib/el/EvalHelper.java#L54-L58 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/expression/Uris.java | Uris.escapePathSegment | public String escapePathSegment(final String text, final String encoding) {
return UriEscape.escapeUriPathSegment(text, encoding);
} | java | public String escapePathSegment(final String text, final String encoding) {
return UriEscape.escapeUriPathSegment(text, encoding);
} | [
"public",
"String",
"escapePathSegment",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"return",
"UriEscape",
".",
"escapeUriPathSegment",
"(",
"text",
",",
"encoding",
")",
";",
"}"
] | <p>
Perform am URI path segment <strong>escape</strong> operation
on a {@code String} input.
</p>
<p>
This method simply calls the equivalent method in the {@code UriEscape} class from the
<a href="http://www.unbescape.org">Unbescape</a> library.
</p>
<p>
The following are the only allowed chars in an URI path segment ... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"segment",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"{",
"@code",
"String",
"}",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method",
"simply",
"calls",
"the",
"equiva... | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/expression/Uris.java#L297-L299 |
BioPAX/Paxtools | paxtools-console/src/main/java/org/biopax/paxtools/examples/UseOfReflection.java | UseOfReflection.getBiopaxPropertyValues | public static Set getBiopaxPropertyValues(BioPAXElement bpe, String property) {
// get the BioPAX L3 property editors map
EditorMap em = SimpleEditorMap.L3;
// get the 'organism' biopax property editor,
// if exists for this type of bpe
@SuppressWarnings("unchecked") PropertyEditor<BioPAXElement, Object> e... | java | public static Set getBiopaxPropertyValues(BioPAXElement bpe, String property) {
// get the BioPAX L3 property editors map
EditorMap em = SimpleEditorMap.L3;
// get the 'organism' biopax property editor,
// if exists for this type of bpe
@SuppressWarnings("unchecked") PropertyEditor<BioPAXElement, Object> e... | [
"public",
"static",
"Set",
"getBiopaxPropertyValues",
"(",
"BioPAXElement",
"bpe",
",",
"String",
"property",
")",
"{",
"// get the BioPAX L3 property editors map",
"EditorMap",
"em",
"=",
"SimpleEditorMap",
".",
"L3",
";",
"// get the 'organism' biopax property editor, ",
... | Example 2.
How to get values from a biopax property if the type of the biopax object
is not known at runtime, and you do not want to always remember the
domain and range of the property nor write many if-else statements to
find out.
@param bpe BioPAX object
@param property BioPAX property
@return the BioPAX property ... | [
"Example",
"2",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-console/src/main/java/org/biopax/paxtools/examples/UseOfReflection.java#L68-L84 |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.replaceAllCalls | public Descriptor replaceAllCalls(PSequence<Call<?, ?>> calls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | java | public Descriptor replaceAllCalls(PSequence<Call<?, ?>> calls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | [
"public",
"Descriptor",
"replaceAllCalls",
"(",
"PSequence",
"<",
"Call",
"<",
"?",
",",
"?",
">",
">",
"calls",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
"messageSerializers",
",",
"serializerFactory... | Replace all the service calls provided by this descriptor with the the given service calls.
@param calls The calls to replace the existing ones with.
@return A copy of this descriptor with the new calls. | [
"Replace",
"all",
"the",
"service",
"calls",
"provided",
"by",
"this",
"descriptor",
"with",
"the",
"the",
"given",
"service",
"calls",
"."
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L720-L722 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.doubleMax | public static <Key, Value> Aggregation<Key, Double, Double> doubleMax() {
return new AggregationAdapter(new DoubleMaxAggregation<Key, Value>());
} | java | public static <Key, Value> Aggregation<Key, Double, Double> doubleMax() {
return new AggregationAdapter(new DoubleMaxAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"Double",
",",
"Double",
">",
"doubleMax",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"DoubleMaxAggregation",
"<",
"Key",
",",
"Value",
">",
"(",
")... | Returns an aggregation to find the double 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",
"double",
"maximum",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELECT",
"MAX",
"(",
"value",
")",
"FROM",
"x<",
"/",
"p... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L234-L236 |
CenturyLinkCloud/mdw | mdw-workflow/assets/com/centurylink/mdw/microservice/MicroserviceRestAdapter.java | MicroserviceRestAdapter.notifyServiceSummaryUpdate | protected void notifyServiceSummaryUpdate(ServiceSummary serviceSummary) throws ActivityException {
WorkflowServices wfs = ServiceLocator.getWorkflowServices();
try {
wfs.notify("service-summary-update-" + getMasterRequestId(), null, 2);
} catch (ServiceException e) {
thr... | java | protected void notifyServiceSummaryUpdate(ServiceSummary serviceSummary) throws ActivityException {
WorkflowServices wfs = ServiceLocator.getWorkflowServices();
try {
wfs.notify("service-summary-update-" + getMasterRequestId(), null, 2);
} catch (ServiceException e) {
thr... | [
"protected",
"void",
"notifyServiceSummaryUpdate",
"(",
"ServiceSummary",
"serviceSummary",
")",
"throws",
"ActivityException",
"{",
"WorkflowServices",
"wfs",
"=",
"ServiceLocator",
".",
"getWorkflowServices",
"(",
")",
";",
"try",
"{",
"wfs",
".",
"notify",
"(",
"... | Standard behavior is to publish event fitting standard pattern of default event
used in DependenciesWaitActivity (Microservice Dependencies Wait) | [
"Standard",
"behavior",
"is",
"to",
"publish",
"event",
"fitting",
"standard",
"pattern",
"of",
"default",
"event",
"used",
"in",
"DependenciesWaitActivity",
"(",
"Microservice",
"Dependencies",
"Wait",
")"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/assets/com/centurylink/mdw/microservice/MicroserviceRestAdapter.java#L144-L151 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonWriter.java | JsonWriter.property | protected JsonWriter property(String key, Object[] array) throws IOException {
return property(key, Arrays.asList(array));
} | java | protected JsonWriter property(String key, Object[] array) throws IOException {
return property(key, Arrays.asList(array));
} | [
"protected",
"JsonWriter",
"property",
"(",
"String",
"key",
",",
"Object",
"[",
"]",
"array",
")",
"throws",
"IOException",
"{",
"return",
"property",
"(",
"key",
",",
"Arrays",
".",
"asList",
"(",
"array",
")",
")",
";",
"}"
] | Writes an array with the given key name
@param key the key name for the array
@param array the array to be written
@return This structured writer
@throws IOException Something went wrong writing | [
"Writes",
"an",
"array",
"with",
"the",
"given",
"key",
"name"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonWriter.java#L250-L252 |
groupby/api-java | src/main/java/com/groupbyinc/api/AbstractBridge.java | AbstractBridge.generateSecuredPayload | public static AesContent generateSecuredPayload(String customerId, String clientKey, String requestJson) throws GeneralSecurityException {
AesEncryption encryption = new AesEncryption(clientKey, customerId);
return encryption.encrypt(requestJson);
} | java | public static AesContent generateSecuredPayload(String customerId, String clientKey, String requestJson) throws GeneralSecurityException {
AesEncryption encryption = new AesEncryption(clientKey, customerId);
return encryption.encrypt(requestJson);
} | [
"public",
"static",
"AesContent",
"generateSecuredPayload",
"(",
"String",
"customerId",
",",
"String",
"clientKey",
",",
"String",
"requestJson",
")",
"throws",
"GeneralSecurityException",
"{",
"AesEncryption",
"encryption",
"=",
"new",
"AesEncryption",
"(",
"clientKey... | <code>
Generates a secured payload
</code>
@param customerId The customerId as seen in Command Center. Ensure this is not the subdomain, which can be `customerId-cors.groupbycloud.com`
@param clientKey The customerId as seen in Command Center
@param requestJson The query to encrypt | [
"<code",
">",
"Generates",
"a",
"secured",
"payload",
"<",
"/",
"code",
">"
] | train | https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/api/AbstractBridge.java#L540-L543 |
amaembo/streamex | src/main/java/one/util/streamex/DoubleStreamEx.java | DoubleStreamEx.joining | public String joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
return collect(DoubleCollector.joining(delimiter, prefix, suffix));
} | java | public String joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
return collect(DoubleCollector.joining(delimiter, prefix, suffix));
} | [
"public",
"String",
"joining",
"(",
"CharSequence",
"delimiter",
",",
"CharSequence",
"prefix",
",",
"CharSequence",
"suffix",
")",
"{",
"return",
"collect",
"(",
"DoubleCollector",
".",
"joining",
"(",
"delimiter",
",",
"prefix",
",",
"suffix",
")",
")",
";",... | Returns a {@link String} which is the concatenation of the results of
calling {@link String#valueOf(double)} on each element of this stream,
separated by the specified delimiter, with the specified prefix and
suffix in encounter order.
<p>
This is a terminal operation.
@param delimiter the delimiter to be used betwee... | [
"Returns",
"a",
"{",
"@link",
"String",
"}",
"which",
"is",
"the",
"concatenation",
"of",
"the",
"results",
"of",
"calling",
"{",
"@link",
"String#valueOf",
"(",
"double",
")",
"}",
"on",
"each",
"element",
"of",
"this",
"stream",
"separated",
"by",
"the",... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L1360-L1362 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getNavShowLists | protected Content getNavShowLists(DocPath link) {
DocLink dl = new DocLink(link, path.getPath(), null);
Content framesContent = getHyperLink(dl, framesLabel, "", "_top");
Content li = HtmlTree.LI(framesContent);
return li;
} | java | protected Content getNavShowLists(DocPath link) {
DocLink dl = new DocLink(link, path.getPath(), null);
Content framesContent = getHyperLink(dl, framesLabel, "", "_top");
Content li = HtmlTree.LI(framesContent);
return li;
} | [
"protected",
"Content",
"getNavShowLists",
"(",
"DocPath",
"link",
")",
"{",
"DocLink",
"dl",
"=",
"new",
"DocLink",
"(",
"link",
",",
"path",
".",
"getPath",
"(",
")",
",",
"null",
")",
";",
"Content",
"framesContent",
"=",
"getHyperLink",
"(",
"dl",
",... | Get "FRAMES" link, to switch to the frame version of the output.
@param link File to be linked, "index.html"
@return a content tree for the link | [
"Get",
"FRAMES",
"link",
"to",
"switch",
"to",
"the",
"frame",
"version",
"of",
"the",
"output",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L620-L625 |
haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java | QuickDrawContext.frameArc | public void frameArc(final Rectangle2D pRectangle, int pStartAngle, int pArcAngle) {
frameShape(toArc(pRectangle, pStartAngle, pArcAngle, false));
} | java | public void frameArc(final Rectangle2D pRectangle, int pStartAngle, int pArcAngle) {
frameShape(toArc(pRectangle, pStartAngle, pArcAngle, false));
} | [
"public",
"void",
"frameArc",
"(",
"final",
"Rectangle2D",
"pRectangle",
",",
"int",
"pStartAngle",
",",
"int",
"pArcAngle",
")",
"{",
"frameShape",
"(",
"toArc",
"(",
"pRectangle",
",",
"pStartAngle",
",",
"pArcAngle",
",",
"false",
")",
")",
";",
"}"
] | FrameArc(r,int,int) // outline arc with the size, pattern, and pattern mode of
the graphics pen.
@param pRectangle the rectangle to frame
@param pStartAngle start angle in degrees (starting from 12'o clock, this differs from Java)
@param pArcAngle rotation angle in degrees (starting from {@code pStartAngle}, this d... | [
"FrameArc",
"(",
"r",
"int",
"int",
")",
"//",
"outline",
"arc",
"with",
"the",
"size",
"pattern",
"and",
"pattern",
"mode",
"of",
"the",
"graphics",
"pen",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java#L728-L730 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newServiceInvocationException | public static ServiceInvocationException newServiceInvocationException(String message, Object... args) {
return newServiceInvocationException(null, message, args);
} | java | public static ServiceInvocationException newServiceInvocationException(String message, Object... args) {
return newServiceInvocationException(null, message, args);
} | [
"public",
"static",
"ServiceInvocationException",
"newServiceInvocationException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newServiceInvocationException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link ServiceInvocationException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link ServiceInvocationException exception}.
@param args {@link Object[] arguments} used to replace format placeho... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ServiceInvocationException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L671-L673 |
twitter/cloudhopper-commons | ch-commons-ssl/src/main/java/com/cloudhopper/commons/ssl/SslContextFactory.java | SslContextFactory.streamCopy | private static void streamCopy(InputStream is, OutputStream os, byte[] buf, boolean close) throws IOException {
int len;
if (buf == null) {
buf = new byte[4096];
}
while ((len = is.read(buf)) > 0) {
os.write(buf, 0, len);
}
os.flush();
if (... | java | private static void streamCopy(InputStream is, OutputStream os, byte[] buf, boolean close) throws IOException {
int len;
if (buf == null) {
buf = new byte[4096];
}
while ((len = is.read(buf)) > 0) {
os.write(buf, 0, len);
}
os.flush();
if (... | [
"private",
"static",
"void",
"streamCopy",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
",",
"byte",
"[",
"]",
"buf",
",",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"int",
"len",
";",
"if",
"(",
"buf",
"==",
"null",
")",
"{",
"buf"... | Copy the contents of is to os.
@param is
@param os
@param buf Can be null
@param close If true, is is closed after the copy.
@throws IOException | [
"Copy",
"the",
"contents",
"of",
"is",
"to",
"os",
"."
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-ssl/src/main/java/com/cloudhopper/commons/ssl/SslContextFactory.java#L382-L394 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setFieldByAlias | public void setFieldByAlias(String alias, Object value)
{
set(getParentFile().getCustomFields().getFieldByAlias(FieldTypeClass.TASK, alias), value);
} | java | public void setFieldByAlias(String alias, Object value)
{
set(getParentFile().getCustomFields().getFieldByAlias(FieldTypeClass.TASK, alias), value);
} | [
"public",
"void",
"setFieldByAlias",
"(",
"String",
"alias",
",",
"Object",
"value",
")",
"{",
"set",
"(",
"getParentFile",
"(",
")",
".",
"getCustomFields",
"(",
")",
".",
"getFieldByAlias",
"(",
"FieldTypeClass",
".",
"TASK",
",",
"alias",
")",
",",
"val... | Set the value of a field using its alias.
@param alias field alias
@param value field value | [
"Set",
"the",
"value",
"of",
"a",
"field",
"using",
"its",
"alias",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3743-L3746 |
assaydepot/assaydepot-java | src/main/java/com/assaydepot/AssayDepotTreeImpl.java | AssayDepotTreeImpl.buildFacetString | private String buildFacetString(List<String> facetNames, List<String>facetValues ) {
StringBuilder builder = new StringBuilder();
if( facetNames != null && facetValues != null )
{
int pairsCount = -1;
if( facetNames.size() != facetValues.size() ) {
pairsCount = facetNames.size() > facetValues.size(... | java | private String buildFacetString(List<String> facetNames, List<String>facetValues ) {
StringBuilder builder = new StringBuilder();
if( facetNames != null && facetValues != null )
{
int pairsCount = -1;
if( facetNames.size() != facetValues.size() ) {
pairsCount = facetNames.size() > facetValues.size(... | [
"private",
"String",
"buildFacetString",
"(",
"List",
"<",
"String",
">",
"facetNames",
",",
"List",
"<",
"String",
">",
"facetValues",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"facetNames",
"!=",
"null",
... | Takes in a list of names/values and pairs them up to make a good url. if the list
sizes don't match up does the best it can by matching up the smallest number of pairs.
@param facetNames
@param facetValues
@return | [
"Takes",
"in",
"a",
"list",
"of",
"names",
"/",
"values",
"and",
"pairs",
"them",
"up",
"to",
"make",
"a",
"good",
"url",
".",
"if",
"the",
"list",
"sizes",
"don",
"t",
"match",
"up",
"does",
"the",
"best",
"it",
"can",
"by",
"matching",
"up",
"the... | train | https://github.com/assaydepot/assaydepot-java/blob/26a1af17651dbee3d7e9c17932eabea828933d01/src/main/java/com/assaydepot/AssayDepotTreeImpl.java#L203-L229 |
google/closure-compiler | src/com/google/javascript/jscomp/AbstractPeepholeOptimization.java | AbstractPeepholeOptimization.areNodesEqualForInlining | protected boolean areNodesEqualForInlining(Node n1, Node n2) {
/* Our implementation delegates to the compiler. We provide this
* method because we don't want to expose Compiler to PeepholeOptimizations.
*/
checkNotNull(compiler);
return compiler.areNodesEqualForInlining(n1, n2);
} | java | protected boolean areNodesEqualForInlining(Node n1, Node n2) {
/* Our implementation delegates to the compiler. We provide this
* method because we don't want to expose Compiler to PeepholeOptimizations.
*/
checkNotNull(compiler);
return compiler.areNodesEqualForInlining(n1, n2);
} | [
"protected",
"boolean",
"areNodesEqualForInlining",
"(",
"Node",
"n1",
",",
"Node",
"n2",
")",
"{",
"/* Our implementation delegates to the compiler. We provide this\n * method because we don't want to expose Compiler to PeepholeOptimizations.\n */",
"checkNotNull",
"(",
"compile... | Are the nodes equal for the purpose of inlining?
If type aware optimizations are on, type equality is checked. | [
"Are",
"the",
"nodes",
"equal",
"for",
"the",
"purpose",
"of",
"inlining?",
"If",
"type",
"aware",
"optimizations",
"are",
"on",
"type",
"equality",
"is",
"checked",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractPeepholeOptimization.java#L62-L68 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java | ST_Graph.createGraph | public static boolean createGraph(Connection connection,
String inputTable,
String spatialFieldName,
double tolerance,
boolean orientBySlope) throws SQLException {
... | java | public static boolean createGraph(Connection connection,
String inputTable,
String spatialFieldName,
double tolerance,
boolean orientBySlope) throws SQLException {
... | [
"public",
"static",
"boolean",
"createGraph",
"(",
"Connection",
"connection",
",",
"String",
"inputTable",
",",
"String",
"spatialFieldName",
",",
"double",
"tolerance",
",",
"boolean",
"orientBySlope",
")",
"throws",
"SQLException",
"{",
"return",
"createGraph",
"... | Create the nodes and edges tables from the input table containing
LINESTRINGs in the given column and using the given
tolerance, and potentially orienting edges by slope.
<p/>
The tolerance value is used specify the side length of a square Envelope
around each node used to snap together other nodes within the same
Enve... | [
"Create",
"the",
"nodes",
"and",
"edges",
"tables",
"from",
"the",
"input",
"table",
"containing",
"LINESTRINGs",
"in",
"the",
"given",
"column",
"and",
"using",
"the",
"given",
"tolerance",
"and",
"potentially",
"orienting",
"edges",
"by",
"slope",
".",
"<p",... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L191-L197 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/CreateIdentityPoolResult.java | CreateIdentityPoolResult.withIdentityPoolTags | public CreateIdentityPoolResult withIdentityPoolTags(java.util.Map<String, String> identityPoolTags) {
setIdentityPoolTags(identityPoolTags);
return this;
} | java | public CreateIdentityPoolResult withIdentityPoolTags(java.util.Map<String, String> identityPoolTags) {
setIdentityPoolTags(identityPoolTags);
return this;
} | [
"public",
"CreateIdentityPoolResult",
"withIdentityPoolTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"identityPoolTags",
")",
"{",
"setIdentityPoolTags",
"(",
"identityPoolTags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags that are assigned to the identity pool. A tag is a label that you can apply to identity pools to
categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.
</p>
@param identityPoolTags
The tags that are assigned to the identity pool. A tag is a label that you ... | [
"<p",
">",
"The",
"tags",
"that",
"are",
"assigned",
"to",
"the",
"identity",
"pool",
".",
"A",
"tag",
"is",
"a",
"label",
"that",
"you",
"can",
"apply",
"to",
"identity",
"pools",
"to",
"categorize",
"and",
"manage",
"them",
"in",
"different",
"ways",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/CreateIdentityPoolResult.java#L569-L572 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/CORBA_Utils.java | CORBA_Utils.getRequiredOutputStreamType | static Type getRequiredOutputStreamType(Class<?> clazz,
int rmicCompatible) // PM46698
{
// NOTE: This logic must be kept in sync with write_value
if (clazz == Void.TYPE || // nothing to write
clazz == Object.class || // writeAny
c... | java | static Type getRequiredOutputStreamType(Class<?> clazz,
int rmicCompatible) // PM46698
{
// NOTE: This logic must be kept in sync with write_value
if (clazz == Void.TYPE || // nothing to write
clazz == Object.class || // writeAny
c... | [
"static",
"Type",
"getRequiredOutputStreamType",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"int",
"rmicCompatible",
")",
"// PM46698",
"{",
"// NOTE: This logic must be kept in sync with write_value",
"if",
"(",
"clazz",
"==",
"Void",
".",
"TYPE",
"||",
"// nothing t... | Returns the ASM Type object for the OutputStream required to write
an instance of the specified class. <p>
Many parameter and return value types may be serialized using the
original org.omg.CORBA.portable.OutputStream implementation,
however, some require the new CORBA_2_3 subclass. This method
consolidates the logic ... | [
"Returns",
"the",
"ASM",
"Type",
"object",
"for",
"the",
"OutputStream",
"required",
"to",
"write",
"an",
"instance",
"of",
"the",
"specified",
"class",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/CORBA_Utils.java#L128-L155 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java | JSONHelpers.loadJSONAsset | public static JSONObject loadJSONAsset(Context context, final String asset) {
if (asset == null) {
return new JSONObject();
}
return getJsonObject(org.gearvrf.widgetlib.main.Utility.readTextFile(context, asset));
} | java | public static JSONObject loadJSONAsset(Context context, final String asset) {
if (asset == null) {
return new JSONObject();
}
return getJsonObject(org.gearvrf.widgetlib.main.Utility.readTextFile(context, asset));
} | [
"public",
"static",
"JSONObject",
"loadJSONAsset",
"(",
"Context",
"context",
",",
"final",
"String",
"asset",
")",
"{",
"if",
"(",
"asset",
"==",
"null",
")",
"{",
"return",
"new",
"JSONObject",
"(",
")",
";",
"}",
"return",
"getJsonObject",
"(",
"org",
... | Load a JSON file from the application's "asset" directory.
@param context Valid {@link Context}
@param asset Name of the JSON file
@return New instance of {@link JSONObject} | [
"Load",
"a",
"JSON",
"file",
"from",
"the",
"application",
"s",
"asset",
"directory",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L1138-L1143 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/GeometryCollection.java | GeometryCollection.fromGeometry | public static GeometryCollection fromGeometry(@NonNull Geometry geometry) {
List<Geometry> geometries = Arrays.asList(geometry);
return new GeometryCollection(TYPE, null, geometries);
} | java | public static GeometryCollection fromGeometry(@NonNull Geometry geometry) {
List<Geometry> geometries = Arrays.asList(geometry);
return new GeometryCollection(TYPE, null, geometries);
} | [
"public",
"static",
"GeometryCollection",
"fromGeometry",
"(",
"@",
"NonNull",
"Geometry",
"geometry",
")",
"{",
"List",
"<",
"Geometry",
">",
"geometries",
"=",
"Arrays",
".",
"asList",
"(",
"geometry",
")",
";",
"return",
"new",
"GeometryCollection",
"(",
"T... | Create a new instance of this class by giving the collection a single GeoJSON {@link Geometry}.
@param geometry a non-null object of type geometry which makes up this collection
@return a new instance of this class defined by the values passed inside this static factory
method
@since 3.0.0 | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"giving",
"the",
"collection",
"a",
"single",
"GeoJSON",
"{",
"@link",
"Geometry",
"}",
"."
] | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/GeometryCollection.java#L126-L129 |
realtime-framework/RealtimeMessaging-Android | library/src/main/java/ibt/ortc/extensibility/OrtcClient.java | OrtcClient.subscribeWithBuffer | public void subscribeWithBuffer(String channel, String subscriberId, final OnMessageWithBuffer onMessage){
if (subscriberId != null) {
HashMap options = new HashMap();
options.put("channel", channel);
options.put("subscribeOnReconnected", true);
options.put("subsc... | java | public void subscribeWithBuffer(String channel, String subscriberId, final OnMessageWithBuffer onMessage){
if (subscriberId != null) {
HashMap options = new HashMap();
options.put("channel", channel);
options.put("subscribeOnReconnected", true);
options.put("subsc... | [
"public",
"void",
"subscribeWithBuffer",
"(",
"String",
"channel",
",",
"String",
"subscriberId",
",",
"final",
"OnMessageWithBuffer",
"onMessage",
")",
"{",
"if",
"(",
"subscriberId",
"!=",
"null",
")",
"{",
"HashMap",
"options",
"=",
"new",
"HashMap",
"(",
"... | Subscribes to a channel to receive messages published to it.
@param channel
The channel name.
@param subscriberId
The subscriberId associated to the channel.
@param OnMessageWithBuffer
The callback called when a message arrives at the channel and message seqId number. | [
"Subscribes",
"to",
"a",
"channel",
"to",
"receive",
"messages",
"published",
"to",
"it",
"."
] | train | https://github.com/realtime-framework/RealtimeMessaging-Android/blob/f0d87b92ed7c591bcfe2b9cf45b947865570e061/library/src/main/java/ibt/ortc/extensibility/OrtcClient.java#L707-L733 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/OpportunitiesApi.java | OpportunitiesApi.getOpportunitiesTasksTaskId | public OpportunitiesTasksResponse getOpportunitiesTasksTaskId(Integer taskId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<OpportunitiesTasksResponse> resp = getOpportunitiesTasksTaskIdWithHttpInfo(taskId, datasource,
ifNoneMatch);
return resp.getD... | java | public OpportunitiesTasksResponse getOpportunitiesTasksTaskId(Integer taskId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<OpportunitiesTasksResponse> resp = getOpportunitiesTasksTaskIdWithHttpInfo(taskId, datasource,
ifNoneMatch);
return resp.getD... | [
"public",
"OpportunitiesTasksResponse",
"getOpportunitiesTasksTaskId",
"(",
"Integer",
"taskId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"OpportunitiesTasksResponse",
">",
"resp",
"=",
"getOpportun... | Get opportunities task Return information of an opportunities task ---
This route expires daily at 11:05
@param taskId
ID of an opportunities task (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 304 will be retu... | [
"Get",
"opportunities",
"task",
"Return",
"information",
"of",
"an",
"opportunities",
"task",
"---",
"This",
"route",
"expires",
"daily",
"at",
"11",
":",
"05"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/OpportunitiesApi.java#L748-L753 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResponseRequest.java | PutIntegrationResponseRequest.withResponseTemplates | public PutIntegrationResponseRequest withResponseTemplates(java.util.Map<String, String> responseTemplates) {
setResponseTemplates(responseTemplates);
return this;
} | java | public PutIntegrationResponseRequest withResponseTemplates(java.util.Map<String, String> responseTemplates) {
setResponseTemplates(responseTemplates);
return this;
} | [
"public",
"PutIntegrationResponseRequest",
"withResponseTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseTemplates",
")",
"{",
"setResponseTemplates",
"(",
"responseTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Specifies a put integration response's templates.
</p>
@param responseTemplates
Specifies a put integration response's templates.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Specifies",
"a",
"put",
"integration",
"response",
"s",
"templates",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResponseRequest.java#L450-L453 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setEnterpriseDate | public void setEnterpriseDate(int index, Date value)
{
set(selectField(ResourceFieldLists.ENTERPRISE_DATE, index), value);
} | java | public void setEnterpriseDate(int index, Date value)
{
set(selectField(ResourceFieldLists.ENTERPRISE_DATE, index), value);
} | [
"public",
"void",
"setEnterpriseDate",
"(",
"int",
"index",
",",
"Date",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"ENTERPRISE_DATE",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set an enterprise field value.
@param index field index
@param value field value | [
"Set",
"an",
"enterprise",
"field",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L2073-L2076 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getTrailingCharCount | @Nonnegative
public static int getTrailingCharCount (@Nullable final String s, final char c)
{
int ret = 0;
if (s != null)
{
int nLast = s.length () - 1;
while (nLast >= 0 && s.charAt (nLast) == c)
{
++ret;
--nLast;
}
}
return ret;
} | java | @Nonnegative
public static int getTrailingCharCount (@Nullable final String s, final char c)
{
int ret = 0;
if (s != null)
{
int nLast = s.length () - 1;
while (nLast >= 0 && s.charAt (nLast) == c)
{
++ret;
--nLast;
}
}
return ret;
} | [
"@",
"Nonnegative",
"public",
"static",
"int",
"getTrailingCharCount",
"(",
"@",
"Nullable",
"final",
"String",
"s",
",",
"final",
"char",
"c",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"int",
"nLast",
"=",
"s",
... | Get the number of specified chars, the passed string ends with.
@param s
The string to be parsed. May be <code>null</code>.
@param c
The char to be searched.
@return Always ≥ 0. | [
"Get",
"the",
"number",
"of",
"specified",
"chars",
"the",
"passed",
"string",
"ends",
"with",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L861-L875 |
elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java | FastMultidimensionalScalingTransform.updateMatrix | protected void updateMatrix(double[][] mat, final double[] evec, double eval) {
final int size = mat.length;
for(int i = 0; i < size; i++) {
final double[] mati = mat[i];
final double eveci = evec[i];
for(int j = 0; j < size; j++) {
mati[j] -= eval * eveci * evec[j];
}
}
} | java | protected void updateMatrix(double[][] mat, final double[] evec, double eval) {
final int size = mat.length;
for(int i = 0; i < size; i++) {
final double[] mati = mat[i];
final double eveci = evec[i];
for(int j = 0; j < size; j++) {
mati[j] -= eval * eveci * evec[j];
}
}
} | [
"protected",
"void",
"updateMatrix",
"(",
"double",
"[",
"]",
"[",
"]",
"mat",
",",
"final",
"double",
"[",
"]",
"evec",
",",
"double",
"eval",
")",
"{",
"final",
"int",
"size",
"=",
"mat",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | Update matrix, by removing the effects of a known Eigenvector.
@param mat Matrix
@param evec Known normalized Eigenvector
@param eval Eigenvalue | [
"Update",
"matrix",
"by",
"removing",
"the",
"effects",
"of",
"a",
"known",
"Eigenvector",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L304-L313 |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/FileFinder.java | FileFinder.findFile | public static File findFile(File rootDir, FilenameFilter filter) {
File[] files = rootDir.listFiles(filter);
Arrays.sort(files);
if (files.length > 0) {
return files[0];
}
files = rootDir.listFiles(directoryFilter);
Arrays.sort(files);
for (File subDi... | java | public static File findFile(File rootDir, FilenameFilter filter) {
File[] files = rootDir.listFiles(filter);
Arrays.sort(files);
if (files.length > 0) {
return files[0];
}
files = rootDir.listFiles(directoryFilter);
Arrays.sort(files);
for (File subDi... | [
"public",
"static",
"File",
"findFile",
"(",
"File",
"rootDir",
",",
"FilenameFilter",
"filter",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"rootDir",
".",
"listFiles",
"(",
"filter",
")",
";",
"Arrays",
".",
"sort",
"(",
"files",
")",
";",
"if",
"(",
... | Finds a file matching the given file name filter in the given root directory or any
subdirectory. The files and directories are scanned in alphabetical order, so the result is
deterministic.
<p>
The method returns the first matching result, if any, and ignores all other matches.
@param rootDir
root directory
@param fi... | [
"Finds",
"a",
"file",
"matching",
"the",
"given",
"file",
"name",
"filter",
"in",
"the",
"given",
"root",
"directory",
"or",
"any",
"subdirectory",
".",
"The",
"files",
"and",
"directories",
"are",
"scanned",
"in",
"alphabetical",
"order",
"so",
"the",
"resu... | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/FileFinder.java#L86-L102 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayCountryInternal | private static String getDisplayCountryInternal(ULocale locale, ULocale displayLocale) {
return LocaleDisplayNames.getInstance(displayLocale)
.regionDisplayName(locale.getCountry());
} | java | private static String getDisplayCountryInternal(ULocale locale, ULocale displayLocale) {
return LocaleDisplayNames.getInstance(displayLocale)
.regionDisplayName(locale.getCountry());
} | [
"private",
"static",
"String",
"getDisplayCountryInternal",
"(",
"ULocale",
"locale",
",",
"ULocale",
"displayLocale",
")",
"{",
"return",
"LocaleDisplayNames",
".",
"getInstance",
"(",
"displayLocale",
")",
".",
"regionDisplayName",
"(",
"locale",
".",
"getCountry",
... | displayLocaleID is canonical, localeID need not be since parsing will fix this. | [
"displayLocaleID",
"is",
"canonical",
"localeID",
"need",
"not",
"be",
"since",
"parsing",
"will",
"fix",
"this",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1611-L1614 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/report/model/StepFormatter.java | StepFormatter.nextIndex | private static int nextIndex( String description, int defaultIndex ) {
Pattern startsWithNumber = Pattern.compile( "(\\d+).*" );
Matcher matcher = startsWithNumber.matcher( description );
if( matcher.matches() ) {
return Integer.parseInt( matcher.group( 1 ) ) - 1;
}
... | java | private static int nextIndex( String description, int defaultIndex ) {
Pattern startsWithNumber = Pattern.compile( "(\\d+).*" );
Matcher matcher = startsWithNumber.matcher( description );
if( matcher.matches() ) {
return Integer.parseInt( matcher.group( 1 ) ) - 1;
}
... | [
"private",
"static",
"int",
"nextIndex",
"(",
"String",
"description",
",",
"int",
"defaultIndex",
")",
"{",
"Pattern",
"startsWithNumber",
"=",
"Pattern",
".",
"compile",
"(",
"\"(\\\\d+).*\"",
")",
";",
"Matcher",
"matcher",
"=",
"startsWithNumber",
".",
"matc... | Returns the next index of the argument by decrementing 1 from the possibly parsed number
@param description this String will be searched from the start for a number
@param defaultIndex this will be returned if the match does not succeed
@return the parsed index or the defaultIndex | [
"Returns",
"the",
"next",
"index",
"of",
"the",
"argument",
"by",
"decrementing",
"1",
"from",
"the",
"possibly",
"parsed",
"number"
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/report/model/StepFormatter.java#L319-L328 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/util/WorkQueue.java | WorkQueue.run | public void run(Collection<Runnable> tasks) {
// Create a semphore that the wrapped runnables will execute
int numTasks = tasks.size();
CountDownLatch latch = new CountDownLatch(numTasks);
for (Runnable r : tasks) {
if (r == null)
throw new NullPointerExceptio... | java | public void run(Collection<Runnable> tasks) {
// Create a semphore that the wrapped runnables will execute
int numTasks = tasks.size();
CountDownLatch latch = new CountDownLatch(numTasks);
for (Runnable r : tasks) {
if (r == null)
throw new NullPointerExceptio... | [
"public",
"void",
"run",
"(",
"Collection",
"<",
"Runnable",
">",
"tasks",
")",
"{",
"// Create a semphore that the wrapped runnables will execute",
"int",
"numTasks",
"=",
"tasks",
".",
"size",
"(",
")",
";",
"CountDownLatch",
"latch",
"=",
"new",
"CountDownLatch",... | Executes the tasks using a thread pool and returns once all tasks have
finished.
@throws IllegalStateException if interrupted while waiting for the tasks
to finish | [
"Executes",
"the",
"tasks",
"using",
"a",
"thread",
"pool",
"and",
"returns",
"once",
"all",
"tasks",
"have",
"finished",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/WorkQueue.java#L309-L325 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getCurrentActionResolver | public static ActionResolver getCurrentActionResolver( HttpServletRequest request )
{
ServletContext servletContext = InternalUtils.getServletContext( request );
return getCurrentActionResolver( request, servletContext );
} | java | public static ActionResolver getCurrentActionResolver( HttpServletRequest request )
{
ServletContext servletContext = InternalUtils.getServletContext( request );
return getCurrentActionResolver( request, servletContext );
} | [
"public",
"static",
"ActionResolver",
"getCurrentActionResolver",
"(",
"HttpServletRequest",
"request",
")",
"{",
"ServletContext",
"servletContext",
"=",
"InternalUtils",
".",
"getServletContext",
"(",
"request",
")",
";",
"return",
"getCurrentActionResolver",
"(",
"requ... | Get the current ActionResolver.
@deprecated Use {@link #getCurrentPageFlow(HttpServletRequest, ServletContext)} instead.
@return the current ActionResolver from the user session, or <code>null</code> if there is none. | [
"Get",
"the",
"current",
"ActionResolver",
".",
"@deprecated",
"Use",
"{",
"@link",
"#getCurrentPageFlow",
"(",
"HttpServletRequest",
"ServletContext",
")",
"}",
"instead",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L285-L289 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/util/ReflectionUtils.java | ReflectionUtils.getReadMethod | public static Optional<Method> getReadMethod(Field field) {
String fieldName = field.getName();
Class<?> fieldClass = field.getDeclaringClass();
String capitalizedFieldName = fieldName.substring(0, 1).toUpperCase(ENGLISH) + fieldName.substring(1);
// try to find getProperty
Optio... | java | public static Optional<Method> getReadMethod(Field field) {
String fieldName = field.getName();
Class<?> fieldClass = field.getDeclaringClass();
String capitalizedFieldName = fieldName.substring(0, 1).toUpperCase(ENGLISH) + fieldName.substring(1);
// try to find getProperty
Optio... | [
"public",
"static",
"Optional",
"<",
"Method",
">",
"getReadMethod",
"(",
"Field",
"field",
")",
"{",
"String",
"fieldName",
"=",
"field",
".",
"getName",
"(",
")",
";",
"Class",
"<",
"?",
">",
"fieldClass",
"=",
"field",
".",
"getDeclaringClass",
"(",
"... | Get the read method for given field.
@param field field to get the read method for.
@return Optional of read method or empty if field has no read method | [
"Get",
"the",
"read",
"method",
"for",
"given",
"field",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/util/ReflectionUtils.java#L510-L521 |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/datasegment/AbstractDataSegment.java | AbstractDataSegment.resizeBuffer | protected void resizeBuffer (final int additionalLength, final boolean copyData) {
if (additionalLength < 0) { throw new IllegalArgumentException("The length must be greater or equal than 0."); }
dataBuffer.position(length);
// reallocate a bigger dataBuffer, if needed
if (length + ad... | java | protected void resizeBuffer (final int additionalLength, final boolean copyData) {
if (additionalLength < 0) { throw new IllegalArgumentException("The length must be greater or equal than 0."); }
dataBuffer.position(length);
// reallocate a bigger dataBuffer, if needed
if (length + ad... | [
"protected",
"void",
"resizeBuffer",
"(",
"final",
"int",
"additionalLength",
",",
"final",
"boolean",
"copyData",
")",
"{",
"if",
"(",
"additionalLength",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The length must be greater or equal than... | This method resizes the data buffer, if necessary. A resizing is not needed, when the <code>neededLength</code>
is greater than the capacity of allocated data buffer. The flag <code>copyData</code> indicates, if the old
buffer has to be copied into the new bigger data buffer.
@param additionalLength The length, which ... | [
"This",
"method",
"resizes",
"the",
"data",
"buffer",
"if",
"necessary",
".",
"A",
"resizing",
"is",
"not",
"needed",
"when",
"the",
"<code",
">",
"neededLength<",
"/",
"code",
">",
"is",
"greater",
"than",
"the",
"capacity",
"of",
"allocated",
"data",
"bu... | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/datasegment/AbstractDataSegment.java#L131-L154 |
jenkinsci/jenkins | core/src/main/java/hudson/model/ParameterValue.java | ParameterValue.buildEnvVars | @Deprecated
public void buildEnvVars(AbstractBuild<?,?> build, Map<String,String> env) {
if (env instanceof EnvVars) {
if (Util.isOverridden(ParameterValue.class, getClass(), "buildEnvironment", Run.class, EnvVars.class)) {
// if the subtype already derives buildEnvironment, then... | java | @Deprecated
public void buildEnvVars(AbstractBuild<?,?> build, Map<String,String> env) {
if (env instanceof EnvVars) {
if (Util.isOverridden(ParameterValue.class, getClass(), "buildEnvironment", Run.class, EnvVars.class)) {
// if the subtype already derives buildEnvironment, then... | [
"@",
"Deprecated",
"public",
"void",
"buildEnvVars",
"(",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"build",
",",
"Map",
"<",
"String",
",",
"String",
">",
"env",
")",
"{",
"if",
"(",
"env",
"instanceof",
"EnvVars",
")",
"{",
"if",
"(",
"Util",
".",
... | Adds environmental variables for the builds to the given map.
<p>
This provides a means for a parameter to pass the parameter
values to the build to be performed.
<p>
When this method is invoked, the map already contains the
current "planned export" list. The implementation is
expected to add more values to this map ... | [
"Adds",
"environmental",
"variables",
"for",
"the",
"builds",
"to",
"the",
"given",
"map",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ParameterValue.java#L151-L162 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/UtilReflection.java | UtilReflection.createReduce | @SuppressWarnings("unchecked")
public static <T> T createReduce(Class<T> type, Object... params) throws NoSuchMethodException
{
Check.notNull(type);
Check.notNull(params);
final Class<?>[] paramTypes = getParamTypes(params);
final Queue<Class<?>> typesQueue = new ArrayDeq... | java | @SuppressWarnings("unchecked")
public static <T> T createReduce(Class<T> type, Object... params) throws NoSuchMethodException
{
Check.notNull(type);
Check.notNull(params);
final Class<?>[] paramTypes = getParamTypes(params);
final Queue<Class<?>> typesQueue = new ArrayDeq... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"createReduce",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Object",
"...",
"params",
")",
"throws",
"NoSuchMethodException",
"{",
"Check",
".",
"notNull",
"(",
"typ... | Create a class instance with its parameters. Use a compatible constructor with the following parameters, reducing
parameter types array as a queue until empty in order to find a constructor.
@param <T> The element type used.
@param type The class type (must not be <code>null</code>).
@param params The maximum paramete... | [
"Create",
"a",
"class",
"instance",
"with",
"its",
"parameters",
".",
"Use",
"a",
"compatible",
"constructor",
"with",
"the",
"following",
"parameters",
"reducing",
"parameter",
"types",
"array",
"as",
"a",
"queue",
"until",
"empty",
"in",
"order",
"to",
"find... | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilReflection.java#L85-L117 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/FormatUtilities.java | FormatUtilities.getDateTime | static public long getDateTime(String s, String format, boolean useTZ, boolean throwException)
{
long ret = 0L;
SimpleDateFormat df = null;
try
{
if(s!= null && s.length() > 0)
{
df = formatPool.getFormat(format);
if(useTZ)
... | java | static public long getDateTime(String s, String format, boolean useTZ, boolean throwException)
{
long ret = 0L;
SimpleDateFormat df = null;
try
{
if(s!= null && s.length() > 0)
{
df = formatPool.getFormat(format);
if(useTZ)
... | [
"static",
"public",
"long",
"getDateTime",
"(",
"String",
"s",
",",
"String",
"format",
",",
"boolean",
"useTZ",
",",
"boolean",
"throwException",
")",
"{",
"long",
"ret",
"=",
"0L",
";",
"SimpleDateFormat",
"df",
"=",
"null",
";",
"try",
"{",
"if",
"(",... | Returns the given date time parsed using the given format.
@param s The formatted date to be parsed
@param format The format to use when parsing the date
@param useTZ <CODE>true</CODE> if the date should be parsed using the current timezone
@param throwException <CODE>true</CODE> if an exception should be thrown for an... | [
"Returns",
"the",
"given",
"date",
"time",
"parsed",
"using",
"the",
"given",
"format",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/FormatUtilities.java#L273-L301 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.collectEntries | public static <K, V, E> Map<K, V> collectEntries(Iterator<E> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<?> transform) {
return collectEntries(self, new LinkedHashMap<K, V>(), transform);
} | java | public static <K, V, E> Map<K, V> collectEntries(Iterator<E> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<?> transform) {
return collectEntries(self, new LinkedHashMap<K, V>(), transform);
} | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"E",
">",
"Map",
"<",
"K",
",",
"V",
">",
"collectEntries",
"(",
"Iterator",
"<",
"E",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
".",
"FirstGenericType",
".",
"class",
")",
"Closure",
"<",... | A variant of collectEntries for Iterators.
@param self an Iterator
@param transform the closure used for transforming, which has an item from self as the parameter and
should return a Map.Entry, a Map or a two-element list containing the resulting key and value
@return a Map of the transformed entries
@see #colle... | [
"A",
"variant",
"of",
"collectEntries",
"for",
"Iterators",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4022-L4024 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/core/mtc/MessageToClientManager.java | MessageToClientManager._getDataService | Object _getDataService(T session, Class cls) throws DataServiceException {
String dataServiceClassName = cls.getName();
DataService dataServiceAnno = (DataService) cls.getAnnotation(DataService.class);
IDataServiceResolver resolver = getResolver(dataServiceAnno.resolver());
Scope scope = resolver.getScope(c... | java | Object _getDataService(T session, Class cls) throws DataServiceException {
String dataServiceClassName = cls.getName();
DataService dataServiceAnno = (DataService) cls.getAnnotation(DataService.class);
IDataServiceResolver resolver = getResolver(dataServiceAnno.resolver());
Scope scope = resolver.getScope(c... | [
"Object",
"_getDataService",
"(",
"T",
"session",
",",
"Class",
"cls",
")",
"throws",
"DataServiceException",
"{",
"String",
"dataServiceClassName",
"=",
"cls",
".",
"getName",
"(",
")",
";",
"DataService",
"dataServiceAnno",
"=",
"(",
"DataService",
")",
"cls",... | Get Dataservice, store dataservice in session if session scope.<br>
@param session
@param cls
@return
@throws DataServiceException | [
"Get",
"Dataservice",
"store",
"dataservice",
"in",
"session",
"if",
"session",
"scope",
".",
"<br",
">"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/core/mtc/MessageToClientManager.java#L93-L113 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java | ClassDescriptor.getAttributeDescriptorsForPath | public ArrayList getAttributeDescriptorsForPath(String aPath, Map pathHints)
{
return getAttributeDescriptorsForCleanPath(SqlHelper.cleanPath(aPath), pathHints);
} | java | public ArrayList getAttributeDescriptorsForPath(String aPath, Map pathHints)
{
return getAttributeDescriptorsForCleanPath(SqlHelper.cleanPath(aPath), pathHints);
} | [
"public",
"ArrayList",
"getAttributeDescriptorsForPath",
"(",
"String",
"aPath",
",",
"Map",
"pathHints",
")",
"{",
"return",
"getAttributeDescriptorsForCleanPath",
"(",
"SqlHelper",
".",
"cleanPath",
"(",
"aPath",
")",
",",
"pathHints",
")",
";",
"}"
] | return all AttributeDescriptors for the path<br>
ie: partner.addresses.street returns a Collection of 3 AttributeDescriptors
(ObjectReferenceDescriptor, CollectionDescriptor, FieldDescriptor)<br>
ie: partner.addresses returns a Collection of 2 AttributeDescriptors
(ObjectReferenceDescriptor, CollectionDescriptor)
@para... | [
"return",
"all",
"AttributeDescriptors",
"for",
"the",
"path<br",
">",
"ie",
":",
"partner",
".",
"addresses",
".",
"street",
"returns",
"a",
"Collection",
"of",
"3",
"AttributeDescriptors",
"(",
"ObjectReferenceDescriptor",
"CollectionDescriptor",
"FieldDescriptor",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java#L1193-L1196 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/PLFIntegrator.java | PLFIntegrator.appendChild | static Element appendChild(Element plfChild, Element parent, boolean copyChildren) {
Document document = parent.getOwnerDocument();
Element copy = (Element) document.importNode(plfChild, false);
parent.appendChild(copy);
// set the identifier for the doc if warrented
String id =... | java | static Element appendChild(Element plfChild, Element parent, boolean copyChildren) {
Document document = parent.getOwnerDocument();
Element copy = (Element) document.importNode(plfChild, false);
parent.appendChild(copy);
// set the identifier for the doc if warrented
String id =... | [
"static",
"Element",
"appendChild",
"(",
"Element",
"plfChild",
",",
"Element",
"parent",
",",
"boolean",
"copyChildren",
")",
"{",
"Document",
"document",
"=",
"parent",
".",
"getOwnerDocument",
"(",
")",
";",
"Element",
"copy",
"=",
"(",
"Element",
")",
"d... | This method copies a plf node and any of its children into the passed in compViewParent. | [
"This",
"method",
"copies",
"a",
"plf",
"node",
"and",
"any",
"of",
"its",
"children",
"into",
"the",
"passed",
"in",
"compViewParent",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/PLFIntegrator.java#L208-L225 |
Erudika/para | para-server/src/main/java/com/erudika/para/rest/RestUtils.java | RestUtils.getPagerFromParams | public static Pager getPagerFromParams(MultivaluedMap<String, String> params) {
Pager pager = new Pager();
pager.setPage(NumberUtils.toLong(paramOrDefault(params, "page", ""), 0));
if (pager.getPage() > Config.MAX_PAGES) {
pager.setPage(Config.MAX_PAGES);
}
pager.setLimit(NumberUtils.toInt(paramOrDefault(p... | java | public static Pager getPagerFromParams(MultivaluedMap<String, String> params) {
Pager pager = new Pager();
pager.setPage(NumberUtils.toLong(paramOrDefault(params, "page", ""), 0));
if (pager.getPage() > Config.MAX_PAGES) {
pager.setPage(Config.MAX_PAGES);
}
pager.setLimit(NumberUtils.toInt(paramOrDefault(p... | [
"public",
"static",
"Pager",
"getPagerFromParams",
"(",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"Pager",
"pager",
"=",
"new",
"Pager",
"(",
")",
";",
"pager",
".",
"setPage",
"(",
"NumberUtils",
".",
"toLong",
"(",
"paramOr... | Returns a {@link Pager} instance populated from request parameters.
@param params query params map
@return a Pager | [
"Returns",
"a",
"{"
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/rest/RestUtils.java#L898-L912 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/MetaModel.java | MetaModel.getAssociationForTarget | public <A extends Association> A getAssociationForTarget(Class<? extends Model> targetModelClass, Class<A> associationClass){
Association result = null;
for (Association association : associations) {
if (association.getClass().getName().equals(associationClass.getName()) && association.getTa... | java | public <A extends Association> A getAssociationForTarget(Class<? extends Model> targetModelClass, Class<A> associationClass){
Association result = null;
for (Association association : associations) {
if (association.getClass().getName().equals(associationClass.getName()) && association.getTa... | [
"public",
"<",
"A",
"extends",
"Association",
">",
"A",
"getAssociationForTarget",
"(",
"Class",
"<",
"?",
"extends",
"Model",
">",
"targetModelClass",
",",
"Class",
"<",
"A",
">",
"associationClass",
")",
"{",
"Association",
"result",
"=",
"null",
";",
"for... | Returns association of this table with the target table. Will return null if there is no association.
@param targetModelClass association of this model and the target model.
@param associationClass class of association in requested.
@return association of this table with the target table. Will return null if there is ... | [
"Returns",
"association",
"of",
"this",
"table",
"with",
"the",
"target",
"table",
".",
"Will",
"return",
"null",
"if",
"there",
"is",
"no",
"association",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/MetaModel.java#L292-L300 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/SavedState.java | SavedState.getString | public String getString(String nameOfField, String defaultValue) {
String value = (String) stringData.get(nameOfField);
if (value == null) {
return defaultValue;
}
return value;
} | java | public String getString(String nameOfField, String defaultValue) {
String value = (String) stringData.get(nameOfField);
if (value == null) {
return defaultValue;
}
return value;
} | [
"public",
"String",
"getString",
"(",
"String",
"nameOfField",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"(",
"String",
")",
"stringData",
".",
"get",
"(",
"nameOfField",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"retur... | Get the String at the given location
@param nameOfField location of string
@param defaultValue The value to return if the specified value hasn't been set
@return String stored at the location given | [
"Get",
"the",
"String",
"at",
"the",
"given",
"location"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/SavedState.java#L110-L118 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/VMCommandLine.java | VMCommandLine.launchVM | @Inline(value = "VMCommandLine.launchVM(($1).getCanonicalName(), ($2))", imported = {VMCommandLine.class},
statementExpression = true)
public static Process launchVM(Class<?> classToLaunch, String... additionalParams) throws IOException {
return launchVM(classToLaunch.getCanonicalName(), additionalParams);
} | java | @Inline(value = "VMCommandLine.launchVM(($1).getCanonicalName(), ($2))", imported = {VMCommandLine.class},
statementExpression = true)
public static Process launchVM(Class<?> classToLaunch, String... additionalParams) throws IOException {
return launchVM(classToLaunch.getCanonicalName(), additionalParams);
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"VMCommandLine.launchVM(($1).getCanonicalName(), ($2))\"",
",",
"imported",
"=",
"{",
"VMCommandLine",
".",
"class",
"}",
",",
"statementExpression",
"=",
"true",
")",
"public",
"static",
"Process",
"launchVM",
"(",
"Class",
"<",
... | Run a new VM with the class path of the current VM.
@param classToLaunch is the class to launch.
@param additionalParams is the list of additional parameters
@return the process that is running the new virtual machine, neither <code>null</code>
@throws IOException when a IO error occurs. | [
"Run",
"a",
"new",
"VM",
"with",
"the",
"class",
"path",
"of",
"the",
"current",
"VM",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/VMCommandLine.java#L280-L284 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_ukRegistrars_GET | public ArrayList<OvhUkRegistrar> serviceName_ukRegistrars_GET(String serviceName) throws IOException {
String qPath = "/domain/{serviceName}/ukRegistrars";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | java | public ArrayList<OvhUkRegistrar> serviceName_ukRegistrars_GET(String serviceName) throws IOException {
String qPath = "/domain/{serviceName}/ukRegistrars";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | [
"public",
"ArrayList",
"<",
"OvhUkRegistrar",
">",
"serviceName_ukRegistrars_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/ukRegistrars\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Return the list of all .uk registrars
REST: GET /domain/{serviceName}/ukRegistrars
@param serviceName [required] The internal name of your domain | [
"Return",
"the",
"list",
"of",
"all",
".",
"uk",
"registrars"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1102-L1107 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.sendTransactionProposal | public Collection<ProposalResponse> sendTransactionProposal(TransactionProposalRequest transactionProposalRequest, Collection<Peer> peers) throws ProposalException, InvalidArgumentException {
return sendProposal(transactionProposalRequest, peers);
} | java | public Collection<ProposalResponse> sendTransactionProposal(TransactionProposalRequest transactionProposalRequest, Collection<Peer> peers) throws ProposalException, InvalidArgumentException {
return sendProposal(transactionProposalRequest, peers);
} | [
"public",
"Collection",
"<",
"ProposalResponse",
">",
"sendTransactionProposal",
"(",
"TransactionProposalRequest",
"transactionProposalRequest",
",",
"Collection",
"<",
"Peer",
">",
"peers",
")",
"throws",
"ProposalException",
",",
"InvalidArgumentException",
"{",
"return"... | Send a transaction proposal to specific peers.
@param transactionProposalRequest The transaction proposal to be sent to the peers.
@param peers
@return responses from peers.
@throws InvalidArgumentException
@throws ProposalException | [
"Send",
"a",
"transaction",
"proposal",
"to",
"specific",
"peers",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L4354-L4357 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/Expression.java | Expression.areAllCheap | public static boolean areAllCheap(Expression first, Expression... rest) {
return areAllCheap(ImmutableList.<Expression>builder().add(first).add(rest).build());
} | java | public static boolean areAllCheap(Expression first, Expression... rest) {
return areAllCheap(ImmutableList.<Expression>builder().add(first).add(rest).build());
} | [
"public",
"static",
"boolean",
"areAllCheap",
"(",
"Expression",
"first",
",",
"Expression",
"...",
"rest",
")",
"{",
"return",
"areAllCheap",
"(",
"ImmutableList",
".",
"<",
"Expression",
">",
"builder",
"(",
")",
".",
"add",
"(",
"first",
")",
".",
"add"... | Returns true if all referenced expressions are {@linkplain #isCheap() cheap}. | [
"Returns",
"true",
"if",
"all",
"referenced",
"expressions",
"are",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/Expression.java#L162-L164 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.fromByteArrayFst | public static <T> T fromByteArrayFst(byte[] data, Class<T> clazz) {
return fromByteArrayFst(data, clazz, null);
} | java | public static <T> T fromByteArrayFst(byte[] data, Class<T> clazz) {
return fromByteArrayFst(data, clazz, null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromByteArrayFst",
"(",
"byte",
"[",
"]",
"data",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"fromByteArrayFst",
"(",
"data",
",",
"clazz",
",",
"null",
")",
";",
"}"
] | Deserialize a byte array back to an object.
<p>
This method uses FST lib.
</p>
@param data
@param clazz
@return
@since 0.6.0 | [
"Deserialize",
"a",
"byte",
"array",
"back",
"to",
"an",
"object",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L851-L853 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.unlockAll | public void unlockAll(int requestNumber, boolean incrementUnlockCount)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unlockAll", new Object[]{requestNumber,incrementUnlockCount});
checkNotBrowserSession(); // F171893
if... | java | public void unlockAll(int requestNumber, boolean incrementUnlockCount)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unlockAll", new Object[]{requestNumber,incrementUnlockCount});
checkNotBrowserSession(); // F171893
if... | [
"public",
"void",
"unlockAll",
"(",
"int",
"requestNumber",
",",
"boolean",
"incrementUnlockCount",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"th... | Unlocks all messages locked by this consumer and has an Option to
increment the unlock count or not on unlock of messages. This call
is delegated to the sub consumer if one exists or the
<code>CATConsumer</code> version is used.
@param requestNumber The request number which replies should be sent to.
@param increment... | [
"Unlocks",
"all",
"messages",
"locked",
"by",
"this",
"consumer",
"and",
"has",
"an",
"Option",
"to",
"increment",
"the",
"unlock",
"count",
"or",
"not",
"on",
"unlock",
"of",
"messages",
".",
"This",
"call",
"is",
"delegated",
"to",
"the",
"sub",
"consume... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L1166-L1182 |
BellaDati/belladati-sdk-java | src/main/java/com/belladati/sdk/impl/BellaDatiServiceImpl.java | BellaDatiServiceImpl.readObject | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
try {
Field domainList = getClass().getDeclaredField("domainList");
domainList.setAccessible(true);
domainList.set(this, new DomainList());
Field dashboardList = getClass().getDeclaredFiel... | java | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
try {
Field domainList = getClass().getDeclaredField("domainList");
domainList.setAccessible(true);
domainList.set(this, new DomainList());
Field dashboardList = getClass().getDeclaredFiel... | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"try",
"{",
"Field",
"domainList",
"=",
"getClass",
"(",
")",
".",
"getDeclaredField... | Deserialization. Sets up the element lists and maps as empty objects.
@param in Input stream of object to be de-serialized
@throws IOException Thrown if IO error occurs during class reading
@throws ClassNotFoundException Thrown if desired class does not exist | [
"Deserialization",
".",
"Sets",
"up",
"the",
"element",
"lists",
"and",
"maps",
"as",
"empty",
"objects",
"."
] | train | https://github.com/BellaDati/belladati-sdk-java/blob/1a732a57ebc825ddf47ce405723cc958adb1a43f/src/main/java/com/belladati/sdk/impl/BellaDatiServiceImpl.java#L556-L603 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/util/graph/GraphRenderer.java | GraphRenderer.render | public void render(OutputStream target, Graph graph) throws IOException {
BufferedImage bi =
new BufferedImage(graph.width, graph.height,
GraphConfiguration.imageType);
Graphics2D g2d = bi.createGraphics();
graph.draw(g2d);
ImageIO.write(bi, "png", target);
} | java | public void render(OutputStream target, Graph graph) throws IOException {
BufferedImage bi =
new BufferedImage(graph.width, graph.height,
GraphConfiguration.imageType);
Graphics2D g2d = bi.createGraphics();
graph.draw(g2d);
ImageIO.write(bi, "png", target);
} | [
"public",
"void",
"render",
"(",
"OutputStream",
"target",
",",
"Graph",
"graph",
")",
"throws",
"IOException",
"{",
"BufferedImage",
"bi",
"=",
"new",
"BufferedImage",
"(",
"graph",
".",
"width",
",",
"graph",
".",
"height",
",",
"GraphConfiguration",
".",
... | Send a PNG format byte stream for the argument Graph to the provided
OutputStream
@param target OutputStream to write PNG format bytes
@param graph Graph to send to the target
@throws IOException for usual reasons. | [
"Send",
"a",
"PNG",
"format",
"byte",
"stream",
"for",
"the",
"argument",
"Graph",
"to",
"the",
"provided",
"OutputStream"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphRenderer.java#L87-L95 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.callService | public void callService(String url, String templateName, Object model, XmlHttpResponse result) {
callService(url, templateName, model, result, null);
} | java | public void callService(String url, String templateName, Object model, XmlHttpResponse result) {
callService(url, templateName, model, result, null);
} | [
"public",
"void",
"callService",
"(",
"String",
"url",
",",
"String",
"templateName",
",",
"Object",
"model",
",",
"XmlHttpResponse",
"result",
")",
"{",
"callService",
"(",
"url",
",",
"templateName",
",",
"model",
",",
"result",
",",
"null",
")",
";",
"}... | Performs POST to supplied url of result of applying template with model.
All namespaces registered in this environment will be registered with result.
@param url url to post to.
@param templateName name of template to use.
@param model model for template.
@param result result to populate with response. | [
"Performs",
"POST",
"to",
"supplied",
"url",
"of",
"result",
"of",
"applying",
"template",
"with",
"model",
".",
"All",
"namespaces",
"registered",
"in",
"this",
"environment",
"will",
"be",
"registered",
"with",
"result",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L234-L236 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/socialnet/googleplus/share/GooglePlusSharePanel.java | GooglePlusSharePanel.newWebMarkupContainer | protected WebMarkupContainer newWebMarkupContainer(final String id,
final IModel<GooglePlusShareModelBean> model)
{
final WebMarkupContainer googlePlusButton = ComponentFactory.newWebMarkupContainer(id,
model);
googlePlusButton.add(new AttributeModifier("class", model.getObject().getCssClass()));
googlePlus... | java | protected WebMarkupContainer newWebMarkupContainer(final String id,
final IModel<GooglePlusShareModelBean> model)
{
final WebMarkupContainer googlePlusButton = ComponentFactory.newWebMarkupContainer(id,
model);
googlePlusButton.add(new AttributeModifier("class", model.getObject().getCssClass()));
googlePlus... | [
"protected",
"WebMarkupContainer",
"newWebMarkupContainer",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"GooglePlusShareModelBean",
">",
"model",
")",
"{",
"final",
"WebMarkupContainer",
"googlePlusButton",
"=",
"ComponentFactory",
".",
"newWebMarkupContain... | Factory method for creating the new {@link WebMarkupContainer}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new {@link WebMarkupContainer}.
@param id
the id
@param model
the model
@return the new {@link WebMarkupContainer} | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"WebMarkupContainer",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"p... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/socialnet/googleplus/share/GooglePlusSharePanel.java#L102-L113 |
lukas-krecan/JsonUnit | json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java | JsonAssert.assertJsonPartEquals | public static void assertJsonPartEquals(Object expected, Object fullJson, String path, Configuration configuration) {
Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
diff.failIfDifferent();
} | java | public static void assertJsonPartEquals(Object expected, Object fullJson, String path, Configuration configuration) {
Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
diff.failIfDifferent();
} | [
"public",
"static",
"void",
"assertJsonPartEquals",
"(",
"Object",
"expected",
",",
"Object",
"fullJson",
",",
"String",
"path",
",",
"Configuration",
"configuration",
")",
"{",
"Diff",
"diff",
"=",
"create",
"(",
"expected",
",",
"fullJson",
",",
"FULL_JSON",
... | Compares part of the JSON. Path has this format "root.array[0].value". | [
"Compares",
"part",
"of",
"the",
"JSON",
".",
"Path",
"has",
"this",
"format",
"root",
".",
"array",
"[",
"0",
"]",
".",
"value",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java#L80-L83 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDValidatorBase.java | DTDValidatorBase.mayHaveNsDefaults | @Override
public boolean mayHaveNsDefaults(String elemPrefix, String elemLN)
{
mTmpKey.reset(elemPrefix, elemLN);
DTDElement elem = mElemSpecs.get(mTmpKey);
mCurrElem = elem;
return (elem != null) && elem.hasNsDefaults();
} | java | @Override
public boolean mayHaveNsDefaults(String elemPrefix, String elemLN)
{
mTmpKey.reset(elemPrefix, elemLN);
DTDElement elem = mElemSpecs.get(mTmpKey);
mCurrElem = elem;
return (elem != null) && elem.hasNsDefaults();
} | [
"@",
"Override",
"public",
"boolean",
"mayHaveNsDefaults",
"(",
"String",
"elemPrefix",
",",
"String",
"elemLN",
")",
"{",
"mTmpKey",
".",
"reset",
"(",
"elemPrefix",
",",
"elemLN",
")",
";",
"DTDElement",
"elem",
"=",
"mElemSpecs",
".",
"get",
"(",
"mTmpKey... | Calling this method before {@link #checkNsDefaults} is necessary
to pass information regarding the current element; although
it will become available later on (via normal XMLValidator interface),
that's too late (after namespace binding and resolving). | [
"Calling",
"this",
"method",
"before",
"{"
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDValidatorBase.java#L381-L388 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Image.java | Image.getInstance | public static Image getInstance(int width, int height, byte[] data, byte[] globals) {
Image img = new ImgJBIG2(width, height, data, globals);
return img;
} | java | public static Image getInstance(int width, int height, byte[] data, byte[] globals) {
Image img = new ImgJBIG2(width, height, data, globals);
return img;
} | [
"public",
"static",
"Image",
"getInstance",
"(",
"int",
"width",
",",
"int",
"height",
",",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"globals",
")",
"{",
"Image",
"img",
"=",
"new",
"ImgJBIG2",
"(",
"width",
",",
"height",
",",
"data",
",",
... | Creates a JBIG2 Image.
@param width the width of the image
@param height the height of the image
@param data the raw image data
@param globals JBIG2 globals
@since 2.1.5 | [
"Creates",
"a",
"JBIG2",
"Image",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Image.java#L477-L480 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.createScreenComponent | public static ScreenComponent createScreenComponent(String componentType, ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String,Object> properties)
{
String screenFieldClass = null;
if (!componentType.contains("."))
screenFieldClass = S... | java | public static ScreenComponent createScreenComponent(String componentType, ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String,Object> properties)
{
String screenFieldClass = null;
if (!componentType.contains("."))
screenFieldClass = S... | [
"public",
"static",
"ScreenComponent",
"createScreenComponent",
"(",
"String",
"componentType",
",",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Obje... | Create a screen component of this type.
@param componentType
@param itsLocation
@param targetScreen
@param convert
@param iDisplayFieldDesc
@param properties
@return | [
"Create",
"a",
"screen",
"component",
"of",
"this",
"type",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1412-L1429 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.serviceName_pca_pcaServiceName_sessions_sessionId_files_fileId_GET | public OvhFile serviceName_pca_pcaServiceName_sessions_sessionId_files_fileId_GET(String serviceName, String pcaServiceName, String sessionId, String fileId) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files/{fileId}";
StringBuilder sb = path(qPath, serviceNam... | java | public OvhFile serviceName_pca_pcaServiceName_sessions_sessionId_files_fileId_GET(String serviceName, String pcaServiceName, String sessionId, String fileId) throws IOException {
String qPath = "/cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files/{fileId}";
StringBuilder sb = path(qPath, serviceNam... | [
"public",
"OvhFile",
"serviceName_pca_pcaServiceName_sessions_sessionId_files_fileId_GET",
"(",
"String",
"serviceName",
",",
"String",
"pcaServiceName",
",",
"String",
"sessionId",
",",
"String",
"fileId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cl... | Get this object properties
REST: GET /cloud/{serviceName}/pca/{pcaServiceName}/sessions/{sessionId}/files/{fileId}
@param serviceName [required] The internal name of your public cloud passport
@param pcaServiceName [required] The internal name of your PCA offer
@param sessionId [required] Session ID
@param fileId [req... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2515-L2520 |
davidcarboni-archive/httpino | src/main/java/com/github/davidcarboni/httpino/Endpoint.java | Endpoint.setParameter | public Endpoint setParameter(String name, Object value) {
Endpoint configured = new Endpoint(this);
if (StringUtils.isNotBlank(name) && value != null) {
configured.parameters.put(name, value.toString());
}
return configured;
} | java | public Endpoint setParameter(String name, Object value) {
Endpoint configured = new Endpoint(this);
if (StringUtils.isNotBlank(name) && value != null) {
configured.parameters.put(name, value.toString());
}
return configured;
} | [
"public",
"Endpoint",
"setParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"Endpoint",
"configured",
"=",
"new",
"Endpoint",
"(",
"this",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"name",
")",
"&&",
"value",
"!=",
"n... | Creates a new {@link Endpoint} instance with an additional GET parameter.
Typical usage is to add a request-specific parameter to an endpoint, which is why this method returns a new instance, rather than modifying the existing one.
This allows you add different parameters/values at different times without affecting th... | [
"Creates",
"a",
"new",
"{",
"@link",
"Endpoint",
"}",
"instance",
"with",
"an",
"additional",
"GET",
"parameter",
"."
] | train | https://github.com/davidcarboni-archive/httpino/blob/a78c91874e6d9b2e452cf3aa68d4fea804d977ca/src/main/java/com/github/davidcarboni/httpino/Endpoint.java#L74-L80 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_binding.java | vpnsessionpolicy_binding.get | public static vpnsessionpolicy_binding get(nitro_service service, String name) throws Exception{
vpnsessionpolicy_binding obj = new vpnsessionpolicy_binding();
obj.set_name(name);
vpnsessionpolicy_binding response = (vpnsessionpolicy_binding) obj.get_resource(service);
return response;
} | java | public static vpnsessionpolicy_binding get(nitro_service service, String name) throws Exception{
vpnsessionpolicy_binding obj = new vpnsessionpolicy_binding();
obj.set_name(name);
vpnsessionpolicy_binding response = (vpnsessionpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"vpnsessionpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"vpnsessionpolicy_binding",
"obj",
"=",
"new",
"vpnsessionpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"... | Use this API to fetch vpnsessionpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnsessionpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnsessionpolicy_binding.java#L136-L141 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.generateSchema | private static void generateSchema(SQLiteDatabaseSchema schema) throws FileNotFoundException, IOException {
// when we run in JUNIT of Kripton, we don't have to generate schemas
// if (BindDataSourceSubProcessor.JUNIT_TEST_MODE)
// return;
if (!schema.generateSchema)
return;
// and now, write schema.creat... | java | private static void generateSchema(SQLiteDatabaseSchema schema) throws FileNotFoundException, IOException {
// when we run in JUNIT of Kripton, we don't have to generate schemas
// if (BindDataSourceSubProcessor.JUNIT_TEST_MODE)
// return;
if (!schema.generateSchema)
return;
// and now, write schema.creat... | [
"private",
"static",
"void",
"generateSchema",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"// when we run in JUNIT of Kripton, we don't have to generate schemas",
"// if (BindDataSourceSubProcessor.JUNIT_TEST_MODE)",
"// retu... | Generate schema.
@param schema
the schema
@throws FileNotFoundException
the file not found exception
@throws IOException
Signals that an I/O exception has occurred. | [
"Generate",
"schema",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L159-L197 |
hellojavaer/ddal | ddal-sequence/src/main/java/org/hellojavaer/ddal/sequence/HttpSequenceRangeGetter.java | HttpSequenceRangeGetter.get | @Override
public SequenceRange get(String schemaName, String tableName, int step) throws Exception {
Map<String, String> param = new HashMap<>();
param.put("clientId", clientId);
param.put("accessToken", accessToken);
param.put("schemaName", schemaName);
param.put("tableName"... | java | @Override
public SequenceRange get(String schemaName, String tableName, int step) throws Exception {
Map<String, String> param = new HashMap<>();
param.put("clientId", clientId);
param.put("accessToken", accessToken);
param.put("schemaName", schemaName);
param.put("tableName"... | [
"@",
"Override",
"public",
"SequenceRange",
"get",
"(",
"String",
"schemaName",
",",
"String",
"tableName",
",",
"int",
"step",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"param",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";"... | param: clientId= &accessToken= &schemaName= &tableName= &step=
return: beginValue= &endValue= &errorCode= &errorMessage= | [
"param",
":",
"clientId",
"=",
"&accessToken",
"=",
"&schemaName",
"=",
"&tableName",
"=",
"&step",
"=",
"return",
":",
"beginValue",
"=",
"&endValue",
"=",
"&errorCode",
"=",
"&errorMessage",
"="
] | train | https://github.com/hellojavaer/ddal/blob/876dc32ece8bb983df64e94bdcc9045f0ee5cc3b/ddal-sequence/src/main/java/org/hellojavaer/ddal/sequence/HttpSequenceRangeGetter.java#L52-L79 |
jbundle/jbundle | main/msg/src/main/java/org/jbundle/main/msg/db/MessageTransport.java | MessageTransport.createMessageTransport | public Object createMessageTransport(String messageTransportType, Task task)
{
MessageTransport messageTransport = this.getMessageTransport(messageTransportType);
String className = null;
if (messageTransport != null)
className = ((PropertiesField)messageTransport.getField(Messag... | java | public Object createMessageTransport(String messageTransportType, Task task)
{
MessageTransport messageTransport = this.getMessageTransport(messageTransportType);
String className = null;
if (messageTransport != null)
className = ((PropertiesField)messageTransport.getField(Messag... | [
"public",
"Object",
"createMessageTransport",
"(",
"String",
"messageTransportType",
",",
"Task",
"task",
")",
"{",
"MessageTransport",
"messageTransport",
"=",
"this",
".",
"getMessageTransport",
"(",
"messageTransportType",
")",
";",
"String",
"className",
"=",
"nul... | Get the message transport for this type
@param messageTransportType
@returns The concrete BaseMessageTransport implementation. | [
"Get",
"the",
"message",
"transport",
"for",
"this",
"type"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/msg/src/main/java/org/jbundle/main/msg/db/MessageTransport.java#L221-L237 |
gallandarakhneorg/afc | advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java | XMLGISElementUtil.readMapElement | public static MapElement readMapElement(Element element, String elementNodeName,
PathBuilder pathBuilder, XMLResources resources) throws IOException {
return readMapElement(element, elementNodeName, null, pathBuilder, resources);
} | java | public static MapElement readMapElement(Element element, String elementNodeName,
PathBuilder pathBuilder, XMLResources resources) throws IOException {
return readMapElement(element, elementNodeName, null, pathBuilder, resources);
} | [
"public",
"static",
"MapElement",
"readMapElement",
"(",
"Element",
"element",
",",
"String",
"elementNodeName",
",",
"PathBuilder",
"pathBuilder",
",",
"XMLResources",
"resources",
")",
"throws",
"IOException",
"{",
"return",
"readMapElement",
"(",
"element",
",",
... | Read a map element from the XML description.
@param element is the XML node to read.
@param elementNodeName is the name of the XML node that should contains the map element data.
It must be one of {@link #NODE_POINT}, {@link #NODE_CIRCLE}, {@link #NODE_POLYGON}, {@link #NODE_POLYLINE},
{@link #NODE_MULTIPOINT}, or {@c... | [
"Read",
"a",
"map",
"element",
"from",
"the",
"XML",
"description",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java#L239-L242 |
openbase/jul | schedule/src/main/java/org/openbase/jul/schedule/Timeout.java | Timeout.internal_start | private void internal_start(final long waitTime) throws RejectedExecutionException, CouldNotPerformException {
synchronized (lock) {
if (isActive()) {
logger.debug("Reject start, not interrupted or expired.");
return;
}
expired = false;
... | java | private void internal_start(final long waitTime) throws RejectedExecutionException, CouldNotPerformException {
synchronized (lock) {
if (isActive()) {
logger.debug("Reject start, not interrupted or expired.");
return;
}
expired = false;
... | [
"private",
"void",
"internal_start",
"(",
"final",
"long",
"waitTime",
")",
"throws",
"RejectedExecutionException",
",",
"CouldNotPerformException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"isActive",
"(",
")",
")",
"{",
"logger",
".",
"debug",
... | Internal synchronized start method.
@param waitTime The time to wait until the timeout is reached.
@throws RejectedExecutionException is thrown if the timeout task could not be scheduled.
@throws CouldNotPerformException is thrown in case the timeout could not be started. | [
"Internal",
"synchronized",
"start",
"method",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/schedule/src/main/java/org/openbase/jul/schedule/Timeout.java#L167-L198 |
JOML-CI/JOML | src/org/joml/Quaternionf.java | Quaternionf.rotationAxis | public Quaternionf rotationAxis(float angle, Vector3fc axis) {
return rotationAxis(angle, axis.x(), axis.y(), axis.z());
} | java | public Quaternionf rotationAxis(float angle, Vector3fc axis) {
return rotationAxis(angle, axis.x(), axis.y(), axis.z());
} | [
"public",
"Quaternionf",
"rotationAxis",
"(",
"float",
"angle",
",",
"Vector3fc",
"axis",
")",
"{",
"return",
"rotationAxis",
"(",
"angle",
",",
"axis",
".",
"x",
"(",
")",
",",
"axis",
".",
"y",
"(",
")",
",",
"axis",
".",
"z",
"(",
")",
")",
";",... | Set this quaternion to a rotation of the given angle in radians about the supplied axis.
@see #rotationAxis(float, float, float, float)
@param angle
the rotation angle in radians
@param axis
the axis to rotate about
@return this | [
"Set",
"this",
"quaternion",
"to",
"a",
"rotation",
"of",
"the",
"given",
"angle",
"in",
"radians",
"about",
"the",
"supplied",
"axis",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaternionf.java#L552-L554 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/TokenList.java | TokenList.extractSubList | public TokenList extractSubList( Token begin , Token end ) {
if( begin == end ) {
remove(begin);
return new TokenList(begin,begin);
} else {
if( first == begin ) {
first = end.next;
}
if( last == end ) {
last = b... | java | public TokenList extractSubList( Token begin , Token end ) {
if( begin == end ) {
remove(begin);
return new TokenList(begin,begin);
} else {
if( first == begin ) {
first = end.next;
}
if( last == end ) {
last = b... | [
"public",
"TokenList",
"extractSubList",
"(",
"Token",
"begin",
",",
"Token",
"end",
")",
"{",
"if",
"(",
"begin",
"==",
"end",
")",
"{",
"remove",
"(",
"begin",
")",
";",
"return",
"new",
"TokenList",
"(",
"begin",
",",
"begin",
")",
";",
"}",
"else... | Removes elements from begin to end from the list, inclusive. Returns a new list which
is composed of the removed elements | [
"Removes",
"elements",
"from",
"begin",
"to",
"end",
"from",
"the",
"list",
"inclusive",
".",
"Returns",
"a",
"new",
"list",
"which",
"is",
"composed",
"of",
"the",
"removed",
"elements"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/TokenList.java#L188-L212 |
apache/incubator-gobblin | gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java | GPGFileDecryptor.decryptFile | public InputStream decryptFile(InputStream inputStream, String passPhrase) throws IOException {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
PGPPBEEncryptedData pbe = (PGPPBEEncryptedData) enc.get(0);
InputStream clear;
try {
clear = pbe.getDataStream(new JcePBEDataDecryptorF... | java | public InputStream decryptFile(InputStream inputStream, String passPhrase) throws IOException {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
PGPPBEEncryptedData pbe = (PGPPBEEncryptedData) enc.get(0);
InputStream clear;
try {
clear = pbe.getDataStream(new JcePBEDataDecryptorF... | [
"public",
"InputStream",
"decryptFile",
"(",
"InputStream",
"inputStream",
",",
"String",
"passPhrase",
")",
"throws",
"IOException",
"{",
"PGPEncryptedDataList",
"enc",
"=",
"getPGPEncryptedDataList",
"(",
"inputStream",
")",
";",
"PGPPBEEncryptedData",
"pbe",
"=",
"... | Taking in a file inputstream and a passPhrase, generate a decrypted file inputstream.
@param inputStream file inputstream
@param passPhrase passPhrase
@return
@throws IOException | [
"Taking",
"in",
"a",
"file",
"inputstream",
"and",
"a",
"passPhrase",
"generate",
"a",
"decrypted",
"file",
"inputstream",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java#L62-L79 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java | DBTransaction.deleteColumns | public void deleteColumns(String storeName, String rowKey, Collection<String> columnNames) {
for(String columnName: columnNames) {
deleteColumn(storeName, rowKey, columnName);
}
} | java | public void deleteColumns(String storeName, String rowKey, Collection<String> columnNames) {
for(String columnName: columnNames) {
deleteColumn(storeName, rowKey, columnName);
}
} | [
"public",
"void",
"deleteColumns",
"(",
"String",
"storeName",
",",
"String",
"rowKey",
",",
"Collection",
"<",
"String",
">",
"columnNames",
")",
"{",
"for",
"(",
"String",
"columnName",
":",
"columnNames",
")",
"{",
"deleteColumn",
"(",
"storeName",
",",
"... | Add updates that will delete all given columns names for the given store name and
row key. If a column update exists for the same store/row/column, the results are
undefined when the transaction is committed.
@param storeName Name of store that owns row.
@param rowKey Row key in string form.
@param columnNames Col... | [
"Add",
"updates",
"that",
"will",
"delete",
"all",
"given",
"columns",
"names",
"for",
"the",
"given",
"store",
"name",
"and",
"row",
"key",
".",
"If",
"a",
"column",
"update",
"exists",
"for",
"the",
"same",
"store",
"/",
"row",
"/",
"column",
"the",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java#L256-L260 |
wiibaker/robotframework-rest-java | src/main/java/org/wuokko/robot/restlib/JsonPathLibrary.java | JsonPathLibrary.jsonShouldBeEqual | @RobotKeyword
public boolean jsonShouldBeEqual(String from, String to, boolean useExactMatch, String method, String data, String contentType) throws Exception {
System.out.println("*DEBUG* Comparing JSON sources");
boolean equal = false;
String fromJson = requestUtil.readSource(from, metho... | java | @RobotKeyword
public boolean jsonShouldBeEqual(String from, String to, boolean useExactMatch, String method, String data, String contentType) throws Exception {
System.out.println("*DEBUG* Comparing JSON sources");
boolean equal = false;
String fromJson = requestUtil.readSource(from, metho... | [
"@",
"RobotKeyword",
"public",
"boolean",
"jsonShouldBeEqual",
"(",
"String",
"from",
",",
"String",
"to",
",",
"boolean",
"useExactMatch",
",",
"String",
"method",
",",
"String",
"data",
",",
"String",
"contentType",
")",
"throws",
"Exception",
"{",
"System",
... | Checks if the given JSON contents are equal. The third parameter
specifies whether exact string match should be used or diffing by the
JSON objects ie. the order of the attributes does not matter.
`from` and `to` can be either URI or the actual JSON content.
You can add optional method (ie GET, POST, PUT), data or co... | [
"Checks",
"if",
"the",
"given",
"JSON",
"contents",
"are",
"equal",
".",
"The",
"third",
"parameter",
"specifies",
"whether",
"exact",
"string",
"match",
"should",
"be",
"used",
"or",
"diffing",
"by",
"the",
"JSON",
"objects",
"ie",
".",
"the",
"order",
"o... | train | https://github.com/wiibaker/robotframework-rest-java/blob/e30a7e494c143b644ee4282137a5a38e75d9d97b/src/main/java/org/wuokko/robot/restlib/JsonPathLibrary.java#L181-L212 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.getFileFromTask | public void getFileFromTask(String jobId, String taskId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors, OutputStream outputStream) throws BatchErrorException, IOException {
FileGetFromTaskOptions options = new FileGetFromTaskOptions();
BehaviorManager bhMgr = new BehaviorManager(thi... | java | public void getFileFromTask(String jobId, String taskId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors, OutputStream outputStream) throws BatchErrorException, IOException {
FileGetFromTaskOptions options = new FileGetFromTaskOptions();
BehaviorManager bhMgr = new BehaviorManager(thi... | [
"public",
"void",
"getFileFromTask",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"String",
"fileName",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
",",
"OutputStream",
"outputStream",
")",
"throws",
"BatchErrorException",
",",
... | Downloads the specified file from the specified task's directory on its compute node.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task.
@param fileName The name of the file to download.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied... | [
"Downloads",
"the",
"specified",
"file",
"from",
"the",
"specified",
"task",
"s",
"directory",
"on",
"its",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L279-L285 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.putIfAbsent | public final V putIfAbsent(K key, LazyFactory<V> factory) {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equals(key)) {
// found match
r... | java | public final V putIfAbsent(K key, LazyFactory<V> factory) {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equals(key)) {
// found match
r... | [
"public",
"final",
"V",
"putIfAbsent",
"(",
"K",
"key",
",",
"LazyFactory",
"<",
"V",
">",
"factory",
")",
"{",
"final",
"int",
"hash",
"=",
"hash",
"(",
"key",
")",
";",
"final",
"int",
"slot",
"=",
"indexOf",
"(",
"hash",
")",
";",
"// search the c... | Inserts a value for the given key, if no value is yet contained for that key. Otherwise,
returns the value currently contained for the key.
<p>The value that is inserted in case that the key is not contained, yet, is lazily created
using the given factory.
@param key The key to insert.
@param factory The factory that... | [
"Inserts",
"a",
"value",
"for",
"the",
"given",
"key",
"if",
"no",
"value",
"is",
"yet",
"contained",
"for",
"that",
"key",
".",
"Otherwise",
"returns",
"the",
"value",
"currently",
"contained",
"for",
"the",
"key",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L157-L175 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/rest/auth/TokenRESTService.java | TokenRESTService.createToken | @POST
public APIAuthenticationResult createToken(@FormParam("username") String username,
@FormParam("password") String password,
@FormParam("token") String token,
@Context HttpServletRequest consumedRequest,
MultivaluedMap<String, String> parameters)
throw... | java | @POST
public APIAuthenticationResult createToken(@FormParam("username") String username,
@FormParam("password") String password,
@FormParam("token") String token,
@Context HttpServletRequest consumedRequest,
MultivaluedMap<String, String> parameters)
throw... | [
"@",
"POST",
"public",
"APIAuthenticationResult",
"createToken",
"(",
"@",
"FormParam",
"(",
"\"username\"",
")",
"String",
"username",
",",
"@",
"FormParam",
"(",
"\"password\"",
")",
"String",
"password",
",",
"@",
"FormParam",
"(",
"\"token\"",
")",
"String",... | Authenticates a user, generates an auth token, associates that auth token
with the user's UserContext for use by further requests. If an existing
token is provided, the authentication procedure will attempt to update
or reuse the provided token.
@param username
The username of the user who is to be authenticated.
@pa... | [
"Authenticates",
"a",
"user",
"generates",
"an",
"auth",
"token",
"associates",
"that",
"auth",
"token",
"with",
"the",
"user",
"s",
"UserContext",
"for",
"use",
"by",
"further",
"requests",
".",
"If",
"an",
"existing",
"token",
"is",
"provided",
"the",
"aut... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/rest/auth/TokenRESTService.java#L159-L196 |
orhanobut/hawk | hawk/src/main/java/com/orhanobut/hawk/Hawk.java | Hawk.put | public static <T> boolean put(String key, T value) {
return hawkFacade.put(key, value);
} | java | public static <T> boolean put(String key, T value) {
return hawkFacade.put(key, value);
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"put",
"(",
"String",
"key",
",",
"T",
"value",
")",
"{",
"return",
"hawkFacade",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Saves any type including any collection, primitive values or custom objects
@param key is required to differentiate the given data
@param value is the data that is going to be encrypted and persisted
@return true if the operation is successful. Any failure in any step will return false | [
"Saves",
"any",
"type",
"including",
"any",
"collection",
"primitive",
"values",
"or",
"custom",
"objects"
] | train | https://github.com/orhanobut/hawk/blob/0d22dde128b1ab5f50ac20d802db79cf402aa150/hawk/src/main/java/com/orhanobut/hawk/Hawk.java#L39-L41 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.withStream | public static <T, U extends InputStream> T withStream(U stream, @ClosureParams(value=FirstParam.class) Closure<T> closure) throws IOException {
try {
T result = closure.call(stream);
InputStream temp = stream;
stream = null;
temp.close();
return resu... | java | public static <T, U extends InputStream> T withStream(U stream, @ClosureParams(value=FirstParam.class) Closure<T> closure) throws IOException {
try {
T result = closure.call(stream);
InputStream temp = stream;
stream = null;
temp.close();
return resu... | [
"public",
"static",
"<",
"T",
",",
"U",
"extends",
"InputStream",
">",
"T",
"withStream",
"(",
"U",
"stream",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FirstParam",
".",
"class",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
"throws",
"IOException"... | Allows this input stream to be used within the closure, ensuring that it
is flushed and closed before this method returns.
@param stream the stream which is used and then closed
@param closure the closure that the stream is passed into
@return the value returned by the closure
@throws IOException if an IOException oc... | [
"Allows",
"this",
"input",
"stream",
"to",
"be",
"used",
"within",
"the",
"closure",
"ensuring",
"that",
"it",
"is",
"flushed",
"and",
"closed",
"before",
"this",
"method",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1183-L1195 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.findClosestPointOnLineSegment | public static Vector3f findClosestPointOnLineSegment(float aX, float aY, float aZ, float bX, float bY, float bZ, float pX, float pY, float pZ, Vector3f result) {
float abX = bX - aX, abY = bY - aY, abZ = bZ - aZ;
float t = ((pX - aX) * abX + (pY - aY) * abY + (pZ - aZ) * abZ) / (abX * abX + abY * abY + ... | java | public static Vector3f findClosestPointOnLineSegment(float aX, float aY, float aZ, float bX, float bY, float bZ, float pX, float pY, float pZ, Vector3f result) {
float abX = bX - aX, abY = bY - aY, abZ = bZ - aZ;
float t = ((pX - aX) * abX + (pY - aY) * abY + (pZ - aZ) * abZ) / (abX * abX + abY * abY + ... | [
"public",
"static",
"Vector3f",
"findClosestPointOnLineSegment",
"(",
"float",
"aX",
",",
"float",
"aY",
",",
"float",
"aZ",
",",
"float",
"bX",
",",
"float",
"bY",
",",
"float",
"bZ",
",",
"float",
"pX",
",",
"float",
"pY",
",",
"float",
"pZ",
",",
"V... | Find the point on the given line segment which is closest to the specified point <code>(pX, pY, pZ)</code>, and store the result in <code>result</code>.
@param aX
the x coordinate of the first end point of the line segment
@param aY
the y coordinate of the first end point of the line segment
@param aZ
the z coordinate... | [
"Find",
"the",
"point",
"on",
"the",
"given",
"line",
"segment",
"which",
"is",
"closest",
"to",
"the",
"specified",
"point",
"<code",
">",
"(",
"pX",
"pY",
"pZ",
")",
"<",
"/",
"code",
">",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"resul... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L1307-L1316 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexResponse.java | CmsFlexResponse.addIntHeader | @Override
public void addIntHeader(String name, int value) {
addHeader(name, String.valueOf(value));
} | java | @Override
public void addIntHeader(String name, int value) {
addHeader(name, String.valueOf(value));
} | [
"@",
"Override",
"public",
"void",
"addIntHeader",
"(",
"String",
"name",
",",
"int",
"value",
")",
"{",
"addHeader",
"(",
"name",
",",
"String",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"}"
] | Method overload from the standard HttpServletRequest API.<p>
@see javax.servlet.http.HttpServletResponse#addIntHeader(java.lang.String, int) | [
"Method",
"overload",
"from",
"the",
"standard",
"HttpServletRequest",
"API",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexResponse.java#L482-L486 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/server/HttpRequestUtils.java | HttpRequestUtils.getIntParam | public static int getIntParam(final HttpServletRequest request, final String name)
throws ServletException {
final String p = getParam(request, name);
return Integer.parseInt(p);
} | java | public static int getIntParam(final HttpServletRequest request, final String name)
throws ServletException {
final String p = getParam(request, name);
return Integer.parseInt(p);
} | [
"public",
"static",
"int",
"getIntParam",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"String",
"name",
")",
"throws",
"ServletException",
"{",
"final",
"String",
"p",
"=",
"getParam",
"(",
"request",
",",
"name",
")",
";",
"return",
"Integer"... | Returns the param and parses it into an int. Will throw an exception if not found, or a parse
error if the type is incorrect. | [
"Returns",
"the",
"param",
"and",
"parses",
"it",
"into",
"an",
"int",
".",
"Will",
"throw",
"an",
"exception",
"if",
"not",
"found",
"or",
"a",
"parse",
"error",
"if",
"the",
"type",
"is",
"incorrect",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/server/HttpRequestUtils.java#L213-L217 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.transposeMultiply | public Vec transposeMultiply(double c, Vec b)
{
DenseVector toReturns = new DenseVector(this.cols());
this.transposeMultiply(c, b, toReturns);
return toReturns;
} | java | public Vec transposeMultiply(double c, Vec b)
{
DenseVector toReturns = new DenseVector(this.cols());
this.transposeMultiply(c, b, toReturns);
return toReturns;
} | [
"public",
"Vec",
"transposeMultiply",
"(",
"double",
"c",
",",
"Vec",
"b",
")",
"{",
"DenseVector",
"toReturns",
"=",
"new",
"DenseVector",
"(",
"this",
".",
"cols",
"(",
")",
")",
";",
"this",
".",
"transposeMultiply",
"(",
"c",
",",
"b",
",",
"toRetu... | Creates a new vector equal to <i><b>x</b> = A'*<b>b</b>*c</i>
@param c the scalar constant to multiply by
@param b the vector to multiply by
@return the new vector equal to <i>A'*b*c</i> | [
"Creates",
"a",
"new",
"vector",
"equal",
"to",
"<i",
">",
"<b",
">",
"x<",
"/",
"b",
">",
"=",
"A",
"*",
"<b",
">",
"b<",
"/",
"b",
">",
"*",
"c<",
"/",
"i",
">"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L519-L524 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/UBench.java | UBench.addTask | public <T> UBench addTask(String name, Supplier<T> task, Predicate<T> check) {
return putTask(name, () -> {
long start = System.nanoTime();
T result = task.get();
long time = System.nanoTime() - start;
if (check != null && !check.test(result)) {
th... | java | public <T> UBench addTask(String name, Supplier<T> task, Predicate<T> check) {
return putTask(name, () -> {
long start = System.nanoTime();
T result = task.get();
long time = System.nanoTime() - start;
if (check != null && !check.test(result)) {
th... | [
"public",
"<",
"T",
">",
"UBench",
"addTask",
"(",
"String",
"name",
",",
"Supplier",
"<",
"T",
">",
"task",
",",
"Predicate",
"<",
"T",
">",
"check",
")",
"{",
"return",
"putTask",
"(",
"name",
",",
"(",
")",
"->",
"{",
"long",
"start",
"=",
"Sy... | Include a named task (and validator) in to the benchmark.
@param <T>
The type of the task return value (which is the input to be
tested in the validator)
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@param check
The check of the results from the task.
@r... | [
"Include",
"a",
"named",
"task",
"(",
"and",
"validator",
")",
"in",
"to",
"the",
"benchmark",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UBench.java#L128-L138 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/TypedCollections.java | TypedCollections.dynamicallyCastCollection | @SuppressWarnings("unchecked")
static <E,TypedC extends Collection<E>> TypedC dynamicallyCastCollection(Collection<?> c,
Class<E> type,
... | java | @SuppressWarnings("unchecked")
static <E,TypedC extends Collection<E>> TypedC dynamicallyCastCollection(Collection<?> c,
Class<E> type,
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"E",
",",
"TypedC",
"extends",
"Collection",
"<",
"E",
">",
">",
"TypedC",
"dynamicallyCastCollection",
"(",
"Collection",
"<",
"?",
">",
"c",
",",
"Class",
"<",
"E",
">",
"type",
",",
"C... | Dynamically check that the members of the collection are all
instances of the given type (or null), and that the collection
itself is of the given collection type.
@param <E>
the collection's element type
@param c
the collection to cast
@param type
the class of the collection's element type.
@return the dynamically-ty... | [
"Dynamically",
"check",
"that",
"the",
"members",
"of",
"the",
"collection",
"are",
"all",
"instances",
"of",
"the",
"given",
"type",
"(",
"or",
"null",
")",
"and",
"that",
"the",
"collection",
"itself",
"is",
"of",
"the",
"given",
"collection",
"type",
".... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/TypedCollections.java#L77-L89 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.postSubscriptionUsage | public Usage postSubscriptionUsage(final String subscriptionCode, final String addOnCode, final Usage usage) {
return doPOST(Subscription.SUBSCRIPTION_RESOURCE +
"/" +
subscriptionCode +
AddOn.ADDONS_RESOURCE +
"/" +... | java | public Usage postSubscriptionUsage(final String subscriptionCode, final String addOnCode, final Usage usage) {
return doPOST(Subscription.SUBSCRIPTION_RESOURCE +
"/" +
subscriptionCode +
AddOn.ADDONS_RESOURCE +
"/" +... | [
"public",
"Usage",
"postSubscriptionUsage",
"(",
"final",
"String",
"subscriptionCode",
",",
"final",
"String",
"addOnCode",
",",
"final",
"Usage",
"usage",
")",
"{",
"return",
"doPOST",
"(",
"Subscription",
".",
"SUBSCRIPTION_RESOURCE",
"+",
"\"/\"",
"+",
"subscr... | Post usage to subscription
<p>
@param subscriptionCode The recurly id of the {@link Subscription }
@param addOnCode recurly id of {@link AddOn}
@param usage the usage to post on recurly
@return the {@link Usage} object as identified by the passed in object | [
"Post",
"usage",
"to",
"subscription",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L709-L718 |
greatman/craftconomy3 | src/main/java/com/greatmancode/craftconomy3/account/AccountManager.java | AccountManager.getAccount | public Account getAccount(String name, boolean bankAccount) {
String newName = name;
if (!Common.getInstance().getMainConfig().getBoolean("System.Case-sentitive")) {
newName = name.toLowerCase();
}
Account account;
if (bankAccount && bankList.containsKey(newName)) {
... | java | public Account getAccount(String name, boolean bankAccount) {
String newName = name;
if (!Common.getInstance().getMainConfig().getBoolean("System.Case-sentitive")) {
newName = name.toLowerCase();
}
Account account;
if (bankAccount && bankList.containsKey(newName)) {
... | [
"public",
"Account",
"getAccount",
"(",
"String",
"name",
",",
"boolean",
"bankAccount",
")",
"{",
"String",
"newName",
"=",
"name",
";",
"if",
"(",
"!",
"Common",
".",
"getInstance",
"(",
")",
".",
"getMainConfig",
"(",
")",
".",
"getBoolean",
"(",
"\"S... | Retrieve a account. Accounts prefixed with bank: are bank accounts.
@param name The name of the account to retrieve
@param bankAccount If the account is a bank account
@return A economy account | [
"Retrieve",
"a",
"account",
".",
"Accounts",
"prefixed",
"with",
"bank",
":",
"are",
"bank",
"accounts",
"."
] | train | https://github.com/greatman/craftconomy3/blob/51b1b3de7d039e20c7418d1e70b8c4b02b8cf840/src/main/java/com/greatmancode/craftconomy3/account/AccountManager.java#L43-L62 |
negusoft/holoaccent | HoloAccent/src/com/negusoft/holoaccent/widget/AccentSwitch.java | AccentSwitch.setSwitchTextAppearance | public void setSwitchTextAppearance(Context context, int resid) {
TypedArray appearance = context.obtainStyledAttributes(resid,
R.styleable.TextAppearanceAccentSwitch);
ColorStateList colors;
int ts;
colors = appearance
.getColorStateList(R.styleable.TextAppearanceAccentSwitch_android_textColor);
if... | java | public void setSwitchTextAppearance(Context context, int resid) {
TypedArray appearance = context.obtainStyledAttributes(resid,
R.styleable.TextAppearanceAccentSwitch);
ColorStateList colors;
int ts;
colors = appearance
.getColorStateList(R.styleable.TextAppearanceAccentSwitch_android_textColor);
if... | [
"public",
"void",
"setSwitchTextAppearance",
"(",
"Context",
"context",
",",
"int",
"resid",
")",
"{",
"TypedArray",
"appearance",
"=",
"context",
".",
"obtainStyledAttributes",
"(",
"resid",
",",
"R",
".",
"styleable",
".",
"TextAppearanceAccentSwitch",
")",
";",... | Sets the switch text color, size, style, hint color, and highlight color
from the specified TextAppearance resource.
@attr ref android.R.styleable#Switch_switchTextAppearance | [
"Sets",
"the",
"switch",
"text",
"color",
"size",
"style",
"hint",
"color",
"and",
"highlight",
"color",
"from",
"the",
"specified",
"TextAppearance",
"resource",
"."
] | train | https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/widget/AccentSwitch.java#L255-L301 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.