repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java | AnchorCell.setRev | public void setRev(String rev) {
_anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.REV, rev);
} | java | public void setRev(String rev) {
_anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.REV, rev);
} | [
"public",
"void",
"setRev",
"(",
"String",
"rev",
")",
"{",
"_anchorState",
".",
"registerAttribute",
"(",
"AbstractHtmlState",
".",
"ATTR_GENERAL",
",",
"HtmlConstants",
".",
"REV",
",",
"rev",
")",
";",
"}"
] | Sets <code>rev</code> attribute for the HTML anchor.
@param rev the rev target for the HTML anchor
@jsptagref.attributedescription The rev for the HTML anchor.
@jsptagref.attributesyntaxvalue <i>string_rev</i>
@netui:attribute required="false" rtexprvalue="true" description="The rev for the HTML anchor." | [
"Sets",
"<code",
">",
"rev<",
"/",
"code",
">",
"attribute",
"for",
"the",
"HTML",
"anchor",
"."
] | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/AnchorCell.java#L354-L356 | train | Sets the revision of the generated HTML file. | Of course, here is the Java code you requested:
```java
public void setRev(String rev) {
_anchorState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, HtmlConstants.REV, rev);
}
```
Hope this helps! |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java | JDBC4DatabaseMetaData.getCatalogs | @Override
public ResultSet getCatalogs() throws SQLException
{
checkClosed();
VoltTable result = new VoltTable(new VoltTable.ColumnInfo("TABLE_CAT",VoltType.STRING));
result.addRow(new Object[] { catalogString });
return new JDBC4ResultSet(null, result);
} | java | @Override
public ResultSet getCatalogs() throws SQLException
{
checkClosed();
VoltTable result = new VoltTable(new VoltTable.ColumnInfo("TABLE_CAT",VoltType.STRING));
result.addRow(new Object[] { catalogString });
return new JDBC4ResultSet(null, result);
} | [
"@",
"Override",
"public",
"ResultSet",
"getCatalogs",
"(",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"VoltTable",
"result",
"=",
"new",
"VoltTable",
"(",
"new",
"VoltTable",
".",
"ColumnInfo",
"(",
"\"TABLE_CAT\"",
",",
"VoltType",
"."... | Retrieves the catalog names available in this database. | [
"Retrieves",
"the",
"catalog",
"names",
"available",
"in",
"this",
"database",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L155-L162 | train | Get a ResultSet of the catalog names in the database. | Of course, here is the Java code you requested:
```java
@Override
public ResultSet getCatalogs() throws SQLException
{
checkClosed();
VoltTable result = new VoltTable(new VoltTable.ColumnInfo("TABLE_CAT",VoltType.STRING));
result.addRow(new Object[] { catalogString });
return ne... |
codelibs/fess | src/main/java/org/codelibs/fess/es/log/bsentity/BsSearchLog.java | BsSearchLog.doBuildColumnString | @Override
protected String doBuildColumnString(String dm) {
StringBuilder sb = new StringBuilder();
sb.append(dm).append(accessType);
sb.append(dm).append(clientIp);
sb.append(dm).append(hitCount);
sb.append(dm).append(hitCountRelation);
sb.append(dm).append(languages... | java | @Override
protected String doBuildColumnString(String dm) {
StringBuilder sb = new StringBuilder();
sb.append(dm).append(accessType);
sb.append(dm).append(clientIp);
sb.append(dm).append(hitCount);
sb.append(dm).append(hitCountRelation);
sb.append(dm).append(languages... | [
"@",
"Override",
"protected",
"String",
"doBuildColumnString",
"(",
"String",
"dm",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"dm",
")",
".",
"append",
"(",
"accessType",
")",
";",
"sb",
".",
... | ============== | [
"=============="
] | e5e4b722549d32a4958dfd94965b21937bfe64cf | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/es/log/bsentity/BsSearchLog.java#L185-L212 | train | Build the column string for a single record. | Of course, here is the Java code you requested:
```java
@Override
protected String doBuildColumnString(String dm) {
StringBuilder sb = new StringBuilder();
sb.append(dm).append(accessType);
sb.append(dm).append(clientIp);
sb.append(dm).append(hitCount);
sb.append(dm).append(... |
gallandarakhneorg/afc | advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java | XMLGISElementUtil.readMapElement | @SuppressWarnings({"unchecked", "checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
public static <T extends MapElement> T readMapElement(Element element, String elementNodeName,
Class<T> type, PathBuilder pathBuilder, XMLResources resources) throws IOException {
final UUID id = XMLUtil.getAttribute... | java | @SuppressWarnings({"unchecked", "checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
public static <T extends MapElement> T readMapElement(Element element, String elementNodeName,
Class<T> type, PathBuilder pathBuilder, XMLResources resources) throws IOException {
final UUID id = XMLUtil.getAttribute... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"checkstyle:cyclomaticcomplexity\"",
",",
"\"checkstyle:npathcomplexity\"",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"MapElement",
">",
"T",
"readMapElement",
"(",
"Element",
"element",
",",
"String"... | Read a map element from the XML description.
@param <T> is the type of the element to create.
@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 ... | [
"Read",
"a",
"map",
"element",
"from",
"the",
"XML",
"description",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java#L257-L437 | train | Read a map element. | Of course, here is the Java code you requested:
```java
@SuppressWarnings({"unchecked", "checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
public static <T extends MapElement> T readMapElement(Element element, String elementNodeName,
Class<T> type, PathBuilder pathBuilder, XMLResources resources) th... |
protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/SingleFieldBuilder.java | SingleFieldBuilder.onChanged | private void onChanged() {
// If builder is null, this is the case where onChanged is being called
// from setMessage or clear.
if (builder != null) {
message = null;
}
if (isClean && parent != null) {
parent.markDirty();
// Don't keep dispatching invalidations until buil... | java | private void onChanged() {
// If builder is null, this is the case where onChanged is being called
// from setMessage or clear.
if (builder != null) {
message = null;
}
if (isClean && parent != null) {
parent.markDirty();
// Don't keep dispatching invalidations until buil... | [
"private",
"void",
"onChanged",
"(",
")",
"{",
"// If builder is null, this is the case where onChanged is being called\r",
"// from setMessage or clear.\r",
"if",
"(",
"builder",
"!=",
"null",
")",
"{",
"message",
"=",
"null",
";",
"}",
"if",
"(",
"isClean",
"&&",
"p... | Called when a the builder or one of its nested children has changed and any parent should be
notified of its invalidation. | [
"Called",
"when",
"a",
"the",
"builder",
"or",
"one",
"of",
"its",
"nested",
"children",
"has",
"changed",
"and",
"any",
"parent",
"should",
"be",
"notified",
"of",
"its",
"invalidation",
"."
] | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/SingleFieldBuilder.java#L230-L242 | train | On changed. | Of course, here is the Java code you requested:
```java
private void onChanged() {
// If builder is null, this is the case where onChanged is being called
// from setMessage or clear.
if (builder != null) {
message = null;
}
if (isClean && parent != null) {
parent.markDirty();
... |
poetix/protonpack | src/main/java/com/codepoetics/protonpack/StreamUtils.java | StreamUtils.aggregate | public static <T> Stream<List<T>> aggregate(Stream<T> source, int size) {
if (size <= 0) throw new IllegalArgumentException("Positive size expected, was: "+size);
return StreamSupport.stream(new AggregatingSpliterator<>(source.spliterator(), (a, e) -> a.size() < size), false)
.onClose(so... | java | public static <T> Stream<List<T>> aggregate(Stream<T> source, int size) {
if (size <= 0) throw new IllegalArgumentException("Positive size expected, was: "+size);
return StreamSupport.stream(new AggregatingSpliterator<>(source.spliterator(), (a, e) -> a.size() < size), false)
.onClose(so... | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"List",
"<",
"T",
">",
">",
"aggregate",
"(",
"Stream",
"<",
"T",
">",
"source",
",",
"int",
"size",
")",
"{",
"if",
"(",
"size",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"... | Aggregates items from source stream into list of items with fixed size
@param source - source stream
@param size - size of the aggregated list
@param <T> The type over which the stream streams.
@return Stream of List<T> with all list of size @size with possible exception of last List<T> | [
"Aggregates",
"items",
"from",
"source",
"stream",
"into",
"list",
"of",
"items",
"with",
"fixed",
"size"
] | 00c55a05a4779926d02d5f4e6c820560a773f9f1 | https://github.com/poetix/protonpack/blob/00c55a05a4779926d02d5f4e6c820560a773f9f1/src/main/java/com/codepoetics/protonpack/StreamUtils.java#L435-L439 | train | Aggregate a stream of objects into a single list of objects. | Of course, here is the Java code you requested:
```java
public static <T> Stream<List<T>> aggregate(Stream<T> source, int size) {
if (size <= 0) throw new IllegalArgumentException("Positive size expected, was: "+size);
return StreamSupport.stream(new AggregatingSpliterator<>(source.spliterator(), (a, e... |
apereo/cas | support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java | AbstractSaml20ObjectBuilder.inflateAuthnRequest | protected String inflateAuthnRequest(final byte[] decodedBytes) {
val inflated = CompressionUtils.inflate(decodedBytes);
if (!StringUtils.isEmpty(inflated)) {
return inflated;
}
return CompressionUtils.decodeByteArrayToString(decodedBytes);
} | java | protected String inflateAuthnRequest(final byte[] decodedBytes) {
val inflated = CompressionUtils.inflate(decodedBytes);
if (!StringUtils.isEmpty(inflated)) {
return inflated;
}
return CompressionUtils.decodeByteArrayToString(decodedBytes);
} | [
"protected",
"String",
"inflateAuthnRequest",
"(",
"final",
"byte",
"[",
"]",
"decodedBytes",
")",
"{",
"val",
"inflated",
"=",
"CompressionUtils",
".",
"inflate",
"(",
"decodedBytes",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"inflated",
... | Inflate authn request string.
@param decodedBytes the decoded bytes
@return the string | [
"Inflate",
"authn",
"request",
"string",
"."
] | b4b306433a8782cef803a39bea5b1f96740e0e9b | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java#L510-L516 | train | Inflate authn request. | Of course, here is the Java code you requested:
```java
protected String inflateAuthnRequest(final byte[] decodedBytes) {
val inflated = CompressionUtils.inflate(decodedBytes);
if (!StringUtils.isEmpty(inflated)) {
return inflated;
}
return CompressionUtils.decodeByteArrayTo... |
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/ComplexMath_F64.java | ComplexMath_F64.root | public static void root(ComplexPolar_F64 a , int N , int k , ComplexPolar_F64 result )
{
result.r = Math.pow(a.r,1.0/N);
result.theta = (a.theta + 2.0*k* UtilEjml.PI)/N;
} | java | public static void root(ComplexPolar_F64 a , int N , int k , ComplexPolar_F64 result )
{
result.r = Math.pow(a.r,1.0/N);
result.theta = (a.theta + 2.0*k* UtilEjml.PI)/N;
} | [
"public",
"static",
"void",
"root",
"(",
"ComplexPolar_F64",
"a",
",",
"int",
"N",
",",
"int",
"k",
",",
"ComplexPolar_F64",
"result",
")",
"{",
"result",
".",
"r",
"=",
"Math",
".",
"pow",
"(",
"a",
".",
"r",
",",
"1.0",
"/",
"N",
")",
";",
"res... | Computes the N<sup>th</sup> root of a complex number in polar notation. There are
N distinct N<sup>th</sup> roots.
@param a Complex number
@param N The root's magnitude
@param k Specifies which root. 0 ≤ k < N
@param result Computed root | [
"Computes",
"the",
"N<sup",
">",
"th<",
"/",
"sup",
">",
"root",
"of",
"a",
"complex",
"number",
"in",
"polar",
"notation",
".",
"There",
"are",
"N",
"distinct",
"N<sup",
">",
"th<",
"/",
"sup",
">",
"roots",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/ComplexMath_F64.java#L174-L178 | train | Computes the root of a complex polynomial using the specified parameters. | Of course, here is the Java code you requested:
```java
public static void root(ComplexPolar_F64 a , int N , int k , ComplexPolar_F64 result )
{
result.r = Math.pow(a.r,1.0/N);
result.theta = (a.theta + 2.0*k* UtilEjml.PI)/N;
}
```
Hope this helps! |
enioka/jqm | jqm-all/jqm-admin/src/main/java/com/enioka/admin/MetaService.java | MetaService.deleteRole | public static void deleteRole(DbConn cnx, int id, boolean force)
{
if (force)
{
cnx.runUpdate("user_remove_role", id);
}
else
{
int userUsingRole = cnx.runSelectSingle("user_select_count_using_role", Integer.class, id);
if (userUsingRole > ... | java | public static void deleteRole(DbConn cnx, int id, boolean force)
{
if (force)
{
cnx.runUpdate("user_remove_role", id);
}
else
{
int userUsingRole = cnx.runSelectSingle("user_select_count_using_role", Integer.class, id);
if (userUsingRole > ... | [
"public",
"static",
"void",
"deleteRole",
"(",
"DbConn",
"cnx",
",",
"int",
"id",
",",
"boolean",
"force",
")",
"{",
"if",
"(",
"force",
")",
"{",
"cnx",
".",
"runUpdate",
"(",
"\"user_remove_role\"",
",",
"id",
")",
";",
"}",
"else",
"{",
"int",
"us... | ///////////////////////////////////////////////////////////////////////// | [
"/////////////////////////////////////////////////////////////////////////"
] | 391733b8e291404b97c714c3727a241c4a861f98 | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-admin/src/main/java/com/enioka/admin/MetaService.java#L1157-L1180 | train | Delete a role from a user. | Of course, here is the Java code you requested:
```java
public static void deleteRole(DbConn cnx, int id, boolean force)
{
if (force)
{
cnx.runUpdate("user_remove_role", id);
}
else
{
int userUsingRole = cnx.runSelectSingle("user_select_count_using_ro... |
Azure/azure-sdk-for-java | dns/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/dns/v2017_10_01/implementation/ZonesInner.java | ZonesInner.updateAsync | public ServiceFuture<ZoneInner> updateAsync(String resourceGroupName, String zoneName, final ServiceCallback<ZoneInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName), serviceCallback);
} | java | public ServiceFuture<ZoneInner> updateAsync(String resourceGroupName, String zoneName, final ServiceCallback<ZoneInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"ZoneInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"zoneName",
",",
"final",
"ServiceCallback",
"<",
"ZoneInner",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromResponse",
"(",
... | Updates a DNS zone. Does not modify DNS records within the zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a terminating dot).
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException th... | [
"Updates",
"a",
"DNS",
"zone",
".",
"Does",
"not",
"modify",
"DNS",
"records",
"within",
"the",
"zone",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/dns/v2017_10_01/implementation/ZonesInner.java#L719-L721 | train | Updates an App Service Environment. | Of course, here is the Java code you requested:
```java
public ServiceFuture<ZoneInner> updateAsync(String resourceGroupName, String zoneName, final ServiceCallback<ZoneInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, zoneName), serviceCallback);
... |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/painter/RasterTilePainter.java | RasterTilePainter.paint | public void paint(Paintable paintable, Object group, MapContext context) {
RasterTile tile = (RasterTile) paintable;
context.getRasterContext().drawImage(tile.getStore().getLayer(),
tile.getCode().toString(), tile.getUrl(), tile.getBounds(), new PictureStyle(1.0));
} | java | public void paint(Paintable paintable, Object group, MapContext context) {
RasterTile tile = (RasterTile) paintable;
context.getRasterContext().drawImage(tile.getStore().getLayer(),
tile.getCode().toString(), tile.getUrl(), tile.getBounds(), new PictureStyle(1.0));
} | [
"public",
"void",
"paint",
"(",
"Paintable",
"paintable",
",",
"Object",
"group",
",",
"MapContext",
"context",
")",
"{",
"RasterTile",
"tile",
"=",
"(",
"RasterTile",
")",
"paintable",
";",
"context",
".",
"getRasterContext",
"(",
")",
".",
"drawImage",
"("... | The actual painting function. Draws the groups.
@param paintable
A {@link RasterTile} object.
@param group
The group where the object resides in (optional).
@param context
A MapContext object, responsible for actual drawing. | [
"The",
"actual",
"painting",
"function",
".",
"Draws",
"the",
"groups",
"."
] | 1c1adc48deb192ed825265eebcc74d70bbf45670 | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/painter/RasterTilePainter.java#L43-L47 | train | Draw the raster tile. | Of course, here is the Java code you requested:
```java
public void paint(Paintable paintable, Object group, MapContext context) {
RasterTile tile = (RasterTile) paintable;
context.getRasterContext().drawImage(tile.getStore().getLayer(),
tile.getCode().toString(), tile.getUrl(), tile.getBounds(), new PictureS... |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.shiftTo | public Point2D shiftTo(final double DISTANCE, final double ANGLE) {
final double EARTH_RADIUS = 6371000.0; // m
final double LON1 = Math.toRadians(this.lon);
final double LAT1 = Math.toRadians(this.lat);
final double LAT2 = Math.asin(Math.sin(LAT1) * Math.cos(DISTANCE / EARTH_RADIUS) + M... | java | public Point2D shiftTo(final double DISTANCE, final double ANGLE) {
final double EARTH_RADIUS = 6371000.0; // m
final double LON1 = Math.toRadians(this.lon);
final double LAT1 = Math.toRadians(this.lat);
final double LAT2 = Math.asin(Math.sin(LAT1) * Math.cos(DISTANCE / EARTH_RADIUS) + M... | [
"public",
"Point2D",
"shiftTo",
"(",
"final",
"double",
"DISTANCE",
",",
"final",
"double",
"ANGLE",
")",
"{",
"final",
"double",
"EARTH_RADIUS",
"=",
"6371000.0",
";",
"// m",
"final",
"double",
"LON1",
"=",
"Math",
".",
"toRadians",
"(",
"this",
".",
"lo... | Moves the poi to the position defined by the given distance and angle
@param DISTANCE
@param ANGLE
@return the poi moved by the given distance and angle | [
"Moves",
"the",
"poi",
"to",
"the",
"position",
"defined",
"by",
"the",
"given",
"distance",
"and",
"angle"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L382-L393 | train | Shift the point to the given distance and angle. | Of course, here is the Java code you requested:
```java
public Point2D shiftTo(final double DISTANCE, final double ANGLE) {
final double EARTH_RADIUS = 6371000.0; // m
final double LON1 = Math.toRadians(this.lon);
final double LAT1 = Math.toRadians(this.lat);
final double LAT2 = Math.as... |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parse | @Beta
public final void parse(Object destination, CustomizeJsonParser customizeParser)
throws IOException {
ArrayList<Type> context = new ArrayList<Type>();
context.add(destination.getClass());
parse(context, destination, customizeParser);
} | java | @Beta
public final void parse(Object destination, CustomizeJsonParser customizeParser)
throws IOException {
ArrayList<Type> context = new ArrayList<Type>();
context.add(destination.getClass());
parse(context, destination, customizeParser);
} | [
"@",
"Beta",
"public",
"final",
"void",
"parse",
"(",
"Object",
"destination",
",",
"CustomizeJsonParser",
"customizeParser",
")",
"throws",
"IOException",
"{",
"ArrayList",
"<",
"Type",
">",
"context",
"=",
"new",
"ArrayList",
"<",
"Type",
">",
"(",
")",
";... | {@link Beta} <br>
Parse a JSON object from the given JSON parser into the given destination object, optionally
using the given parser customizer.
<p>Before this method is called, the parser must either point to the start or end of a JSON
object or to a field name. After this method ends, the current token will be the ... | [
"{",
"@link",
"Beta",
"}",
"<br",
">",
"Parse",
"a",
"JSON",
"object",
"from",
"the",
"given",
"JSON",
"parser",
"into",
"the",
"given",
"destination",
"object",
"optionally",
"using",
"the",
"given",
"parser",
"customizer",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L396-L402 | train | A helper method to parse a CID or CID object. | Of course, here is the Java code you requested:
```java
@Beta
public final void parse(Object destination, CustomizeJsonParser customizeParser)
throws IOException {
ArrayList<Type> context = new ArrayList<Type>();
context.add(destination.getClass());
parse(context, destination, customizeParser);
}... |
redisson/redisson | redisson/src/main/java/org/redisson/Redisson.java | Redisson.createReactive | public static RedissonReactiveClient createReactive() {
Config config = new Config();
config.useSingleServer().setAddress("redis://127.0.0.1:6379");
return createReactive(config);
} | java | public static RedissonReactiveClient createReactive() {
Config config = new Config();
config.useSingleServer().setAddress("redis://127.0.0.1:6379");
return createReactive(config);
} | [
"public",
"static",
"RedissonReactiveClient",
"createReactive",
"(",
")",
"{",
"Config",
"config",
"=",
"new",
"Config",
"(",
")",
";",
"config",
".",
"useSingleServer",
"(",
")",
".",
"setAddress",
"(",
"\"redis://127.0.0.1:6379\"",
")",
";",
"return",
"createR... | Create Reactive Redisson instance with default config
@return Redisson instance | [
"Create",
"Reactive",
"Redisson",
"instance",
"with",
"default",
"config"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/Redisson.java#L197-L201 | train | Create a RedissonReactiveClient | Of course, here is the Java code you requested:
```java
public static RedissonReactiveClient createReactive() {
Config config = new Config();
config.useSingleServer().setAddress("redis://127.0.0.1:6379");
return createReactive(config);
}
```
Hope this helps! |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.getLocal | public static LocalFileSystem getLocal(Configuration conf)
throws IOException {
return (LocalFileSystem)get(LocalFileSystem.NAME, conf);
} | java | public static LocalFileSystem getLocal(Configuration conf)
throws IOException {
return (LocalFileSystem)get(LocalFileSystem.NAME, conf);
} | [
"public",
"static",
"LocalFileSystem",
"getLocal",
"(",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"return",
"(",
"LocalFileSystem",
")",
"get",
"(",
"LocalFileSystem",
".",
"NAME",
",",
"conf",
")",
";",
"}"
] | Get the local file syste
@param conf the configuration to configure the file system with
@return a LocalFileSystem | [
"Get",
"the",
"local",
"file",
"syste"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L179-L182 | train | Get a LocalFileSystem object from the configuration. | Of course, here is the Java code you requested:
```java
public static LocalFileSystem getLocal(Configuration conf)
throws IOException {
return (LocalFileSystem)get(LocalFileSystem.NAME, conf);
}
```
Hope this helps! |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/css/MediaSpec.java | MediaSpec.dpiResolution | protected Float dpiResolution(TermResolution spec)
{
float nval = spec.getValue();
TermLength.Unit unit = spec.getUnit();
switch (unit)
{
case dpi:
return nval;
case dpcm:
return nval * 2.54f;
case dppx:
... | java | protected Float dpiResolution(TermResolution spec)
{
float nval = spec.getValue();
TermLength.Unit unit = spec.getUnit();
switch (unit)
{
case dpi:
return nval;
case dpcm:
return nval * 2.54f;
case dppx:
... | [
"protected",
"Float",
"dpiResolution",
"(",
"TermResolution",
"spec",
")",
"{",
"float",
"nval",
"=",
"spec",
".",
"getValue",
"(",
")",
";",
"TermLength",
".",
"Unit",
"unit",
"=",
"spec",
".",
"getUnit",
"(",
")",
";",
"switch",
"(",
"unit",
")",
"{"... | Converts a resolution from a CSS length to 'dpi'.
@param spec the CSS resolution specification
@return the resolution in 'dpi' or {@code null} when the unit is invalid | [
"Converts",
"a",
"resolution",
"from",
"a",
"CSS",
"length",
"to",
"dpi",
"."
] | 8ab049ac6866aa52c4d7deee25c9e294e7191957 | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/css/MediaSpec.java#L689-L705 | train | Get the dpi resolution of a CSP term. | Of course, here is the Java code you requested:
```java
protected Float dpiResolution(TermResolution spec)
{
float nval = spec.getValue();
TermLength.Unit unit = spec.getUnit();
switch (unit)
{
case dpi:
return nval;
case dpcm:
... |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/output/datastore/DatastoreOutputWriterFactory.java | DatastoreOutputWriterFactory.getActualTableName | public static String getActualTableName(final OutputWriter outputWriter) {
assert outputWriter instanceof DatastoreOutputWriter;
final DatastoreOutputWriter dow = (DatastoreOutputWriter) outputWriter;
return dow.getTableName();
} | java | public static String getActualTableName(final OutputWriter outputWriter) {
assert outputWriter instanceof DatastoreOutputWriter;
final DatastoreOutputWriter dow = (DatastoreOutputWriter) outputWriter;
return dow.getTableName();
} | [
"public",
"static",
"String",
"getActualTableName",
"(",
"final",
"OutputWriter",
"outputWriter",
")",
"{",
"assert",
"outputWriter",
"instanceof",
"DatastoreOutputWriter",
";",
"final",
"DatastoreOutputWriter",
"dow",
"=",
"(",
"DatastoreOutputWriter",
")",
"outputWriter... | Gets the actual table name written by an {@link OutputWriter}, which may
differ from the requested name if the name was not a valid RDBMS table
name or if the table name was already used and truncation was disabled.
@param outputWriter
@return | [
"Gets",
"the",
"actual",
"table",
"name",
"written",
"by",
"an",
"{",
"@link",
"OutputWriter",
"}",
"which",
"may",
"differ",
"from",
"the",
"requested",
"name",
"if",
"the",
"name",
"was",
"not",
"a",
"valid",
"RDBMS",
"table",
"name",
"or",
"if",
"the"... | 9aa01fdac3560cef51c55df3cb2ac5c690b57639 | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/output/datastore/DatastoreOutputWriterFactory.java#L81-L85 | train | Gets the actual table name. | Of course, here is the Java code you requested:
```java
public static String getActualTableName(final OutputWriter outputWriter) {
assert outputWriter instanceof DatastoreOutputWriter;
final DatastoreOutputWriter dow = (DatastoreOutputWriter) outputWriter;
return dow.getTableName();
}
```
... |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatControllerOutput.java | DssatControllerOutput.recordSWData | private void recordSWData(Map expData, DssatCommonOutput output) {
String id;
HashMap<String, Map> swData;
try {
if (output instanceof DssatSoilOutput) {
Map soilTmp = getObjectOr(expData, "soil", new HashMap());
if (soilTmp.isEmpty()) {
... | java | private void recordSWData(Map expData, DssatCommonOutput output) {
String id;
HashMap<String, Map> swData;
try {
if (output instanceof DssatSoilOutput) {
Map soilTmp = getObjectOr(expData, "soil", new HashMap());
if (soilTmp.isEmpty()) {
... | [
"private",
"void",
"recordSWData",
"(",
"Map",
"expData",
",",
"DssatCommonOutput",
"output",
")",
"{",
"String",
"id",
";",
"HashMap",
"<",
"String",
",",
"Map",
">",
"swData",
";",
"try",
"{",
"if",
"(",
"output",
"instanceof",
"DssatSoilOutput",
")",
"{... | write soil/weather files
@param expData The holder for experiment data include soil/weather data
@param output The DSSAT Writer object | [
"write",
"soil",
"/",
"weather",
"files"
] | 4be61d998f106eb7234ea8701b63c3746ae688f4 | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatControllerOutput.java#L284-L319 | train | Record SW data. | Of course, here is the Java code you requested:
```java
private void recordSWData(Map expData, DssatCommonOutput output) {
String id;
HashMap<String, Map> swData;
try {
if (output instanceof DssatSoilOutput) {
Map soilTmp = getObjectOr(expData, "soil", new HashMap())... |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/ListLayoutExample.java | ListLayoutExample.addExample | private void addExample(final String heading, final ListLayout layout) {
add(new WHeading(HeadingLevel.H2, heading));
WPanel panel = new WPanel();
panel.setLayout(layout);
add(panel);
for (String item : EXAMPLE_ITEMS) {
panel.add(new WText(item));
}
add(new WHorizontalRule());
} | java | private void addExample(final String heading, final ListLayout layout) {
add(new WHeading(HeadingLevel.H2, heading));
WPanel panel = new WPanel();
panel.setLayout(layout);
add(panel);
for (String item : EXAMPLE_ITEMS) {
panel.add(new WText(item));
}
add(new WHorizontalRule());
} | [
"private",
"void",
"addExample",
"(",
"final",
"String",
"heading",
",",
"final",
"ListLayout",
"layout",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H2",
",",
"heading",
")",
")",
";",
"WPanel",
"panel",
"=",
"new",
"WPanel",
"("... | Adds an example to the set of examples.
@param heading the heading for the example
@param layout the layout for the panel | [
"Adds",
"an",
"example",
"to",
"the",
"set",
"of",
"examples",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/ListLayoutExample.java#L55-L64 | train | Add example. | Of course, here is the Java code you requested:
```java
private void addExample(final String heading, final ListLayout layout) {
add(new WHeading(HeadingLevel.H2, heading));
WPanel panel = new WPanel();
panel.setLayout(layout);
add(panel);
for (String item : EXAMPLE_ITEMS) {
panel.add(new WText(item));
... |
lucee/Lucee | core/src/main/java/lucee/commons/management/MemoryInfo.java | MemoryInfo.deepMemoryUsageOfAll | public static long deepMemoryUsageOfAll(Instrumentation inst, final Collection<? extends java.lang.Object> objs, final int referenceFilter) throws IOException {
long total = 0L;
final Set<Integer> counted = new HashSet<Integer>(objs.size() * 4);
for (final Object o: objs) {
total += deepMemoryUsageOf0(inst, cou... | java | public static long deepMemoryUsageOfAll(Instrumentation inst, final Collection<? extends java.lang.Object> objs, final int referenceFilter) throws IOException {
long total = 0L;
final Set<Integer> counted = new HashSet<Integer>(objs.size() * 4);
for (final Object o: objs) {
total += deepMemoryUsageOf0(inst, cou... | [
"public",
"static",
"long",
"deepMemoryUsageOfAll",
"(",
"Instrumentation",
"inst",
",",
"final",
"Collection",
"<",
"?",
"extends",
"java",
".",
"lang",
".",
"Object",
">",
"objs",
",",
"final",
"int",
"referenceFilter",
")",
"throws",
"IOException",
"{",
"lo... | Returns an estimation, in bytes, of the memory usage of the given objects plus (recursively)
objects referenced via non-static references from any of those objects. Which references are
traversed depends on the VisibilityFilter passed in. If two or more of the given objects
reference the same Object X, then the memory ... | [
"Returns",
"an",
"estimation",
"in",
"bytes",
"of",
"the",
"memory",
"usage",
"of",
"the",
"given",
"objects",
"plus",
"(",
"recursively",
")",
"objects",
"referenced",
"via",
"non",
"-",
"static",
"references",
"from",
"any",
"of",
"those",
"objects",
".",
... | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/management/MemoryInfo.java#L129-L136 | train | Computes the total deep memory usage of all objects in the given collection. | Of course, here is the Java code you requested:
```java
public static long deepMemoryUsageOfAll(Instrumentation inst, final Collection<? extends java.lang.Object> objs, final int referenceFilter) throws IOException {
long total = 0L;
final Set<Integer> counted = new HashSet<Integer>(objs.size() * 4);
for (final Obj... |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java | CollectionExtensions.addAll | @SafeVarargs
public static <T> boolean addAll(Collection<? super T> collection, T... elements) {
return collection.addAll(Arrays.asList(elements));
} | java | @SafeVarargs
public static <T> boolean addAll(Collection<? super T> collection, T... elements) {
return collection.addAll(Arrays.asList(elements));
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"Collection",
"<",
"?",
"super",
"T",
">",
"collection",
",",
"T",
"...",
"elements",
")",
"{",
"return",
"collection",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"... | Adds all of the specified elements to the specified collection.
@param collection
the collection into which the {@code elements} are to be inserted. May not be <code>null</code>.
@param elements
the elements to insert into the {@code collection}. May not be <code>null</code> but may contain
<code>null</code> entries i... | [
"Adds",
"all",
"of",
"the",
"specified",
"elements",
"to",
"the",
"specified",
"collection",
"."
] | 7063572e1f1bd713a3aa53bdf3a8dc60e25c169a | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java#L253-L256 | train | Adds all elements to the collection. | Of course, here is the Java code you requested:
```java
@SafeVarargs
public static <T> boolean addAll(Collection<? super T> collection, T... elements) {
return collection.addAll(Arrays.asList(elements));
}
```
Hope this helps! |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionOptionValueRelLocalServiceBaseImpl.java | CPDefinitionOptionValueRelLocalServiceBaseImpl.getCPDefinitionOptionValueRels | @Override
public List<CPDefinitionOptionValueRel> getCPDefinitionOptionValueRels(
int start, int end) {
return cpDefinitionOptionValueRelPersistence.findAll(start, end);
} | java | @Override
public List<CPDefinitionOptionValueRel> getCPDefinitionOptionValueRels(
int start, int end) {
return cpDefinitionOptionValueRelPersistence.findAll(start, end);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionValueRel",
">",
"getCPDefinitionOptionValueRels",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"cpDefinitionOptionValueRelPersistence",
".",
"findAll",
"(",
"start",
",",
"end",
")",
";",
"}... | Returns a range of all the cp definition option value rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionOptionValueRelLocalServiceBaseImpl.java#L443-L447 | train | Returns a range of cp definition option value rels. | Of course, here is the Java code you requested:
```java
@Override
public List<CPDefinitionOptionValueRel> getCPDefinitionOptionValueRels(
int start, int end) {
return cpDefinitionOptionValueRelPersistence.findAll(start, end);
}
```
Hope this helps! |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/autodiff/Tensor.java | Tensor.log | public void log() {
for (int c=0; c<this.values.length; c++) {
this.values[c] = s.log(this.values[c]);
}
} | java | public void log() {
for (int c=0; c<this.values.length; c++) {
this.values[c] = s.log(this.values[c]);
}
} | [
"public",
"void",
"log",
"(",
")",
"{",
"for",
"(",
"int",
"c",
"=",
"0",
";",
"c",
"<",
"this",
".",
"values",
".",
"length",
";",
"c",
"++",
")",
"{",
"this",
".",
"values",
"[",
"c",
"]",
"=",
"s",
".",
"log",
"(",
"this",
".",
"values",... | Take the log of each entry. | [
"Take",
"the",
"log",
"of",
"each",
"entry",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/autodiff/Tensor.java#L386-L390 | train | Log the sequence of the sequence. | Of course, here is the Java code you requested:
```java
public void log() {
for (int c=0; c<this.values.length; c++) {
this.values[c] = s.log(this.values[c]);
}
}
```
Hope this helps! |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/TextAnalysis.java | TextAnalysis.spelling | public double spelling(final String source) {
assert (source.startsWith("|"));
assert (source.endsWith("|"));
WordSpelling original = new WordSpelling(source);
WordSpelling corrected = IntStream.range(0, 1).mapToObj(i -> buildCorrection(original)).min(Comparator.comparingDouble(x -> x.sum)).get();
r... | java | public double spelling(final String source) {
assert (source.startsWith("|"));
assert (source.endsWith("|"));
WordSpelling original = new WordSpelling(source);
WordSpelling corrected = IntStream.range(0, 1).mapToObj(i -> buildCorrection(original)).min(Comparator.comparingDouble(x -> x.sum)).get();
r... | [
"public",
"double",
"spelling",
"(",
"final",
"String",
"source",
")",
"{",
"assert",
"(",
"source",
".",
"startsWith",
"(",
"\"|\"",
")",
")",
";",
"assert",
"(",
"source",
".",
"endsWith",
"(",
"\"|\"",
")",
")",
";",
"WordSpelling",
"original",
"=",
... | Spelling double.
@param source the source
@return the double | [
"Spelling",
"double",
"."
] | b5a5e73449aae57de7dbfca2ed7a074432c5b17e | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/TextAnalysis.java#L143-L149 | train | Gets the spelling of a word. | Of course, here is the Java code you requested:
```java
public double spelling(final String source) {
assert (source.startsWith("|"));
assert (source.endsWith("|"));
WordSpelling original = new WordSpelling(source);
WordSpelling corrected = IntStream.range(0, 1).mapToObj(i -> buildCorrection(original))... |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.isDelayedQueue | public static boolean isDelayedQueue(final Jedis jedis, final String key) {
return ZSET.equalsIgnoreCase(jedis.type(key));
} | java | public static boolean isDelayedQueue(final Jedis jedis, final String key) {
return ZSET.equalsIgnoreCase(jedis.type(key));
} | [
"public",
"static",
"boolean",
"isDelayedQueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"key",
")",
"{",
"return",
"ZSET",
".",
"equalsIgnoreCase",
"(",
"jedis",
".",
"type",
"(",
"key",
")",
")",
";",
"}"
] | Determines if the queue identified by the given key is a delayed queue.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key identifies a delayed queue, false otherwise | [
"Determines",
"if",
"the",
"queue",
"identified",
"by",
"the",
"given",
"key",
"is",
"a",
"delayed",
"queue",
"."
] | 44749183dccc40962a94c2af547ea7d0d880b5d1 | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L132-L134 | train | Check if a queue is delayed. | Of course, here is the Java code you requested:
```java
public static boolean isDelayedQueue(final Jedis jedis, final String key) {
return ZSET.equalsIgnoreCase(jedis.type(key));
}
```
Hope this helps! |
Unidata/thredds | ui/src/main/java/ucar/util/prefs/ui/Debug.java | Debug.addToMenu | static private void addToMenu( JMenu menu, Preferences prefs) throws BackingStoreException {
if (debug) System.out.println(" addMenu "+ prefs.name());
String[] keys = prefs.keys();
for (String key : keys) {
boolean bval = prefs.getBoolean(key, false);
String fullname = prefs.absolutePath() + "/... | java | static private void addToMenu( JMenu menu, Preferences prefs) throws BackingStoreException {
if (debug) System.out.println(" addMenu "+ prefs.name());
String[] keys = prefs.keys();
for (String key : keys) {
boolean bval = prefs.getBoolean(key, false);
String fullname = prefs.absolutePath() + "/... | [
"static",
"private",
"void",
"addToMenu",
"(",
"JMenu",
"menu",
",",
"Preferences",
"prefs",
")",
"throws",
"BackingStoreException",
"{",
"if",
"(",
"debug",
")",
"System",
".",
"out",
".",
"println",
"(",
"\" addMenu \"",
"+",
"prefs",
".",
"name",
"(",
"... | recursive menu adding | [
"recursive",
"menu",
"adding"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/util/prefs/ui/Debug.java#L157-L175 | test | Add all the items in the preferences to the menu | Of course, here is the Java code you requested:
```java
static private void addToMenu( JMenu menu, Preferences prefs) throws BackingStoreException {
if (debug) System.out.println(" addMenu "+ prefs.name());
String[] keys = prefs.keys();
for (String key : keys) {
boolean bval = prefs.getBoolean(key, ... |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java | GeneratedDi18nDaoImpl.queryByLocale | public Iterable<Di18n> queryByLocale(java.lang.String locale) {
return queryByField(null, Di18nMapper.Field.LOCALE.getFieldName(), locale);
} | java | public Iterable<Di18n> queryByLocale(java.lang.String locale) {
return queryByField(null, Di18nMapper.Field.LOCALE.getFieldName(), locale);
} | [
"public",
"Iterable",
"<",
"Di18n",
">",
"queryByLocale",
"(",
"java",
".",
"lang",
".",
"String",
"locale",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"Di18nMapper",
".",
"Field",
".",
"LOCALE",
".",
"getFieldName",
"(",
")",
",",
"locale",
"... | query-by method for field locale
@param locale the specified attribute
@return an Iterable of Di18ns for the specified locale | [
"query",
"-",
"by",
"method",
"for",
"field",
"locale"
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java#L79-L81 | train | query - by method for field locale | Of course, here is the Java code you requested:
```java
public Iterable<Di18n> queryByLocale(java.lang.String locale) {
return queryByField(null, Di18nMapper.Field.LOCALE.getFieldName(), locale);
}
```
Hope this helps! |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXWriter.java | MPXWriter.formatDuration | private String formatDuration(Object value)
{
String result = null;
if (value instanceof Duration)
{
Duration duration = (Duration) value;
result = m_formats.getDurationDecimalFormat().format(duration.getDuration()) + formatTimeUnit(duration.getUnits());
}
return resul... | java | private String formatDuration(Object value)
{
String result = null;
if (value instanceof Duration)
{
Duration duration = (Duration) value;
result = m_formats.getDurationDecimalFormat().format(duration.getDuration()) + formatTimeUnit(duration.getUnits());
}
return resul... | [
"private",
"String",
"formatDuration",
"(",
"Object",
"value",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"value",
"instanceof",
"Duration",
")",
"{",
"Duration",
"duration",
"=",
"(",
"Duration",
")",
"value",
";",
"result",
"=",
"m_format... | This method is called to format a duration.
@param value duration value
@return formatted duration value | [
"This",
"method",
"is",
"called",
"to",
"format",
"a",
"duration",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXWriter.java#L1132-L1141 | train | This method is called to format a duration value. | Of course, here is the Java code you requested:
```java
private String formatDuration(Object value)
{
String result = null;
if (value instanceof Duration)
{
Duration duration = (Duration) value;
result = m_formats.getDurationDecimalFormat().format(duration.getDuration()) + format... |
google/flogger | api/src/main/java/com/google/common/flogger/parser/BraceStyleMessageParser.java | BraceStyleMessageParser.unescapeBraceFormat | static void unescapeBraceFormat(StringBuilder out, String message, int start, int end) {
int pos = start;
boolean isQuoted = false;
while (pos < end) {
char c = message.charAt(pos++);
// We catch single quotes and escaped single quotes.
if (c != '\\' && c != '\'') {
continue;
... | java | static void unescapeBraceFormat(StringBuilder out, String message, int start, int end) {
int pos = start;
boolean isQuoted = false;
while (pos < end) {
char c = message.charAt(pos++);
// We catch single quotes and escaped single quotes.
if (c != '\\' && c != '\'') {
continue;
... | [
"static",
"void",
"unescapeBraceFormat",
"(",
"StringBuilder",
"out",
",",
"String",
"message",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"boolean",
"isQuoted",
"=",
"false",
";",
"while",
"(",
"pos",
"<",
"end",
... | VisibleForTesting | [
"VisibleForTesting"
] | a164967a93a9f4ce92f34319fc0cc7c91a57321c | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/BraceStyleMessageParser.java#L184-L222 | train | Unescapes the braces in the message. | Of course, here is the Java code you requested:
```java
static void unescapeBraceFormat(StringBuilder out, String message, int start, int end) {
int pos = start;
boolean isQuoted = false;
while (pos < end) {
char c = message.charAt(pos++);
// We catch single quotes and escaped single quotes.
... |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java | TimeZone.hasSameRules | public boolean hasSameRules(TimeZone other) {
return other != null &&
getRawOffset() == other.getRawOffset() &&
useDaylightTime() == other.useDaylightTime();
} | java | public boolean hasSameRules(TimeZone other) {
return other != null &&
getRawOffset() == other.getRawOffset() &&
useDaylightTime() == other.useDaylightTime();
} | [
"public",
"boolean",
"hasSameRules",
"(",
"TimeZone",
"other",
")",
"{",
"return",
"other",
"!=",
"null",
"&&",
"getRawOffset",
"(",
")",
"==",
"other",
".",
"getRawOffset",
"(",
")",
"&&",
"useDaylightTime",
"(",
")",
"==",
"other",
".",
"useDaylightTime",
... | Returns true if this zone has the same rule and offset as another zone.
That is, if this zone differs only in ID, if at all. Returns false
if the other zone is null.
@param other the <code>TimeZone</code> object to be compared with
@return true if the other zone is not null and is the same as this one,
with the possib... | [
"Returns",
"true",
"if",
"this",
"zone",
"has",
"the",
"same",
"rule",
"and",
"offset",
"as",
"another",
"zone",
".",
"That",
"is",
"if",
"this",
"zone",
"differs",
"only",
"in",
"ID",
"if",
"at",
"all",
".",
"Returns",
"false",
"if",
"the",
"other",
... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java#L952-L956 | train | Check if this time zone has the same rules. | Of course, here is the Java code you requested:
```java
public boolean hasSameRules(TimeZone other) {
return other != null &&
getRawOffset() == other.getRawOffset() &&
useDaylightTime() == other.useDaylightTime();
}
```
Hope this helps! |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/StackTraceUtils.java | StackTraceUtils.extractRootCause | public static Throwable extractRootCause(Throwable t) {
Throwable result = t;
while (result.getCause() != null) {
result = result.getCause();
}
return result;
} | java | public static Throwable extractRootCause(Throwable t) {
Throwable result = t;
while (result.getCause() != null) {
result = result.getCause();
}
return result;
} | [
"public",
"static",
"Throwable",
"extractRootCause",
"(",
"Throwable",
"t",
")",
"{",
"Throwable",
"result",
"=",
"t",
";",
"while",
"(",
"result",
".",
"getCause",
"(",
")",
"!=",
"null",
")",
"{",
"result",
"=",
"result",
".",
"getCause",
"(",
")",
"... | Extracts the root cause of the exception, no matter how nested it is
@param t a Throwable
@return The deepest cause of the exception that can be found | [
"Extracts",
"the",
"root",
"cause",
"of",
"the",
"exception",
"no",
"matter",
"how",
"nested",
"it",
"is"
] | 71cf20addb611bb8d097a59e395fd20bc7f31772 | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/StackTraceUtils.java#L159-L165 | train | Extract the root cause of a Throwable. | Of course, here is the Java code you requested:
```java
public static Throwable extractRootCause(Throwable t) {
Throwable result = t;
while (result.getCause() != null) {
result = result.getCause();
}
return result;
}
```
Hope this helps! |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/ringsearch/JumboCyclicVertexSearch.java | JumboCyclicVertexSearch.and | static BitSet and(BitSet x, BitSet y) {
BitSet z = copy(x);
z.and(y);
return z;
} | java | static BitSet and(BitSet x, BitSet y) {
BitSet z = copy(x);
z.and(y);
return z;
} | [
"static",
"BitSet",
"and",
"(",
"BitSet",
"x",
",",
"BitSet",
"y",
")",
"{",
"BitSet",
"z",
"=",
"copy",
"(",
"x",
")",
";",
"z",
".",
"and",
"(",
"y",
")",
";",
"return",
"z",
";",
"}"
] | AND the to bit sets together and return the result. Neither input is
modified.
@param x first bit set
@param y second bit set
@return the AND of the two bit sets | [
"AND",
"the",
"to",
"bit",
"sets",
"together",
"and",
"return",
"the",
"result",
".",
"Neither",
"input",
"is",
"modified",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/ringsearch/JumboCyclicVertexSearch.java#L378-L382 | train | AND two sets of attributes. | Of course, here is the Java code you requested:
```java
static BitSet and(BitSet x, BitSet y) {
BitSet z = copy(x);
z.and(y);
return z;
}
```
Hope this helps! |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/GSCAImpl.java | GSCAImpl.eGet | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.GSCA__XPOS:
return getXPOS();
case AfplibPackage.GSCA__YPOS:
return getYPOS();
}
return super.eGet(featureID, resolve, coreType);
} | java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.GSCA__XPOS:
return getXPOS();
case AfplibPackage.GSCA__YPOS:
return getYPOS();
}
return super.eGet(featureID, resolve, coreType);
} | [
"@",
"Override",
"public",
"Object",
"eGet",
"(",
"int",
"featureID",
",",
"boolean",
"resolve",
",",
"boolean",
"coreType",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"AfplibPackage",
".",
"GSCA__XPOS",
":",
"return",
"getXPOS",
"(",
")",
";"... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/GSCAImpl.java#L137-L146 | train | Override eGet to return the object that corresponds to the featureID. | Of course, here is the Java code you requested:
```java
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.GSCA__XPOS:
return getXPOS();
case AfplibPackage.GSCA__YPOS:
return getYPOS();
}
return super.eGet(featureID, resolve, co... |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/AmazonIdentityManagementClient.java | AmazonIdentityManagementClient.generateCredentialReport | @Override
public GenerateCredentialReportResult generateCredentialReport(GenerateCredentialReportRequest request) {
request = beforeClientExecution(request);
return executeGenerateCredentialReport(request);
} | java | @Override
public GenerateCredentialReportResult generateCredentialReport(GenerateCredentialReportRequest request) {
request = beforeClientExecution(request);
return executeGenerateCredentialReport(request);
} | [
"@",
"Override",
"public",
"GenerateCredentialReportResult",
"generateCredentialReport",
"(",
"GenerateCredentialReportRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeGenerateCredentialReport",
"(",
"request"... | <p>
Generates a credential report for the AWS account. For more information about the credential report, see <a
href="https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html">Getting Credential Reports</a> in
the <i>IAM User Guide</i>.
</p>
@param generateCredentialReportRequest
@return Result of the ... | [
"<p",
">",
"Generates",
"a",
"credential",
"report",
"for",
"the",
"AWS",
"account",
".",
"For",
"more",
"information",
"about",
"the",
"credential",
"report",
"see",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
"com",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/AmazonIdentityManagementClient.java#L3937-L3941 | train | Generates a credential report for an app. | Of course, here is the Java code you requested:
```java
@Override
public GenerateCredentialReportResult generateCredentialReport(GenerateCredentialReportRequest request) {
request = beforeClientExecution(request);
return executeGenerateCredentialReport(request);
}
```
Hope this helps! |
caspervg/SC4D-LEX4J | lex4j/src/main/java/net/caspervg/lex4j/route/LotRoute.java | LotRoute.getDependencyString | public String getDependencyString(int id) {
ClientResource resource = new ClientResource(Route.DEPENDENCY_STRING.url(id));
try {
Representation repr = resource.get();
return mapper.readValue(repr.getText(), DependencyString.class).getDependency();
} catch (IOException ex... | java | public String getDependencyString(int id) {
ClientResource resource = new ClientResource(Route.DEPENDENCY_STRING.url(id));
try {
Representation repr = resource.get();
return mapper.readValue(repr.getText(), DependencyString.class).getDependency();
} catch (IOException ex... | [
"public",
"String",
"getDependencyString",
"(",
"int",
"id",
")",
"{",
"ClientResource",
"resource",
"=",
"new",
"ClientResource",
"(",
"Route",
".",
"DEPENDENCY_STRING",
".",
"url",
"(",
"id",
")",
")",
";",
"try",
"{",
"Representation",
"repr",
"=",
"resou... | Retrieves the dependency string for a lot/file
@param id ID of the lot/file
@return the dependency string | [
"Retrieves",
"the",
"dependency",
"string",
"for",
"a",
"lot",
"/",
"file"
] | 3d086ec70c817119a88573c2e23af27276cdb1d6 | https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/LotRoute.java#L238-L248 | train | Get the lot dependency string for a lot id | Of course, here is the Java code you requested:
```java
public String getDependencyString(int id) {
ClientResource resource = new ClientResource(Route.DEPENDENCY_STRING.url(id));
try {
Representation repr = resource.get();
return mapper.readValue(repr.getText(), DependencyStrin... |
Unidata/thredds | tds/src/main/java/thredds/core/ConfigCatalogInitialization.java | ConfigCatalogInitialization.makeDebugActions | public void makeDebugActions() {
DebugCommands.Category debugHandler = debugCommands.findCategory("Catalogs");
DebugCommands.Action act;
act = new DebugCommands.Action("showCatalogExt", "Show known catalogs") {
public void doAction(DebugCommands.Event e) {
e.pw.printf("numberCatalogs=%d ne... | java | public void makeDebugActions() {
DebugCommands.Category debugHandler = debugCommands.findCategory("Catalogs");
DebugCommands.Action act;
act = new DebugCommands.Action("showCatalogExt", "Show known catalogs") {
public void doAction(DebugCommands.Event e) {
e.pw.printf("numberCatalogs=%d ne... | [
"public",
"void",
"makeDebugActions",
"(",
")",
"{",
"DebugCommands",
".",
"Category",
"debugHandler",
"=",
"debugCommands",
".",
"findCategory",
"(",
"\"Catalogs\"",
")",
";",
"DebugCommands",
".",
"Action",
"act",
";",
"act",
"=",
"new",
"DebugCommands",
".",
... | ///////////////////////////////////////////////////////////////////////////////////////////////////////////// | [
"/////////////////////////////////////////////////////////////////////////////////////////////////////////////"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/core/ConfigCatalogInitialization.java#L466-L508 | test | Make the debug actions | Of course, here is the Java code you requested:
```java
public void makeDebugActions() {
DebugCommands.Category debugHandler = debugCommands.findCategory("Catalogs");
DebugCommands.Action act;
act = new DebugCommands.Action("showCatalogExt", "Show known catalogs") {
public void doAction(DebugComma... |
dashbuilder/dashbuilder | dashbuilder-client/dashbuilder-navigation-client/src/main/java/org/dashbuilder/client/navigation/widget/editor/NavItemEditor.java | NavItemEditor.addCommands | private void addCommands() {
boolean dividerRequired = false;
if (creationEnabled) {
boolean newGroupEnabled = isNewGroupEnabled();
if (newGroupEnabled) {
this.addCommand(view.i18nNewItem(getGroupLiteral()), this::newGroup);
dividerRequired = true... | java | private void addCommands() {
boolean dividerRequired = false;
if (creationEnabled) {
boolean newGroupEnabled = isNewGroupEnabled();
if (newGroupEnabled) {
this.addCommand(view.i18nNewItem(getGroupLiteral()), this::newGroup);
dividerRequired = true... | [
"private",
"void",
"addCommands",
"(",
")",
"{",
"boolean",
"dividerRequired",
"=",
"false",
";",
"if",
"(",
"creationEnabled",
")",
"{",
"boolean",
"newGroupEnabled",
"=",
"isNewGroupEnabled",
"(",
")",
";",
"if",
"(",
"newGroupEnabled",
")",
"{",
"this",
"... | Item commands | [
"Item",
"commands"
] | 50ef88210726b4f2f33f1a82eaf0f542e38dedd9 | https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-navigation-client/src/main/java/org/dashbuilder/client/navigation/widget/editor/NavItemEditor.java#L559-L601 | train | Add commands to the page. | Of course, here is the Java code you requested:
```java
private void addCommands() {
boolean dividerRequired = false;
if (creationEnabled) {
boolean newGroupEnabled = isNewGroupEnabled();
if (newGroupEnabled) {
this.addCommand(view.i18nNewItem(getGroupLiteral())... |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/EigenPair.java | EigenPair.compareTo | @Override
public int compareTo(EigenPair o) {
if(this.eigenvalue < o.eigenvalue) {
return -1;
}
if(this.eigenvalue > o.eigenvalue) {
return +1;
}
return 0;
} | java | @Override
public int compareTo(EigenPair o) {
if(this.eigenvalue < o.eigenvalue) {
return -1;
}
if(this.eigenvalue > o.eigenvalue) {
return +1;
}
return 0;
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"EigenPair",
"o",
")",
"{",
"if",
"(",
"this",
".",
"eigenvalue",
"<",
"o",
".",
"eigenvalue",
")",
"{",
"return",
"-",
"1",
";",
"}",
"if",
"(",
"this",
".",
"eigenvalue",
">",
"o",
".",
"eigenva... | Compares this object with the specified object for order. Returns a
negative integer, zero, or a positive integer as this object's eigenvalue
is greater than, equal to, or less than the specified object's eigenvalue.
@param o the Eigenvector to be compared.
@return a negative integer, zero, or a positive integer as th... | [
"Compares",
"this",
"object",
"with",
"the",
"specified",
"object",
"for",
"order",
".",
"Returns",
"a",
"negative",
"integer",
"zero",
"or",
"a",
"positive",
"integer",
"as",
"this",
"object",
"s",
"eigenvalue",
"is",
"greater",
"than",
"equal",
"to",
"or",... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/EigenPair.java#L66-L75 | train | Compares two NVD EigenPairs. | Of course, here is the Java code you requested:
```java
@Override
public int compareTo(EigenPair o) {
if(this.eigenvalue < o.eigenvalue) {
return -1;
}
if(this.eigenvalue > o.eigenvalue) {
return +1;
}
return 0;
}
```
Hope this helps! |
oaqa/baseqa | src/main/java/edu/cmu/lti/oaqa/type/kb/Concept.java | Concept.getUris | public StringList getUris() {
if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_uris == null)
jcasType.jcas.throwFeatMissing("uris", "edu.cmu.lti.oaqa.type.kb.Concept");
return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Concept_Type)jcasType).casFeatCod... | java | public StringList getUris() {
if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_uris == null)
jcasType.jcas.throwFeatMissing("uris", "edu.cmu.lti.oaqa.type.kb.Concept");
return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Concept_Type)jcasType).casFeatCod... | [
"public",
"StringList",
"getUris",
"(",
")",
"{",
"if",
"(",
"Concept_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Concept_Type",
")",
"jcasType",
")",
".",
"casFeat_uris",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"uris\"",
... | getter for uris - gets Array of uris that identify this named entity. There may be more than one uri if this named entity is ambiguous.
@generated
@return value of the feature | [
"getter",
"for",
"uris",
"-",
"gets",
"Array",
"of",
"uris",
"that",
"identify",
"this",
"named",
"entity",
".",
"There",
"may",
"be",
"more",
"than",
"one",
"uri",
"if",
"this",
"named",
"entity",
"is",
"ambiguous",
"."
] | 6ea632d8e51e3e617d4876fc1185c49be0ad7eb8 | https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/kb/Concept.java#L98-L101 | test | getter for uris - gets | Of course, here is the Java code you requested:
```java
public StringList getUris() {
if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_uris == null)
jcasType.jcas.throwFeatMissing("uris", "edu.cmu.lti.oaqa.type.kb.Concept");
return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas... |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/perforce/AbstractPerforceManager.java | AbstractPerforceManager.edit | public void edit(int currentChangeListId, FilePath filePath) throws Exception {
establishConnection().editFile(currentChangeListId, new File(filePath.getRemote()));
} | java | public void edit(int currentChangeListId, FilePath filePath) throws Exception {
establishConnection().editFile(currentChangeListId, new File(filePath.getRemote()));
} | [
"public",
"void",
"edit",
"(",
"int",
"currentChangeListId",
",",
"FilePath",
"filePath",
")",
"throws",
"Exception",
"{",
"establishConnection",
"(",
")",
".",
"editFile",
"(",
"currentChangeListId",
",",
"new",
"File",
"(",
"filePath",
".",
"getRemote",
"(",
... | Opens file for editing.
@param currentChangeListId The current change list id to open the file for editing at
@param filePath The filePath which contains the file we need to edit
@throws IOException Thrown in case of perforce communication errors
@throws InterruptedException | [
"Opens",
"file",
"for",
"editing",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/perforce/AbstractPerforceManager.java#L98-L100 | train | Edit a file in the current change list. | Of course, here is the Java code you requested:
```java
public void edit(int currentChangeListId, FilePath filePath) throws Exception {
establishConnection().editFile(currentChangeListId, new File(filePath.getRemote()));
}
```
Hope this helps! |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/lang/DRL5Lexer.java | DRL5Lexer.mGREATER_EQUALS | public final void mGREATER_EQUALS() throws RecognitionException {
try {
int _type = GREATER_EQUALS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:218:5: ( '>=' )
// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:218:7: '>='
{
match(">="); i... | java | public final void mGREATER_EQUALS() throws RecognitionException {
try {
int _type = GREATER_EQUALS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:218:5: ( '>=' )
// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:218:7: '>='
{
match(">="); i... | [
"public",
"final",
"void",
"mGREATER_EQUALS",
"(",
")",
"throws",
"RecognitionException",
"{",
"try",
"{",
"int",
"_type",
"=",
"GREATER_EQUALS",
";",
"int",
"_channel",
"=",
"DEFAULT_TOKEN_CHANNEL",
";",
"// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:218:5: ( ... | $ANTLR start "GREATER_EQUALS" | [
"$ANTLR",
"start",
"GREATER_EQUALS"
] | 22b0275d6dbe93070b8090948502cf46eda543c4 | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/lang/DRL5Lexer.java#L2688-L2705 | train | start INSIDE INSIDE | Of course, here is the Java code you requested:
```java
public final void mGREATER_EQUALS() throws RecognitionException {
try {
int _type = GREATER_EQUALS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:218:5: ( '>=' )
// src/main/resources/org/drools/com... |
aws/aws-sdk-java | aws-java-sdk-directory/src/main/java/com/amazonaws/services/directory/model/DescribeDomainControllersRequest.java | DescribeDomainControllersRequest.withDomainControllerIds | public DescribeDomainControllersRequest withDomainControllerIds(String... domainControllerIds) {
if (this.domainControllerIds == null) {
setDomainControllerIds(new com.amazonaws.internal.SdkInternalList<String>(domainControllerIds.length));
}
for (String ele : domainControllerIds) {
... | java | public DescribeDomainControllersRequest withDomainControllerIds(String... domainControllerIds) {
if (this.domainControllerIds == null) {
setDomainControllerIds(new com.amazonaws.internal.SdkInternalList<String>(domainControllerIds.length));
}
for (String ele : domainControllerIds) {
... | [
"public",
"DescribeDomainControllersRequest",
"withDomainControllerIds",
"(",
"String",
"...",
"domainControllerIds",
")",
"{",
"if",
"(",
"this",
".",
"domainControllerIds",
"==",
"null",
")",
"{",
"setDomainControllerIds",
"(",
"new",
"com",
".",
"amazonaws",
".",
... | <p>
A list of identifiers for the domain controllers whose information will be provided.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setDomainControllerIds(java.util.Collection)} or {@link #withDomainControllerIds(java.util.Collection)}
if you want to override the exi... | [
"<p",
">",
"A",
"list",
"of",
"identifiers",
"for",
"the",
"domain",
"controllers",
"whose",
"information",
"will",
"be",
"provided",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-directory/src/main/java/com/amazonaws/services/directory/model/DescribeDomainControllersRequest.java#L142-L150 | train | Gets the value of the domainControllerIds property. | Of course, here is the Java code you requested:
```java
public DescribeDomainControllersRequest withDomainControllerIds(String... domainControllerIds) {
if (this.domainControllerIds == null) {
setDomainControllerIds(new com.amazonaws.internal.SdkInternalList<String>(domainControllerIds.length));
... |
googleapis/google-cloud-java | google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CreateDlpJobRequest.java | CreateDlpJobRequest.getInspectJob | public com.google.privacy.dlp.v2.InspectJobConfig getInspectJob() {
if (jobCase_ == 2) {
return (com.google.privacy.dlp.v2.InspectJobConfig) job_;
}
return com.google.privacy.dlp.v2.InspectJobConfig.getDefaultInstance();
} | java | public com.google.privacy.dlp.v2.InspectJobConfig getInspectJob() {
if (jobCase_ == 2) {
return (com.google.privacy.dlp.v2.InspectJobConfig) job_;
}
return com.google.privacy.dlp.v2.InspectJobConfig.getDefaultInstance();
} | [
"public",
"com",
".",
"google",
".",
"privacy",
".",
"dlp",
".",
"v2",
".",
"InspectJobConfig",
"getInspectJob",
"(",
")",
"{",
"if",
"(",
"jobCase_",
"==",
"2",
")",
"{",
"return",
"(",
"com",
".",
"google",
".",
"privacy",
".",
"dlp",
".",
"v2",
... | <code>.google.privacy.dlp.v2.InspectJobConfig inspect_job = 2;</code> | [
"<code",
">",
".",
"google",
".",
"privacy",
".",
"dlp",
".",
"v2",
".",
"InspectJobConfig",
"inspect_job",
"=",
"2",
";",
"<",
"/",
"code",
">"
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CreateDlpJobRequest.java#L225-L230 | train | Gets the value of the inspectJob property. | Of course, here is the Java code you requested:
```java
public com.google.privacy.dlp.v2.InspectJobConfig getInspectJob() {
if (jobCase_ == 2) {
return (com.google.privacy.dlp.v2.InspectJobConfig) job_;
}
return com.google.privacy.dlp.v2.InspectJobConfig.getDefaultInstance();
}
```
Hope this helps... |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.executeCompiledStatement | private Result executeCompiledStatement(Result cmd) {
Statement cs = cmd.getStatement();
if (!cs.isValid()) {
long csid = cmd.getStatementID();
cs = database.compiledStatementManager.getStatement(this, csid);
if (cs == null) {
// invalid sql has b... | java | private Result executeCompiledStatement(Result cmd) {
Statement cs = cmd.getStatement();
if (!cs.isValid()) {
long csid = cmd.getStatementID();
cs = database.compiledStatementManager.getStatement(this, csid);
if (cs == null) {
// invalid sql has b... | [
"private",
"Result",
"executeCompiledStatement",
"(",
"Result",
"cmd",
")",
"{",
"Statement",
"cs",
"=",
"cmd",
".",
"getStatement",
"(",
")",
";",
"if",
"(",
"!",
"cs",
".",
"isValid",
"(",
")",
")",
"{",
"long",
"csid",
"=",
"cmd",
".",
"getStatement... | Retrieves the result of executing the prepared statement whose csid
and parameter values/types are encapsulated by the cmd argument.
@return the result of executing the statement | [
"Retrieves",
"the",
"result",
"of",
"executing",
"the",
"prepared",
"statement",
"whose",
"csid",
"and",
"parameter",
"values",
"/",
"types",
"are",
"encapsulated",
"by",
"the",
"cmd",
"argument",
"."
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L1392-L1411 | train | Execute a SQL statement. | Of course, here is the Java code you requested:
```java
private Result executeCompiledStatement(Result cmd) {
Statement cs = cmd.getStatement();
if (!cs.isValid()) {
long csid = cmd.getStatementID();
cs = database.compiledStatementManager.getStatement(this, csid);
... |
airlift/slice | src/main/java/io/airlift/slice/SliceUtf8.java | SliceUtf8.rightTrim | public static Slice rightTrim(Slice utf8)
{
int position = lastNonWhitespacePosition(utf8, 0);
return utf8.slice(0, position);
} | java | public static Slice rightTrim(Slice utf8)
{
int position = lastNonWhitespacePosition(utf8, 0);
return utf8.slice(0, position);
} | [
"public",
"static",
"Slice",
"rightTrim",
"(",
"Slice",
"utf8",
")",
"{",
"int",
"position",
"=",
"lastNonWhitespacePosition",
"(",
"utf8",
",",
"0",
")",
";",
"return",
"utf8",
".",
"slice",
"(",
"0",
",",
"position",
")",
";",
"}"
] | Removes all white space characters from the right side of the string.
<p>
Note: Invalid UTF-8 sequences are not trimmed. | [
"Removes",
"all",
"white",
"space",
"characters",
"from",
"the",
"right",
"side",
"of",
"the",
"string",
".",
"<p",
">",
"Note",
":",
"Invalid",
"UTF",
"-",
"8",
"sequences",
"are",
"not",
"trimmed",
"."
] | 7166cb0319e3655f8ba15f5a7ccf3d2f721c1242 | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/SliceUtf8.java#L450-L454 | train | Returns a slice of the specified UTF - 8 string that is the last non - whitespace character in the specified UTF - 8 sequence. | Of course, here is the Java code you requested:
```java
public static Slice rightTrim(Slice utf8)
{
int position = lastNonWhitespacePosition(utf8, 0);
return utf8.slice(0, position);
}
```
Hope this helps! |
mozilla/rhino | src/org/mozilla/javascript/optimizer/Block.java | Block.doReachedUseDataFlow | private boolean doReachedUseDataFlow()
{
itsLiveOnExitSet.clear();
if (itsSuccessors != null) {
for (int i = 0; i < itsSuccessors.length; i++) {
itsLiveOnExitSet.or(itsSuccessors[i].itsLiveOnEntrySet);
}
}
return updateEntrySet(itsLiveOnEntrySe... | java | private boolean doReachedUseDataFlow()
{
itsLiveOnExitSet.clear();
if (itsSuccessors != null) {
for (int i = 0; i < itsSuccessors.length; i++) {
itsLiveOnExitSet.or(itsSuccessors[i].itsLiveOnEntrySet);
}
}
return updateEntrySet(itsLiveOnEntrySe... | [
"private",
"boolean",
"doReachedUseDataFlow",
"(",
")",
"{",
"itsLiveOnExitSet",
".",
"clear",
"(",
")",
";",
"if",
"(",
"itsSuccessors",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"itsSuccessors",
".",
"length",
";",
"i",... | /*
the liveOnEntry of each successor is the liveOnExit for this block.
The liveOnEntry for this block is -
liveOnEntry = liveOnExit - defsInThisBlock + useBeforeDefsInThisBlock | [
"/",
"*",
"the",
"liveOnEntry",
"of",
"each",
"successor",
"is",
"the",
"liveOnExit",
"for",
"this",
"block",
".",
"The",
"liveOnEntry",
"for",
"this",
"block",
"is",
"-",
"liveOnEntry",
"=",
"liveOnExit",
"-",
"defsInThisBlock",
"+",
"useBeforeDefsInThisBlock"
... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/Block.java#L434-L444 | train | Do reached use data flow. | Of course, here is the Java code you requested:
```java
private boolean doReachedUseDataFlow()
{
itsLiveOnExitSet.clear();
if (itsSuccessors != null) {
for (int i = 0; i < itsSuccessors.length; i++) {
itsLiveOnExitSet.or(itsSuccessors[i].itsLiveOnEntrySet);
}... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashBucketArea.java | BinaryHashBucketArea.startLookup | void startLookup(int hashCode) {
final int posHashCode = findBucket(hashCode);
// get the bucket for the given hash code
final int bucketArrayPos = posHashCode >> table.bucketsPerSegmentBits;
final int bucketInSegmentOffset = (posHashCode & table.bucketsPerSegmentMask) << BUCKET_SIZE_BITS;
final MemorySegmen... | java | void startLookup(int hashCode) {
final int posHashCode = findBucket(hashCode);
// get the bucket for the given hash code
final int bucketArrayPos = posHashCode >> table.bucketsPerSegmentBits;
final int bucketInSegmentOffset = (posHashCode & table.bucketsPerSegmentMask) << BUCKET_SIZE_BITS;
final MemorySegmen... | [
"void",
"startLookup",
"(",
"int",
"hashCode",
")",
"{",
"final",
"int",
"posHashCode",
"=",
"findBucket",
"(",
"hashCode",
")",
";",
"// get the bucket for the given hash code",
"final",
"int",
"bucketArrayPos",
"=",
"posHashCode",
">>",
"table",
".",
"bucketsPerSe... | Probe start lookup joined build rows. | [
"Probe",
"start",
"lookup",
"joined",
"build",
"rows",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashBucketArea.java#L528-L536 | train | Start lookup of the given hash code. | Of course, here is the Java code you requested:
```java
void startLookup(int hashCode) {
final int posHashCode = findBucket(hashCode);
// get the bucket for the given hash code
final int bucketArrayPos = posHashCode >> table.bucketsPerSegmentBits;
final int bucketInSegmentOffset = (posHashCode & table.buckets... |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newAssertionException | public static AssertionException newAssertionException(String message, Object... args) {
return newAssertionException(null, message, args);
} | java | public static AssertionException newAssertionException(String message, Object... args) {
return newAssertionException(null, message, args);
} | [
"public",
"static",
"AssertionException",
"newAssertionException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newAssertionException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link AssertionException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link AssertionException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@l... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"AssertionException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | f2163c149fbbef05015e688132064ebcac7c49ab | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L243-L245 | train | Creates an AssertionException with the specified message and arguments. | Of course, here is the Java code you requested:
```java
public static AssertionException newAssertionException(String message, Object... args) {
return newAssertionException(null, message, args);
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java | PubSubRealization.getControlHandler | public ControlHandler getControlHandler(
SIBUuid8 sourceMEUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"getControlHandler",
new Object[... | java | public ControlHandler getControlHandler(
SIBUuid8 sourceMEUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"getControlHandler",
new Object[... | [
"public",
"ControlHandler",
"getControlHandler",
"(",
"SIBUuid8",
"sourceMEUuid",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getContro... | _preMediationInputHandler | [
"_preMediationInputHandler"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java#L481-L497 | train | Get the ControlHandler for a given source MEUuid | Of course, here is the Java code you requested:
```java
public ControlHandler getControlHandler(
SIBUuid8 sourceMEUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
... |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/device_profile.java | device_profile.add | public static device_profile add(nitro_service client, device_profile resource) throws Exception
{
resource.validate("add");
return ((device_profile[]) resource.perform_operation(client, "add"))[0];
} | java | public static device_profile add(nitro_service client, device_profile resource) throws Exception
{
resource.validate("add");
return ((device_profile[]) resource.perform_operation(client, "add"))[0];
} | [
"public",
"static",
"device_profile",
"add",
"(",
"nitro_service",
"client",
",",
"device_profile",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"add\"",
")",
";",
"return",
"(",
"(",
"device_profile",
"[",
"]",
")",
"resour... | <pre>
Use this operation to add device profile.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"add",
"device",
"profile",
".",
"<",
"/",
"pre",
">"
] | c840919f1a8f7c0a5634c0f23d34fa14d1765ff1 | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/device_profile.java#L349-L353 | train | Use this API to add device_profile. | Of course, here is the Java code you requested:
```java
public static device_profile add(nitro_service client, device_profile resource) throws Exception
{
resource.validate("add");
return ((device_profile[]) resource.perform_operation(client, "add"))[0];
}
```
Hope this helps! |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java | PackageManagerUtils.hasFrontCameraFeature | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static boolean hasFrontCameraFeature(PackageManager manager) {
return manager.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
} | java | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static boolean hasFrontCameraFeature(PackageManager manager) {
return manager.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
} | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"GINGERBREAD",
")",
"public",
"static",
"boolean",
"hasFrontCameraFeature",
"(",
"PackageManager",
"manager",
")",
"{",
"return",
"manager",
".",
"hasSystemFeature",
"(",
"PackageManager",
".",
"FEATURE_CAME... | Checks if the device has a front camera.
@param manager the package manager.
@return {@code true} if the device has a front camera. | [
"Checks",
"if",
"the",
"device",
"has",
"a",
"front",
"camera",
"."
] | 57809ddbfe7897e979cf507982ce0b3aa5e0ed8a | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java#L416-L419 | train | Checks if the device has the CAMERA_FRONT camera feature. | Of course, here is the Java code you requested:
```java
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static boolean hasFrontCameraFeature(PackageManager manager) {
return manager.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
}
```
Hope this helps! |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.getInvalidDataValue | public String getInvalidDataValue() {
final JavascriptVarBuilder vb = new JavascriptVarBuilder(null, true);
for (final SheetInvalidUpdate sheetInvalidUpdate : getInvalidUpdates()) {
final Object rowKey = sheetInvalidUpdate.getInvalidRowKey();
final int col = getRenderIndexFromRea... | java | public String getInvalidDataValue() {
final JavascriptVarBuilder vb = new JavascriptVarBuilder(null, true);
for (final SheetInvalidUpdate sheetInvalidUpdate : getInvalidUpdates()) {
final Object rowKey = sheetInvalidUpdate.getInvalidRowKey();
final int col = getRenderIndexFromRea... | [
"public",
"String",
"getInvalidDataValue",
"(",
")",
"{",
"final",
"JavascriptVarBuilder",
"vb",
"=",
"new",
"JavascriptVarBuilder",
"(",
"null",
",",
"true",
")",
";",
"for",
"(",
"final",
"SheetInvalidUpdate",
"sheetInvalidUpdate",
":",
"getInvalidUpdates",
"(",
... | Generates the bad data var value for this sheet.
@return | [
"Generates",
"the",
"bad",
"data",
"var",
"value",
"for",
"this",
"sheet",
"."
] | afdbca591f60f47898e3517e1e939bc2f63d5355 | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L1029-L1039 | train | Get the invalid data value. | Of course, here is the Java code you requested:
```java
public String getInvalidDataValue() {
final JavascriptVarBuilder vb = new JavascriptVarBuilder(null, true);
for (final SheetInvalidUpdate sheetInvalidUpdate : getInvalidUpdates()) {
final Object rowKey = sheetInvalidUpdate.getInvalidRo... |
strator-dev/greenpepper | greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/domain/dao/hibernate/HibernateProjectDao.java | HibernateProjectDao.create | public Project create(String name)
throws GreenPepperServerException {
if (getByName(name) != null)
{
throw new GreenPepperServerException( GreenPepperServerErrorKey.PROJECT_ALREADY_EXISTS,
"Project already exists");
}
Project project = Project.newInstance(name);
sessionService.getSessio... | java | public Project create(String name)
throws GreenPepperServerException {
if (getByName(name) != null)
{
throw new GreenPepperServerException( GreenPepperServerErrorKey.PROJECT_ALREADY_EXISTS,
"Project already exists");
}
Project project = Project.newInstance(name);
sessionService.getSessio... | [
"public",
"Project",
"create",
"(",
"String",
"name",
")",
"throws",
"GreenPepperServerException",
"{",
"if",
"(",
"getByName",
"(",
"name",
")",
"!=",
"null",
")",
"{",
"throw",
"new",
"GreenPepperServerException",
"(",
"GreenPepperServerErrorKey",
".",
"PROJECT_... | {@inheritDoc} | [
"{"
] | 2a61e6c179b74085babcc559d677490b0cad2d30 | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/domain/dao/hibernate/HibernateProjectDao.java#L61-L73 | train | Creates a new project. | Of course, here is the Java code you requested:
```java
public Project create(String name)
throws GreenPepperServerException {
if (getByName(name) != null)
{
throw new GreenPepperServerException( GreenPepperServerErrorKey.PROJECT_ALREADY_EXISTS,
"Project already exists");
}
Project projec... |
aws/aws-sdk-java | aws-java-sdk-backup/src/main/java/com/amazonaws/services/backup/model/transform/PutBackupVaultNotificationsRequestMarshaller.java | PutBackupVaultNotificationsRequestMarshaller.marshall | public void marshall(PutBackupVaultNotificationsRequest putBackupVaultNotificationsRequest, ProtocolMarshaller protocolMarshaller) {
if (putBackupVaultNotificationsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | java | public void marshall(PutBackupVaultNotificationsRequest putBackupVaultNotificationsRequest, ProtocolMarshaller protocolMarshaller) {
if (putBackupVaultNotificationsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | [
"public",
"void",
"marshall",
"(",
"PutBackupVaultNotificationsRequest",
"putBackupVaultNotificationsRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"putBackupVaultNotificationsRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientExcepti... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-backup/src/main/java/com/amazonaws/services/backup/model/transform/PutBackupVaultNotificationsRequestMarshaller.java#L47-L60 | train | marshalls the given PutBackupVaultNotificationsRequest to the given protocolMarshaller. | Of course, here is the Java code you requested:
```java
public void marshall(PutBackupVaultNotificationsRequest putBackupVaultNotificationsRequest, ProtocolMarshaller protocolMarshaller) {
if (putBackupVaultNotificationsRequest == null) {
throw new SdkClientException("Invalid argument passed to ma... |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/jsl/CloneUtility.java | CloneUtility.jslPropertiesToJavaProperties | public static Properties jslPropertiesToJavaProperties(
final JSLProperties xmlProperties) {
final Properties props = new Properties();
for (final Property prop : xmlProperties.getPropertyList()) {
props.setProperty(prop.getName(), prop.getValue());
}
return pr... | java | public static Properties jslPropertiesToJavaProperties(
final JSLProperties xmlProperties) {
final Properties props = new Properties();
for (final Property prop : xmlProperties.getPropertyList()) {
props.setProperty(prop.getName(), prop.getValue());
}
return pr... | [
"public",
"static",
"Properties",
"jslPropertiesToJavaProperties",
"(",
"final",
"JSLProperties",
"xmlProperties",
")",
"{",
"final",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"final",
"Property",
"prop",
":",
"xmlProperties",
"."... | Creates a java.util.Properties map from a com.ibm.jbatch.jsl.model.Properties
object.
@param xmlProperties
@return | [
"Creates",
"a",
"java",
".",
"util",
".",
"Properties",
"map",
"from",
"a",
"com",
".",
"ibm",
".",
"jbatch",
".",
"jsl",
".",
"model",
".",
"Properties",
"object",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/jsl/CloneUtility.java#L257-L268 | train | Convert a JSLProperties object to a Java Properties object. | Of course, here is the Java code you requested:
```java
public static Properties jslPropertiesToJavaProperties(
final JSLProperties xmlProperties) {
final Properties props = new Properties();
for (final Property prop : xmlProperties.getPropertyList()) {
props.setProperty(prop.... |
Erudika/para | para-core/src/main/java/com/erudika/para/validation/Constraint.java | Constraint.future | public static Constraint future() {
return new Constraint("future", simplePayload("future")) {
public boolean isValid(Object actualValue) {
if (actualValue != null) {
long now = System.currentTimeMillis();
if ((actualValue instanceof Date && ((Date) actualValue).getTime() <= now)
|| (actualVal... | java | public static Constraint future() {
return new Constraint("future", simplePayload("future")) {
public boolean isValid(Object actualValue) {
if (actualValue != null) {
long now = System.currentTimeMillis();
if ((actualValue instanceof Date && ((Date) actualValue).getTime() <= now)
|| (actualVal... | [
"public",
"static",
"Constraint",
"future",
"(",
")",
"{",
"return",
"new",
"Constraint",
"(",
"\"future\"",
",",
"simplePayload",
"(",
"\"future\"",
")",
")",
"{",
"public",
"boolean",
"isValid",
"(",
"Object",
"actualValue",
")",
"{",
"if",
"(",
"actualVal... | The 'future' constraint - field value must be a {@link Date} or a timestamp in the future.
@return constraint | [
"The",
"future",
"constraint",
"-",
"field",
"value",
"must",
"be",
"a",
"{"
] | 5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9 | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/validation/Constraint.java#L470-L483 | train | A constraint that only accepts the future values. | Of course, here is the Java code you requested:
```java
public static Constraint future() {
return new Constraint("future", simplePayload("future")) {
public boolean isValid(Object actualValue) {
if (actualValue != null) {
long now = System.currentTimeMillis();
if ((actualValue instanceof Date && ((... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java | Execution.triggerSynchronousSavepoint | public void triggerSynchronousSavepoint(long checkpointId, long timestamp, CheckpointOptions checkpointOptions, boolean advanceToEndOfEventTime) {
triggerCheckpointHelper(checkpointId, timestamp, checkpointOptions, advanceToEndOfEventTime);
} | java | public void triggerSynchronousSavepoint(long checkpointId, long timestamp, CheckpointOptions checkpointOptions, boolean advanceToEndOfEventTime) {
triggerCheckpointHelper(checkpointId, timestamp, checkpointOptions, advanceToEndOfEventTime);
} | [
"public",
"void",
"triggerSynchronousSavepoint",
"(",
"long",
"checkpointId",
",",
"long",
"timestamp",
",",
"CheckpointOptions",
"checkpointOptions",
",",
"boolean",
"advanceToEndOfEventTime",
")",
"{",
"triggerCheckpointHelper",
"(",
"checkpointId",
",",
"timestamp",
",... | Trigger a new checkpoint on the task of this execution.
@param checkpointId of th checkpoint to trigger
@param timestamp of the checkpoint to trigger
@param checkpointOptions of the checkpoint to trigger
@param advanceToEndOfEventTime Flag indicating if the source should inject a {@code MAX_WATERMARK} in the pipeline
... | [
"Trigger",
"a",
"new",
"checkpoint",
"on",
"the",
"task",
"of",
"this",
"execution",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L881-L883 | train | Trigger a synchronous savepoint. | Of course, here is the Java code you requested:
```java
public void triggerSynchronousSavepoint(long checkpointId, long timestamp, CheckpointOptions checkpointOptions, boolean advanceToEndOfEventTime) {
triggerCheckpointHelper(checkpointId, timestamp, checkpointOptions, advanceToEndOfEventTime);
}
```
Hope this he... |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/operators/LatchedObserver.java | LatchedObserver.create | public static <T> LatchedObserver<T> create(Action1<? super T> onNext, CountDownLatch latch) {
return new LatchedObserverImpl<T>(onNext, Functionals.emptyThrowable(), Functionals.empty(), latch);
} | java | public static <T> LatchedObserver<T> create(Action1<? super T> onNext, CountDownLatch latch) {
return new LatchedObserverImpl<T>(onNext, Functionals.emptyThrowable(), Functionals.empty(), latch);
} | [
"public",
"static",
"<",
"T",
">",
"LatchedObserver",
"<",
"T",
">",
"create",
"(",
"Action1",
"<",
"?",
"super",
"T",
">",
"onNext",
",",
"CountDownLatch",
"latch",
")",
"{",
"return",
"new",
"LatchedObserverImpl",
"<",
"T",
">",
"(",
"onNext",
",",
"... | Create a LatchedObserver with the given callback function(s) and a shared latch. | [
"Create",
"a",
"LatchedObserver",
"with",
"the",
"given",
"callback",
"function",
"(",
"s",
")",
"and",
"a",
"shared",
"latch",
"."
] | 6294e1da30e639df79f76399906229314c14e74d | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/operators/LatchedObserver.java#L144-L146 | train | Create a new latched observer. | Of course, here is the Java code you requested:
```java
public static <T> LatchedObserver<T> create(Action1<? super T> onNext, CountDownLatch latch) {
return new LatchedObserverImpl<T>(onNext, Functionals.emptyThrowable(), Functionals.empty(), latch);
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/SingletonBeanO.java | SingletonBeanO.setRollbackOnly | @Override
public void setRollbackOnly() {
if (ivBMT) {
throw new IllegalStateException("getRollbackOnly not allowed for bean managed transaction.");
} else if (state > PRE_CREATE) {
// We must be in PostConstruct, method ready, or PreDestroy state.
// Have the sup... | java | @Override
public void setRollbackOnly() {
if (ivBMT) {
throw new IllegalStateException("getRollbackOnly not allowed for bean managed transaction.");
} else if (state > PRE_CREATE) {
// We must be in PostConstruct, method ready, or PreDestroy state.
// Have the sup... | [
"@",
"Override",
"public",
"void",
"setRollbackOnly",
"(",
")",
"{",
"if",
"(",
"ivBMT",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"getRollbackOnly not allowed for bean managed transaction.\"",
")",
";",
"}",
"else",
"if",
"(",
"state",
">",
"PRE_C... | For Singleton objects, setRollbackOnly is allowed once we are past
dependency injection (PRE_CREATE state) and there is a valid TX context
(e.g. the method being invoked has one of NotSupported, Supports or
Never as its transaction attribute).
@see com.ibm.ejs.container.BeanO#setRollbackOnly() | [
"For",
"Singleton",
"objects",
"setRollbackOnly",
"is",
"allowed",
"once",
"we",
"are",
"past",
"dependency",
"injection",
"(",
"PRE_CREATE",
"state",
")",
"and",
"there",
"is",
"a",
"valid",
"TX",
"context",
"(",
"e",
".",
"g",
".",
"the",
"method",
"bein... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/SingletonBeanO.java#L606-L619 | train | Override this method to set the rollbackOnly attribute of the transaction. | Of course, here is the Java code you requested:
```java
@Override
public void setRollbackOnly() {
if (ivBMT) {
throw new IllegalStateException("getRollbackOnly not allowed for bean managed transaction.");
} else if (state > PRE_CREATE) {
// We must be in PostConstruct, metho... |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/Job.java | Job.getCounters | public Counters getCounters() throws IOException {
ensureState(JobState.RUNNING);
org.apache.hadoop.mapred.Counters ctrs = info.getCounters();
if (ctrs == null) {
return null;
} else {
return new Counters(ctrs);
}
} | java | public Counters getCounters() throws IOException {
ensureState(JobState.RUNNING);
org.apache.hadoop.mapred.Counters ctrs = info.getCounters();
if (ctrs == null) {
return null;
} else {
return new Counters(ctrs);
}
} | [
"public",
"Counters",
"getCounters",
"(",
")",
"throws",
"IOException",
"{",
"ensureState",
"(",
"JobState",
".",
"RUNNING",
")",
";",
"org",
".",
"apache",
".",
"hadoop",
".",
"mapred",
".",
"Counters",
"ctrs",
"=",
"info",
".",
"getCounters",
"(",
")",
... | Gets the counters for this job.
@return the counters for this job.
@throws IOException | [
"Gets",
"the",
"counters",
"for",
"this",
"job",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/Job.java#L390-L398 | train | Get the Counters object from the mapred job. | Of course, here is the Java code you requested:
```java
public Counters getCounters() throws IOException {
ensureState(JobState.RUNNING);
org.apache.hadoop.mapred.Counters ctrs = info.getCounters();
if (ctrs == null) {
return null;
} else {
return new Counters(ctrs);
}
}
```
Hope thi... |
itfsw/mybatis-generator-plugin | src/main/java/com/itfsw/mybatis/generator/plugins/utils/XmlElementGeneratorTools.java | XmlElementGeneratorTools.generateLogicalDeleteColumnValue | public static String generateLogicalDeleteColumnValue(IntrospectedColumn logicalDeleteColumn, String value) {
StringBuilder sb = new StringBuilder();
// 判断字段类型
if (value == null || "NULL".equalsIgnoreCase(value)) {
sb.append("NULL");
} else if (logicalDeleteColumn.isStringCol... | java | public static String generateLogicalDeleteColumnValue(IntrospectedColumn logicalDeleteColumn, String value) {
StringBuilder sb = new StringBuilder();
// 判断字段类型
if (value == null || "NULL".equalsIgnoreCase(value)) {
sb.append("NULL");
} else if (logicalDeleteColumn.isStringCol... | [
"public",
"static",
"String",
"generateLogicalDeleteColumnValue",
"(",
"IntrospectedColumn",
"logicalDeleteColumn",
",",
"String",
"value",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// 判断字段类型",
"if",
"(",
"value",
"==",
"null",
... | 生成逻辑删除列的删除值
@param logicalDeleteColumn
@param value
@return | [
"生成逻辑删除列的删除值"
] | c2746d9567952cabe0eed8c533beb8c1a8bc1dce | https://github.com/itfsw/mybatis-generator-plugin/blob/c2746d9567952cabe0eed8c533beb8c1a8bc1dce/src/main/java/com/itfsw/mybatis/generator/plugins/utils/XmlElementGeneratorTools.java#L567-L584 | valid | Generate logical delete column value. | Of course, here is the Java code you requested:
```java
public static String generateLogicalDeleteColumnValue(IntrospectedColumn logicalDeleteColumn, String value) {
StringBuilder sb = new StringBuilder();
// 判断字段类型
if (value == null || "NULL".equalsIgnoreCase(value)) {
sb.append("N... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/watch/watchers/DelayWatcher.java | DelayWatcher.startHandleModifyThread | private void startHandleModifyThread(final WatchEvent<?> event, final Path currentPath) {
ThreadUtil.execute(new Runnable(){
@Override
public void run() {
ThreadUtil.sleep(delay);
eventSet.remove(Paths.get(currentPath.toString(), event.context().toString()));
watcher.onModify(event, currentPat... | java | private void startHandleModifyThread(final WatchEvent<?> event, final Path currentPath) {
ThreadUtil.execute(new Runnable(){
@Override
public void run() {
ThreadUtil.sleep(delay);
eventSet.remove(Paths.get(currentPath.toString(), event.context().toString()));
watcher.onModify(event, currentPat... | [
"private",
"void",
"startHandleModifyThread",
"(",
"final",
"WatchEvent",
"<",
"?",
">",
"event",
",",
"final",
"Path",
"currentPath",
")",
"{",
"ThreadUtil",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
... | 开启处理线程
@param event 事件
@param currentPath 事件发生的当前Path路径 | [
"开启处理线程"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/watch/watchers/DelayWatcher.java#L97-L106 | train | Start handle modify thread. | Of course, here is the Java code you requested:
```java
private void startHandleModifyThread(final WatchEvent<?> event, final Path currentPath) {
ThreadUtil.execute(new Runnable(){
@Override
public void run() {
ThreadUtil.sleep(delay);
eventSet.remove(Paths.get(currentPath.toString(), event.contex... |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.deleteRange | @SuppressWarnings("unchecked")
public static <T> boolean deleteRange(final List<T> c, final int fromIndex, final int toIndex) {
N.checkFromToIndex(fromIndex, toIndex, c.size());
if (fromIndex == toIndex) {
return false;
}
if (c instanceof LinkedList || toIndex -... | java | @SuppressWarnings("unchecked")
public static <T> boolean deleteRange(final List<T> c, final int fromIndex, final int toIndex) {
N.checkFromToIndex(fromIndex, toIndex, c.size());
if (fromIndex == toIndex) {
return false;
}
if (c instanceof LinkedList || toIndex -... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"boolean",
"deleteRange",
"(",
"final",
"List",
"<",
"T",
">",
"c",
",",
"final",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
")",
"{",
"N",
".",
"checkFromToI... | Returns {@code true} if the {@code List} is updated when {@code fromIndex < toIndex}, otherwise {@code false} is returned when {@code fromIndex == toIndex}.
@param c
@param fromIndex
@param toIndex
@return | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"{",
"@code",
"List",
"}",
"is",
"updated",
"when",
"{",
"@code",
"fromIndex",
"<",
"toIndex",
"}",
"otherwise",
"{",
"@code",
"false",
"}",
"is",
"returned",
"when",
"{",
"@code",
"fromIndex",
"==",
"... | 544b7720175d15e9329f83dd22a8cc5fa4515e12 | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L22731-L22774 | train | Deletes the elements in a list from a given index to a given index. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <T> boolean deleteRange(final List<T> c, final int fromIndex, final int toIndex) {
N.checkFromToIndex(fromIndex, toIndex, c.size());
if (fromIndex == toIndex) {
return false;
... |
eclipse/hawkbit | hawkbit-http-security/src/main/java/org/eclipse/hawkbit/security/AbstractHttpControllerAuthenticationFilter.java | AbstractHttpControllerAuthenticationFilter.createTenantSecruityTokenVariables | protected DmfTenantSecurityToken createTenantSecruityTokenVariables(final HttpServletRequest request) {
final String requestURI = request.getRequestURI();
if (pathExtractor.match(request.getContextPath() + CONTROLLER_REQUEST_ANT_PATTERN, requestURI)) {
LOG.debug("retrieving principal from U... | java | protected DmfTenantSecurityToken createTenantSecruityTokenVariables(final HttpServletRequest request) {
final String requestURI = request.getRequestURI();
if (pathExtractor.match(request.getContextPath() + CONTROLLER_REQUEST_ANT_PATTERN, requestURI)) {
LOG.debug("retrieving principal from U... | [
"protected",
"DmfTenantSecurityToken",
"createTenantSecruityTokenVariables",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"final",
"String",
"requestURI",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"if",
"(",
"pathExtractor",
".",
"match",
"(",
... | Extracts tenant and controllerId from the request URI as path variables.
@param request
the Http request to extract the path variables.
@return the extracted {@link PathVariables} or {@code null} if the
request does not match the pattern and no variables could be
extracted | [
"Extracts",
"tenant",
"and",
"controllerId",
"from",
"the",
"request",
"URI",
"as",
"path",
"variables",
"."
] | 9884452ad42f3b4827461606d8a9215c8625a7fe | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-http-security/src/main/java/org/eclipse/hawkbit/security/AbstractHttpControllerAuthenticationFilter.java#L134-L164 | train | Create tenant secruity token variables. | Of course, here is the Java code you requested:
```java
protected DmfTenantSecurityToken createTenantSecruityTokenVariables(final HttpServletRequest request) {
final String requestURI = request.getRequestURI();
if (pathExtractor.match(request.getContextPath() + CONTROLLER_REQUEST_ANT_PATTERN, requestU... |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/MetricsServlet.java | MetricsServlet.printMap | void printMap(PrintWriter out, Map<String, Map<String, List<TagsMetricsPair>>> map) {
for (Map.Entry<String, Map<String, List<TagsMetricsPair>>> context : map.entrySet()) {
out.println(context.getKey());
for (Map.Entry<String, List<TagsMetricsPair>> record : context.getValue().entrySet()) {
inde... | java | void printMap(PrintWriter out, Map<String, Map<String, List<TagsMetricsPair>>> map) {
for (Map.Entry<String, Map<String, List<TagsMetricsPair>>> context : map.entrySet()) {
out.println(context.getKey());
for (Map.Entry<String, List<TagsMetricsPair>> record : context.getValue().entrySet()) {
inde... | [
"void",
"printMap",
"(",
"PrintWriter",
"out",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"TagsMetricsPair",
">",
">",
">",
"map",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Map",
"<",
"String",
","... | Prints metrics data in a multi-line text form. | [
"Prints",
"metrics",
"data",
"in",
"a",
"multi",
"-",
"line",
"text",
"form",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/MetricsServlet.java#L119-L153 | train | Print map. | Of course, here is the Java code you requested:
```java
void printMap(PrintWriter out, Map<String, Map<String, List<TagsMetricsPair>>> map) {
for (Map.Entry<String, Map<String, List<TagsMetricsPair>>> context : map.entrySet()) {
out.println(context.getKey());
for (Map.Entry<String, List<TagsMetricsPair... |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/RouteUtils.java | RouteUtils.getPath | public static String getPath(Controller controller) {
Path path = controller.getClass().getAnnotation(Path.class);
if (path == null) {
return EMPTY_PREFIX;
} else {
return path.value();
}
} | java | public static String getPath(Controller controller) {
Path path = controller.getClass().getAnnotation(Path.class);
if (path == null) {
return EMPTY_PREFIX;
} else {
return path.value();
}
} | [
"public",
"static",
"String",
"getPath",
"(",
"Controller",
"controller",
")",
"{",
"Path",
"path",
"=",
"controller",
".",
"getClass",
"(",
")",
".",
"getAnnotation",
"(",
"Path",
".",
"class",
")",
";",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"ret... | Gets the 'path' value of the given controller. If the controller does not use the {@link org.wisdom.api
.annotations.Path} annotation, and empty prefix is returned.
@param controller the controller
@return the prefix coming either empty or the value of the Path annotation | [
"Gets",
"the",
"path",
"value",
"of",
"the",
"given",
"controller",
".",
"If",
"the",
"controller",
"does",
"not",
"use",
"the",
"{",
"@link",
"org",
".",
"wisdom",
".",
"api",
".",
"annotations",
".",
"Path",
"}",
"annotation",
"and",
"empty",
"prefix",... | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/RouteUtils.java#L250-L257 | train | Gets the path from the controller. | Of course, here is the Java code you requested:
```java
public static String getPath(Controller controller) {
Path path = controller.getClass().getAnnotation(Path.class);
if (path == null) {
return EMPTY_PREFIX;
} else {
return path.value();
}
}
```
Hope thi... |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java | AfplibFactoryImpl.createFNCPatTechFromString | public FNCPatTech createFNCPatTechFromString(EDataType eDataType, String initialValue) {
FNCPatTech result = FNCPatTech.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} | java | public FNCPatTech createFNCPatTechFromString(EDataType eDataType, String initialValue) {
FNCPatTech result = FNCPatTech.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} | [
"public",
"FNCPatTech",
"createFNCPatTechFromString",
"(",
"EDataType",
"eDataType",
",",
"String",
"initialValue",
")",
"{",
"FNCPatTech",
"result",
"=",
"FNCPatTech",
".",
"get",
"(",
"initialValue",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"throw",
... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L4948-L4952 | train | Create a FNCPatTech object from a String value. | Of course, here is the Java code you requested:
```java
public FNCPatTech createFNCPatTechFromString(EDataType eDataType, String initialValue) {
FNCPatTech result = FNCPatTech.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '"... |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java | OutlookMessageParser.analyzeDocumentEntry | private OutlookFieldInformation analyzeDocumentEntry(final DocumentEntry de) {
final String name = de.getName();
// we are only interested in document entries
// with names starting with __substg1.
LOGGER.trace("Document entry: {}", name);
if (name.startsWith(PROPERTY_STREAM_PREFIX)) {
final String clazz;
... | java | private OutlookFieldInformation analyzeDocumentEntry(final DocumentEntry de) {
final String name = de.getName();
// we are only interested in document entries
// with names starting with __substg1.
LOGGER.trace("Document entry: {}", name);
if (name.startsWith(PROPERTY_STREAM_PREFIX)) {
final String clazz;
... | [
"private",
"OutlookFieldInformation",
"analyzeDocumentEntry",
"(",
"final",
"DocumentEntry",
"de",
")",
"{",
"final",
"String",
"name",
"=",
"de",
".",
"getName",
"(",
")",
";",
"// we are only interested in document entries",
"// with names starting with __substg1.",
"LOGG... | Analyzes the {@link DocumentEntry} and returns
a {@link OutlookFieldInformation} object containing the
class (the field name, so to say) and type of
the entry.
@param de The {@link DocumentEntry} that should be examined.
@return A {@link OutlookFieldInformation} object containing class and type of the document entry o... | [
"Analyzes",
"the",
"{",
"@link",
"DocumentEntry",
"}",
"and",
"returns",
"a",
"{",
"@link",
"OutlookFieldInformation",
"}",
"object",
"containing",
"the",
"class",
"(",
"the",
"field",
"name",
"so",
"to",
"say",
")",
"and",
"type",
"of",
"the",
"entry",
".... | ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e | https://github.com/bbottema/outlook-message-parser/blob/ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e/src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java#L520-L550 | train | Analyze a document entry. | Of course, here is the Java code you requested:
```java
private OutlookFieldInformation analyzeDocumentEntry(final DocumentEntry de) {
final String name = de.getName();
// we are only interested in document entries
// with names starting with __substg1.
LOGGER.trace("Document entry: {}", name);
if (name.star... |
wisdom-framework/wisdom | core/router/src/main/java/org/wisdom/router/parameter/Bindings.java | Bindings.create | public static Object create(ActionParameter argument, Context context,
ParameterFactories engine) {
RouteParameterHandler handler = BINDINGS.get(argument.getSource());
if (handler != null) {
return handler.create(argument, context, engine);
} else {
... | java | public static Object create(ActionParameter argument, Context context,
ParameterFactories engine) {
RouteParameterHandler handler = BINDINGS.get(argument.getSource());
if (handler != null) {
return handler.create(argument, context, engine);
} else {
... | [
"public",
"static",
"Object",
"create",
"(",
"ActionParameter",
"argument",
",",
"Context",
"context",
",",
"ParameterFactories",
"engine",
")",
"{",
"RouteParameterHandler",
"handler",
"=",
"BINDINGS",
".",
"get",
"(",
"argument",
".",
"getSource",
"(",
")",
")... | Creates the value to be injected.
@param argument the argument
@param context the context
@param engine the engine
@return the created object | [
"Creates",
"the",
"value",
"to",
"be",
"injected",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/parameter/Bindings.java#L72-L82 | train | Create an instance of the class based on the route parameter. | Of course, here is the Java code you requested:
```java
public static Object create(ActionParameter argument, Context context,
ParameterFactories engine) {
RouteParameterHandler handler = BINDINGS.get(argument.getSource());
if (handler != null) {
return handl... |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagContentLoad.java | CmsJspTagContentLoad.setLocale | public void setLocale(String locale) {
if (CmsStringUtil.isEmpty(locale)) {
m_locale = null;
m_contentLocale = null;
} else {
m_locale = CmsLocaleManager.getLocale(locale);
m_contentLocale = m_locale;
}
} | java | public void setLocale(String locale) {
if (CmsStringUtil.isEmpty(locale)) {
m_locale = null;
m_contentLocale = null;
} else {
m_locale = CmsLocaleManager.getLocale(locale);
m_contentLocale = m_locale;
}
} | [
"public",
"void",
"setLocale",
"(",
"String",
"locale",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmpty",
"(",
"locale",
")",
")",
"{",
"m_locale",
"=",
"null",
";",
"m_contentLocale",
"=",
"null",
";",
"}",
"else",
"{",
"m_locale",
"=",
"CmsLocaleMa... | Sets the locale.<p>
@param locale the locale to set | [
"Sets",
"the",
"locale",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagContentLoad.java#L432-L441 | train | Sets the locale. | Of course, here is the Java code you requested:
```java
public void setLocale(String locale) {
if (CmsStringUtil.isEmpty(locale)) {
m_locale = null;
m_contentLocale = null;
} else {
m_locale = CmsLocaleManager.getLocale(locale);
m_contentLocale = m_local... |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/SecureHash.java | SecureHash.sha1 | public static String sha1( String string ) {
try {
byte[] sha1 = SecureHash.getHash(SecureHash.Algorithm.SHA_1, string.getBytes());
return SecureHash.asHexString(sha1);
} catch (NoSuchAlgorithmException e) {
throw new SystemFailureException(e);
}
} | java | public static String sha1( String string ) {
try {
byte[] sha1 = SecureHash.getHash(SecureHash.Algorithm.SHA_1, string.getBytes());
return SecureHash.asHexString(sha1);
} catch (NoSuchAlgorithmException e) {
throw new SystemFailureException(e);
}
} | [
"public",
"static",
"String",
"sha1",
"(",
"String",
"string",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"sha1",
"=",
"SecureHash",
".",
"getHash",
"(",
"SecureHash",
".",
"Algorithm",
".",
"SHA_1",
",",
"string",
".",
"getBytes",
"(",
")",
")",
";",
"... | Computes the sha1 value for the given string.
@param string a non-null string
@return the SHA1 value for the given string. | [
"Computes",
"the",
"sha1",
"value",
"for",
"the",
"given",
"string",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/SecureHash.java#L337-L344 | train | SHA1 - 1 - String | Of course, here is the Java code you requested:
```java
public static String sha1( String string ) {
try {
byte[] sha1 = SecureHash.getHash(SecureHash.Algorithm.SHA_1, string.getBytes());
return SecureHash.asHexString(sha1);
} catch (NoSuchAlgorithmException e) {
thr... |
stanfy/enroscar | io/src/main/java/com/stanfy/enroscar/io/PoolableBufferedInputStream.java | PoolableBufferedInputStream.available | @Override
public synchronized int available() throws IOException {
final InputStream localIn = in; // 'in' could be invalidated by close()
if (buf == null || localIn == null) { throw new IOException("Stream is closed"); }
return count - pos + localIn.available();
} | java | @Override
public synchronized int available() throws IOException {
final InputStream localIn = in; // 'in' could be invalidated by close()
if (buf == null || localIn == null) { throw new IOException("Stream is closed"); }
return count - pos + localIn.available();
} | [
"@",
"Override",
"public",
"synchronized",
"int",
"available",
"(",
")",
"throws",
"IOException",
"{",
"final",
"InputStream",
"localIn",
"=",
"in",
";",
"// 'in' could be invalidated by close()\r",
"if",
"(",
"buf",
"==",
"null",
"||",
"localIn",
"==",
"null",
... | Returns the number of bytes that are available before this stream will
block. This method returns the number of bytes available in the buffer
plus those available in the source stream.
@return the number of bytes available before blocking.
@throws IOException
if this stream is closed. | [
"Returns",
"the",
"number",
"of",
"bytes",
"that",
"are",
"available",
"before",
"this",
"stream",
"will",
"block",
".",
"This",
"method",
"returns",
"the",
"number",
"of",
"bytes",
"available",
"in",
"the",
"buffer",
"plus",
"those",
"available",
"in",
"the... | 0e64f3c309d62e359b55ddcba10e3cc592f5e083 | https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/io/src/main/java/com/stanfy/enroscar/io/PoolableBufferedInputStream.java#L71-L76 | test | Returns the number of bytes available in this stream. | Of course, here is the Java code you requested:
```java
@Override
public synchronized int available() throws IOException {
final InputStream localIn = in; // 'in' could be invalidated by close()
if (buf == null || localIn == null) { throw new IOException("Stream is closed"); }
return count - pos + lo... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/parser/JSParser.java | JSParser.Variant | final public JSVariant Variant(Map refs) throws ParseException {
JSVariant ans = new JSVariant(); JSType mem;
jj_consume_token(5);
mem = TypeDecl(refs);
ans.addCase(mem);
label_2:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
... | java | final public JSVariant Variant(Map refs) throws ParseException {
JSVariant ans = new JSVariant(); JSType mem;
jj_consume_token(5);
mem = TypeDecl(refs);
ans.addCase(mem);
label_2:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
... | [
"final",
"public",
"JSVariant",
"Variant",
"(",
"Map",
"refs",
")",
"throws",
"ParseException",
"{",
"JSVariant",
"ans",
"=",
"new",
"JSVariant",
"(",
")",
";",
"JSType",
"mem",
";",
"jj_consume_token",
"(",
"5",
")",
";",
"mem",
"=",
"TypeDecl",
"(",
"r... | Variant ::= "{" TypeDecl ( "|" TypeDecl )* "}" | [
"Variant",
"::",
"=",
"{",
"TypeDecl",
"(",
"|",
"TypeDecl",
")",
"*",
"}"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/parser/JSParser.java#L262-L284 | train | 11. 2 Variant | Of course, here is the Java code you requested:
```java
final public JSVariant Variant(Map refs) throws ParseException {
JSVariant ans = new JSVariant(); JSType mem;
jj_consume_token(5);
mem = TypeDecl(refs);
ans.addCase(mem);
label_2:
while ... |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.findByG_B_A_First | @Override
public CommerceCountry findByG_B_A_First(long groupId,
boolean billingAllowed, boolean active,
OrderByComparator<CommerceCountry> orderByComparator)
throws NoSuchCountryException {
CommerceCountry commerceCountry = fetchByG_B_A_First(groupId,
billingAllowed, active, orderByComparator);
if (com... | java | @Override
public CommerceCountry findByG_B_A_First(long groupId,
boolean billingAllowed, boolean active,
OrderByComparator<CommerceCountry> orderByComparator)
throws NoSuchCountryException {
CommerceCountry commerceCountry = fetchByG_B_A_First(groupId,
billingAllowed, active, orderByComparator);
if (com... | [
"@",
"Override",
"public",
"CommerceCountry",
"findByG_B_A_First",
"(",
"long",
"groupId",
",",
"boolean",
"billingAllowed",
",",
"boolean",
"active",
",",
"OrderByComparator",
"<",
"CommerceCountry",
">",
"orderByComparator",
")",
"throws",
"NoSuchCountryException",
"{... | Returns the first commerce country in the ordered set where groupId = ? and billingAllowed = ? and active = ?.
@param groupId the group ID
@param billingAllowed the billing allowed
@param active the active
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return th... | [
"Returns",
"the",
"first",
"commerce",
"country",
"in",
"the",
"ordered",
"set",
"where",
"groupId",
"=",
"?",
";",
"and",
"billingAllowed",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L3233-L3261 | train | Returns the commerce country in the ordered set where groupId = ? ; and billingAllowed = ? ; and active = ? ;. | Of course, here is the Java code you requested:
```java
@Override
public CommerceCountry findByG_B_A_First(long groupId,
boolean billingAllowed, boolean active,
OrderByComparator<CommerceCountry> orderByComparator)
throws NoSuchCountryException {
CommerceCountry commerceCountry = fetchByG_B_A_First(groupId,
... |
apache/incubator-gobblin | gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/converter/initializer/AvroToJdbcEntryConverterInitializer.java | AvroToJdbcEntryConverterInitializer.initialize | @Override
public void initialize() {
String table = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils
.getPropertyNameForBranch(JdbcPublisher.JDBC_PUBLISHER_FINAL_TABLE_NAME, this.branches, this.branchId)));
String db = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils
... | java | @Override
public void initialize() {
String table = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils
.getPropertyNameForBranch(JdbcPublisher.JDBC_PUBLISHER_FINAL_TABLE_NAME, this.branches, this.branchId)));
String db = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils
... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
")",
"{",
"String",
"table",
"=",
"Preconditions",
".",
"checkNotNull",
"(",
"this",
".",
"state",
".",
"getProp",
"(",
"ForkOperatorUtils",
".",
"getPropertyNameForBranch",
"(",
"JdbcPublisher",
".",
"JDBC_P... | AvroToJdbcEntryConverter list of date columns existing in the table. As we don't want each converter
making a connection against database to get the same information. Here, ConverterInitializer will
retrieve it and store it into WorkUnit so that AvroToJdbcEntryConverter will use it later.
{@inheritDoc}
@see org.apache... | [
"AvroToJdbcEntryConverter",
"list",
"of",
"date",
"columns",
"existing",
"in",
"the",
"table",
".",
"As",
"we",
"don",
"t",
"want",
"each",
"converter",
"making",
"a",
"connection",
"against",
"database",
"to",
"get",
"the",
"same",
"information",
".",
"Here",... | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/converter/initializer/AvroToJdbcEntryConverterInitializer.java#L80-L99 | train | Initialize the record set. | Of course, here is the Java code you requested:
```java
@Override
public void initialize() {
String table = Preconditions.checkNotNull(this.state.getProp(ForkOperatorUtils
.getPropertyNameForBranch(JdbcPublisher.JDBC_PUBLISHER_FINAL_TABLE_NAME, this.branches, this.branchId)));
String db = Preconditio... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasSgemv | public static void cublasSgemv(char trans, int m, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy)
{
cublasSgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy);
checkResultBLAS();
} | java | public static void cublasSgemv(char trans, int m, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy)
{
cublasSgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasSgemv",
"(",
"char",
"trans",
",",
"int",
"m",
",",
"int",
"n",
",",
"float",
"alpha",
",",
"Pointer",
"A",
",",
"int",
"lda",
",",
"Pointer",
"x",
",",
"int",
"incx",
",",
"float",
"beta",
",",
"Pointer",
"y",
",... | <pre>
cublasSgemv (char trans, int m, int n, float alpha, const float *A, int lda,
const float *x, int incx, float beta, float *y, int incy)
performs one of the matrix-vector operations
y = alpha * op(A) * x + beta * y,
where op(A) is one of
op(A) = A or op(A) = transpose(A)
where alpha and beta are single pre... | [
"<pre",
">",
"cublasSgemv",
"(",
"char",
"trans",
"int",
"m",
"int",
"n",
"float",
"alpha",
"const",
"float",
"*",
"A",
"int",
"lda",
"const",
"float",
"*",
"x",
"int",
"incx",
"float",
"beta",
"float",
"*",
"y",
"int",
"incy",
")"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L3020-L3024 | test | Cublas S GEMV operation | Of course, here is the Java code you requested:
```java
public static void cublasSgemv(char trans, int m, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy)
{
cublasSgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy);
checkResultBLAS();
... |
cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java | SystemFunctionResolver.resolveMessage | private Message resolveMessage(FunctionRef fun) {
if (fun.getOperand().size() != 5) {
throw new IllegalArgumentException("Could not resolve call to system operator Message. Expected 5 arguments.");
}
Message message = of.createMessage()
.withSource(fun.getOperand().g... | java | private Message resolveMessage(FunctionRef fun) {
if (fun.getOperand().size() != 5) {
throw new IllegalArgumentException("Could not resolve call to system operator Message. Expected 5 arguments.");
}
Message message = of.createMessage()
.withSource(fun.getOperand().g... | [
"private",
"Message",
"resolveMessage",
"(",
"FunctionRef",
"fun",
")",
"{",
"if",
"(",
"fun",
".",
"getOperand",
"(",
")",
".",
"size",
"(",
")",
"!=",
"5",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Could not resolve call to system operator ... | Error Functions | [
"Error",
"Functions"
] | 67459d1ef453e49db8d7c5c86e87278377ed0a0b | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/SystemFunctionResolver.java#L582-L596 | train | Resolves a system operator Message. | Of course, here is the Java code you requested:
```java
private Message resolveMessage(FunctionRef fun) {
if (fun.getOperand().size() != 5) {
throw new IllegalArgumentException("Could not resolve call to system operator Message. Expected 5 arguments.");
}
Message message = of.creat... |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/util/ArrayEnumeration.java | ArrayEnumeration.nextElement | public Object nextElement()
{
if (_array == null)
{
return null;
}
else
{
synchronized(this){
if (_index < _array.length)
{
Object obj = _array[_index];
_index++;
... | java | public Object nextElement()
{
if (_array == null)
{
return null;
}
else
{
synchronized(this){
if (_index < _array.length)
{
Object obj = _array[_index];
_index++;
... | [
"public",
"Object",
"nextElement",
"(",
")",
"{",
"if",
"(",
"_array",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"_index",
"<",
"_array",
".",
"length",
")",
"{",
"Object",
"o... | nextElement method comment. | [
"nextElement",
"method",
"comment",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/util/ArrayEnumeration.java#L48-L69 | train | Get the next element in the array. | Of course, here is the Java code you requested:
```java
public Object nextElement()
{
if (_array == null)
{
return null;
}
else
{
synchronized(this){
if (_index < _array.length)
{
Object obj = _arra... |
attoparser/attoparser | src/main/java/org/attoparser/select/BlockSelectorMarkupHandler.java | BlockSelectorMarkupHandler.handleCDATASection | @Override
public void handleCDATASection(
final char[] buffer,
final int contentOffset, final int contentLen, final int outerOffset,
final int outerLen, final int line, final int col)
throws ParseException {
if (!this.insideAllSelectorMatchingBlock) {
... | java | @Override
public void handleCDATASection(
final char[] buffer,
final int contentOffset, final int contentLen, final int outerOffset,
final int outerLen, final int line, final int col)
throws ParseException {
if (!this.insideAllSelectorMatchingBlock) {
... | [
"@",
"Override",
"public",
"void",
"handleCDATASection",
"(",
"final",
"char",
"[",
"]",
"buffer",
",",
"final",
"int",
"contentOffset",
",",
"final",
"int",
"contentLen",
",",
"final",
"int",
"outerOffset",
",",
"final",
"int",
"outerLen",
",",
"final",
"in... | /*
--------------------
CDATA Section events
-------------------- | [
"/",
"*",
"--------------------",
"CDATA",
"Section",
"events",
"--------------------"
] | d2e8c1d822e290b0ce0242aff6e56ebdb9ca74b0 | https://github.com/attoparser/attoparser/blob/d2e8c1d822e290b0ce0242aff6e56ebdb9ca74b0/src/main/java/org/attoparser/select/BlockSelectorMarkupHandler.java#L645-L691 | train | Handle CDATASection. | Of course, here is the Java code you requested:
```java
@Override
public void handleCDATASection(
final char[] buffer,
final int contentOffset, final int contentLen, final int outerOffset,
final int outerLen, final int line, final int col)
throws ParseException {
... |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java | ElementMatchers.hasGenericSuperType | public static <T extends TypeDescription> ElementMatcher.Junction<T> hasGenericSuperType(ElementMatcher<? super TypeDescription.Generic> matcher) {
return new HasSuperTypeMatcher<T>(matcher);
} | java | public static <T extends TypeDescription> ElementMatcher.Junction<T> hasGenericSuperType(ElementMatcher<? super TypeDescription.Generic> matcher) {
return new HasSuperTypeMatcher<T>(matcher);
} | [
"public",
"static",
"<",
"T",
"extends",
"TypeDescription",
">",
"ElementMatcher",
".",
"Junction",
"<",
"T",
">",
"hasGenericSuperType",
"(",
"ElementMatcher",
"<",
"?",
"super",
"TypeDescription",
".",
"Generic",
">",
"matcher",
")",
"{",
"return",
"new",
"H... | Matches any type description that declares a super type that matches the provided matcher.
@param matcher The type to be checked for being a super type of the matched type.
@param <T> The type of the matched object.
@return A matcher that matches any type description that declares a super type that matches the pro... | [
"Matches",
"any",
"type",
"description",
"that",
"declares",
"a",
"super",
"type",
"that",
"matches",
"the",
"provided",
"matcher",
"."
] | 4d2dac80efb6bed89367567260f6811c2f712d12 | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java#L1912-L1914 | train | Create a new has - super type matcher. | Of course, here is the Java code you requested:
```java
public static <T extends TypeDescription> ElementMatcher.Junction<T> hasGenericSuperType(ElementMatcher<? super TypeDescription.Generic> matcher) {
return new HasSuperTypeMatcher<T>(matcher);
}
```
Hope this helps! |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/RestRepositoryService.java | RestRepositoryService.getRepositoryNames | @GET
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("administrators")
@Path("/repositories")
public Response getRepositoryNames()
{
List<String> repositories = new ArrayList<String>();
for (RepositoryEntry rEntry : repositoryService.getConfig().getRepositoryConfigurations())
{
... | java | @GET
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("administrators")
@Path("/repositories")
public Response getRepositoryNames()
{
List<String> repositories = new ArrayList<String>();
for (RepositoryEntry rEntry : repositoryService.getConfig().getRepositoryConfigurations())
{
... | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"RolesAllowed",
"(",
"\"administrators\"",
")",
"@",
"Path",
"(",
"\"/repositories\"",
")",
"public",
"Response",
"getRepositoryNames",
"(",
")",
"{",
"List",
"<",
"String",
">",... | Gives the name of all the existing repositories.
@return Response return the Response with list of repository names
@response
{code:json}
{"names" : the name of all the existing repositories }
{code}
@LevelAPI Experimental | [
"Gives",
"the",
"name",
"of",
"all",
"the",
"existing",
"repositories",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/RestRepositoryService.java#L519-L533 | train | Get a list of all repositories names | Of course, here is the Java code you requested:
```java
@GET
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("administrators")
@Path("/repositories")
public Response getRepositoryNames()
{
List<String> repositories = new ArrayList<String>();
for (RepositoryEntry rEntry : repositoryServi... |
playframework/playframework | core/play-guice/src/main/java/play/inject/guice/GuiceApplicationBuilder.java | GuiceApplicationBuilder.withConfigLoader | public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) {
return newBuilder(
delegate.loadConfig(
func(
(play.api.Environment env) ->
new play.api.Configuration(load.apply(new Environment(env))))));
} | java | public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) {
return newBuilder(
delegate.loadConfig(
func(
(play.api.Environment env) ->
new play.api.Configuration(load.apply(new Environment(env))))));
} | [
"public",
"GuiceApplicationBuilder",
"withConfigLoader",
"(",
"Function",
"<",
"Environment",
",",
"Config",
">",
"load",
")",
"{",
"return",
"newBuilder",
"(",
"delegate",
".",
"loadConfig",
"(",
"func",
"(",
"(",
"play",
".",
"api",
".",
"Environment",
"env"... | Set the initial configuration loader. Overrides the default or any previously configured
values.
@param load the configuration loader
@return the configured application builder | [
"Set",
"the",
"initial",
"configuration",
"loader",
".",
"Overrides",
"the",
"default",
"or",
"any",
"previously",
"configured",
"values",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play-guice/src/main/java/play/inject/guice/GuiceApplicationBuilder.java#L42-L48 | test | Creates a new application builder using the specified configuration loader. | Of course, here is the Java code you requested:
```java
public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) {
return newBuilder(
delegate.loadConfig(
func(
(play.api.Environment env) ->
new play.api.Configuration(load.apply(new... |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/GetApnsVoipSandboxChannelRequestMarshaller.java | GetApnsVoipSandboxChannelRequestMarshaller.marshall | public void marshall(GetApnsVoipSandboxChannelRequest getApnsVoipSandboxChannelRequest, ProtocolMarshaller protocolMarshaller) {
if (getApnsVoipSandboxChannelRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMar... | java | public void marshall(GetApnsVoipSandboxChannelRequest getApnsVoipSandboxChannelRequest, ProtocolMarshaller protocolMarshaller) {
if (getApnsVoipSandboxChannelRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMar... | [
"public",
"void",
"marshall",
"(",
"GetApnsVoipSandboxChannelRequest",
"getApnsVoipSandboxChannelRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"getApnsVoipSandboxChannelRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/GetApnsVoipSandboxChannelRequestMarshaller.java#L42-L53 | train | Converts the APNS VoIP sandbox request to an Amazon S3 application. | Of course, here is the Java code you requested:
```java
public void marshall(GetApnsVoipSandboxChannelRequest getApnsVoipSandboxChannelRequest, ProtocolMarshaller protocolMarshaller) {
if (getApnsVoipSandboxChannelRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall... |
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java | CFMLExpressionInterpreter.identifier | private String identifier(boolean firstCanBeNumber) {
if (!cfml.isCurrentLetter() && !cfml.isCurrentSpecial()) {
if (!firstCanBeNumber) return null;
else if (!cfml.isCurrentDigit()) return null;
}
boolean doUpper;
PageSource ps = pc == null ? null : pc.getCurrentPageSource();
if (ps != null) doUpper = !i... | java | private String identifier(boolean firstCanBeNumber) {
if (!cfml.isCurrentLetter() && !cfml.isCurrentSpecial()) {
if (!firstCanBeNumber) return null;
else if (!cfml.isCurrentDigit()) return null;
}
boolean doUpper;
PageSource ps = pc == null ? null : pc.getCurrentPageSource();
if (ps != null) doUpper = !i... | [
"private",
"String",
"identifier",
"(",
"boolean",
"firstCanBeNumber",
")",
"{",
"if",
"(",
"!",
"cfml",
".",
"isCurrentLetter",
"(",
")",
"&&",
"!",
"cfml",
".",
"isCurrentSpecial",
"(",
")",
")",
"{",
"if",
"(",
"!",
"firstCanBeNumber",
")",
"return",
... | Liest einen Identifier aus und gibt diesen als String zurueck. <br />
EBNF:<br />
<code>(letter | "_") {letter | "_"|digit};</code>
@param firstCanBeNumber
@return Identifier. | [
"Liest",
"einen",
"Identifier",
"aus",
"und",
"gibt",
"diesen",
"als",
"String",
"zurueck",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"(",
"letter",
"|",
"_",
")",
"{",
"letter",
"|",
"_",
"|digit",
"}",
";",
"<",
"/",
"co... | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java#L1378-L1400 | train | returns the identifier of the current page | Of course, here is the Java code you requested:
```java
private String identifier(boolean firstCanBeNumber) {
if (!cfml.isCurrentLetter() && !cfml.isCurrentSpecial()) {
if (!firstCanBeNumber) return null;
else if (!cfml.isCurrentDigit()) return null;
}
boolean doUpper;
PageSource ps = pc == null ? null :... |
Netflix/netflix-commons | netflix-statistics/src/main/java/com/netflix/stats/distribution/DataBuffer.java | DataBuffer.noteValue | @Override
public void noteValue(double val) {
super.noteValue(val);
buf[insertPos++] = val;
if (insertPos >= buf.length) {
insertPos = 0;
size = buf.length;
} else if (insertPos > size) {
size = insertPos;
}
} | java | @Override
public void noteValue(double val) {
super.noteValue(val);
buf[insertPos++] = val;
if (insertPos >= buf.length) {
insertPos = 0;
size = buf.length;
} else if (insertPos > size) {
size = insertPos;
}
} | [
"@",
"Override",
"public",
"void",
"noteValue",
"(",
"double",
"val",
")",
"{",
"super",
".",
"noteValue",
"(",
"val",
")",
";",
"buf",
"[",
"insertPos",
"++",
"]",
"=",
"val",
";",
"if",
"(",
"insertPos",
">=",
"buf",
".",
"length",
")",
"{",
"ins... | {@inheritDoc}
<p>
The buffer wraps-around if it is full, overwriting the oldest
entry with the new value. | [
"{"
] | 7a158af76906d4a9b753e9344ce3e7abeb91dc01 | https://github.com/Netflix/netflix-commons/blob/7a158af76906d4a9b753e9344ce3e7abeb91dc01/netflix-statistics/src/main/java/com/netflix/stats/distribution/DataBuffer.java#L141-L151 | train | Note value. | Of course, here is the Java code you requested:
```java
@Override
public void noteValue(double val) {
super.noteValue(val);
buf[insertPos++] = val;
if (insertPos >= buf.length) {
insertPos = 0;
size = buf.length;
} else if (insertPos > size) {
siz... |
openbase/jul | communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractConfigurableController.java | AbstractConfigurableController.init | @Override
public void init(final CONFIG config) throws InitializationException, InterruptedException {
try {
try(final CloseableWriteLockWrapper ignored = getManageWriteLock(this)) {
if (config == null) {
throw new NotAvailableException("config");
... | java | @Override
public void init(final CONFIG config) throws InitializationException, InterruptedException {
try {
try(final CloseableWriteLockWrapper ignored = getManageWriteLock(this)) {
if (config == null) {
throw new NotAvailableException("config");
... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"final",
"CONFIG",
"config",
")",
"throws",
"InitializationException",
",",
"InterruptedException",
"{",
"try",
"{",
"try",
"(",
"final",
"CloseableWriteLockWrapper",
"ignored",
"=",
"getManageWriteLock",
"(",
"this",
... | Initialize the controller with a configuration.
@param config the configuration
@throws InitializationException if the initialization fails
@throws java.lang.InterruptedException if the initialization is interrupted | [
"Initialize",
"the",
"controller",
"with",
"a",
"configuration",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractConfigurableController.java#L66-L80 | train | Initialize the class. | Of course, here is the Java code you requested:
```java
@Override
public void init(final CONFIG config) throws InitializationException, InterruptedException {
try {
try(final CloseableWriteLockWrapper ignored = getManageWriteLock(this)) {
if (config == null) {
... |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/StringTokenizer.java | StringTokenizer.nextToken | public String nextToken(String delim)
{
m_delimiters_ = EMPTY_DELIMITER_;
if (delim != null && delim.length() > 0) {
m_delimiters_ = new UnicodeSet();
m_delimiters_.addAll(delim);
}
return nextToken(m_delimiters_);
} | java | public String nextToken(String delim)
{
m_delimiters_ = EMPTY_DELIMITER_;
if (delim != null && delim.length() > 0) {
m_delimiters_ = new UnicodeSet();
m_delimiters_.addAll(delim);
}
return nextToken(m_delimiters_);
} | [
"public",
"String",
"nextToken",
"(",
"String",
"delim",
")",
"{",
"m_delimiters_",
"=",
"EMPTY_DELIMITER_",
";",
"if",
"(",
"delim",
"!=",
"null",
"&&",
"delim",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"m_delimiters_",
"=",
"new",
"UnicodeSet",
"("... | Returns the next token in this string tokenizer's string. First,
the set of characters considered to be delimiters by this
<tt>StringTokenizer</tt> object is changed to be the characters in
the string <tt>delim</tt>. Then the next token in the string
after the current position is returned. The current position is
advan... | [
"Returns",
"the",
"next",
"token",
"in",
"this",
"string",
"tokenizer",
"s",
"string",
".",
"First",
"the",
"set",
"of",
"characters",
"considered",
"to",
"be",
"delimiters",
"by",
"this",
"<tt",
">",
"StringTokenizer<",
"/",
"tt",
">",
"object",
"is",
"ch... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/StringTokenizer.java#L390-L398 | train | Returns the next token from the input. | Of course, here is the Java code you requested:
```java
public String nextToken(String delim)
{
m_delimiters_ = EMPTY_DELIMITER_;
if (delim != null && delim.length() > 0) {
m_delimiters_ = new UnicodeSet();
m_delimiters_.addAll(delim);
}
return nextToken(m_d... |
aleksandr-m/gitflow-maven-plugin | src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowHotfixFinishMojo.java | GitFlowHotfixFinishMojo.execute | @Override
public void execute() throws MojoExecutionException, MojoFailureException {
validateConfiguration(preHotfixGoals, postHotfixGoals);
try {
// check uncommitted changes
checkUncommittedChanges();
String hotfixBranchName = null;
if (settings.i... | java | @Override
public void execute() throws MojoExecutionException, MojoFailureException {
validateConfiguration(preHotfixGoals, postHotfixGoals);
try {
// check uncommitted changes
checkUncommittedChanges();
String hotfixBranchName = null;
if (settings.i... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"validateConfiguration",
"(",
"preHotfixGoals",
",",
"postHotfixGoals",
")",
";",
"try",
"{",
"// check uncommitted changes",
"checkUncommittedCha... | {@inheritDoc} | [
"{"
] | d7be13c653d885c1cb1d8cd0337fa9db985c381e | https://github.com/aleksandr-m/gitflow-maven-plugin/blob/d7be13c653d885c1cb1d8cd0337fa9db985c381e/src/main/java/com/amashchenko/maven/plugin/gitflow/GitFlowHotfixFinishMojo.java#L122-L349 | train | Execute the C ++ command. | Of course, here is the Java code you requested:
```java
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
validateConfiguration(preHotfixGoals, postHotfixGoals);
try {
// check uncommitted changes
checkUncommittedChanges();
S... |
calrissian/mango | mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonAttributeMappings.java | JsonAttributeMappings.toJsonString | public static String toJsonString(Collection<Attribute> attributeCollection, ObjectMapper objectMapper) throws JsonProcessingException {
return objectMapper.writeValueAsString(toObject(attributeCollection));
} | java | public static String toJsonString(Collection<Attribute> attributeCollection, ObjectMapper objectMapper) throws JsonProcessingException {
return objectMapper.writeValueAsString(toObject(attributeCollection));
} | [
"public",
"static",
"String",
"toJsonString",
"(",
"Collection",
"<",
"Attribute",
">",
"attributeCollection",
",",
"ObjectMapper",
"objectMapper",
")",
"throws",
"JsonProcessingException",
"{",
"return",
"objectMapper",
".",
"writeValueAsString",
"(",
"toObject",
"(",
... | Re-expands a flattened json representation from a collection of attributes back into a raw
nested json string. | [
"Re",
"-",
"expands",
"a",
"flattened",
"json",
"representation",
"from",
"a",
"collection",
"of",
"attributes",
"back",
"into",
"a",
"raw",
"nested",
"json",
"string",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonAttributeMappings.java#L100-L102 | train | Convert a collection of Attribute objects to a JSON string. | Of course, here is the Java code you requested:
```java
public static String toJsonString(Collection<Attribute> attributeCollection, ObjectMapper objectMapper) throws JsonProcessingException {
return objectMapper.writeValueAsString(toObject(attributeCollection));
}
```
Hope this helps! |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/notifications/NotificationsActor.java | NotificationsActor.isNotificationsEnabled | private boolean isNotificationsEnabled(Peer peer, boolean hasMention) {
// If notifications doesn't enabled at all
if (!context().getSettingsModule().isNotificationsEnabled()) {
return false;
}
// Notifications for groups
if (peer.getPeerType() == PeerType.GROUP) {
... | java | private boolean isNotificationsEnabled(Peer peer, boolean hasMention) {
// If notifications doesn't enabled at all
if (!context().getSettingsModule().isNotificationsEnabled()) {
return false;
}
// Notifications for groups
if (peer.getPeerType() == PeerType.GROUP) {
... | [
"private",
"boolean",
"isNotificationsEnabled",
"(",
"Peer",
"peer",
",",
"boolean",
"hasMention",
")",
"{",
"// If notifications doesn't enabled at all",
"if",
"(",
"!",
"context",
"(",
")",
".",
"getSettingsModule",
"(",
")",
".",
"isNotificationsEnabled",
"(",
")... | Testing if notifications enabled for message
@param peer peer of message
@param hasMention does peer have mention
@return is notification enabled for peer | [
"Testing",
"if",
"notifications",
"enabled",
"for",
"message"
] | 5123c1584757c6eeea0ed2a0e7e043629871a0c6 | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/notifications/NotificationsActor.java#L448-L497 | train | Checks if notifications are enabled for the peer. | Of course, here is the Java code you requested:
```java
private boolean isNotificationsEnabled(Peer peer, boolean hasMention) {
// If notifications doesn't enabled at all
if (!context().getSettingsModule().isNotificationsEnabled()) {
return false;
}
// Notifications for gr... |
Coveros/selenified | src/main/java/com/coveros/selenified/application/App.java | App.refreshHard | public void refreshHard() {
String action = "Reloading current page while clearing the cache";
String expected = "Cache is cleared, and the page is refreshed";
try {
driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Keys.CONTROL, Keys.F5));
driver.findElement(By.... | java | public void refreshHard() {
String action = "Reloading current page while clearing the cache";
String expected = "Cache is cleared, and the page is refreshed";
try {
driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Keys.CONTROL, Keys.F5));
driver.findElement(By.... | [
"public",
"void",
"refreshHard",
"(",
")",
"{",
"String",
"action",
"=",
"\"Reloading current page while clearing the cache\"",
";",
"String",
"expected",
"=",
"\"Cache is cleared, and the page is refreshed\"",
";",
"try",
"{",
"driver",
".",
"findElement",
"(",
"By",
"... | Reloads the current page while clearing the cache. This only works for
certain browsers, as the command/control and F5 key combination is used
to perform the action. Note that each time a test is run, nothing is
currently in the cache, as each test is run in a completely
new/fresh/clean session | [
"Reloads",
"the",
"current",
"page",
"while",
"clearing",
"the",
"cache",
".",
"This",
"only",
"works",
"for",
"certain",
"browsers",
"as",
"the",
"command",
"/",
"control",
"and",
"F5",
"key",
"combination",
"is",
"used",
"to",
"perform",
"the",
"action",
... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/App.java#L417-L429 | train | Reload the cache. | Of course, here is the Java code you requested:
```java
public void refreshHard() {
String action = "Reloading current page while clearing the cache";
String expected = "Cache is cleared, and the page is refreshed";
try {
driver.findElement(By.tagName("body")).sendKeys(Keys.chord(Ke... |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java | ManagedClustersInner.getUpgradeProfileAsync | public Observable<ManagedClusterUpgradeProfileInner> getUpgradeProfileAsync(String resourceGroupName, String resourceName) {
return getUpgradeProfileWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ManagedClusterUpgradeProfileInner>, ManagedClusterUpgradeProfileInner>() {
... | java | public Observable<ManagedClusterUpgradeProfileInner> getUpgradeProfileAsync(String resourceGroupName, String resourceName) {
return getUpgradeProfileWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ManagedClusterUpgradeProfileInner>, ManagedClusterUpgradeProfileInner>() {
... | [
"public",
"Observable",
"<",
"ManagedClusterUpgradeProfileInner",
">",
"getUpgradeProfileAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getUpgradeProfileWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
... | Gets upgrade profile for a managed cluster.
Gets the details of the upgrade profile for a managed cluster with a specified resource group and name.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@throws IllegalArgumentException thrown if parameter... | [
"Gets",
"upgrade",
"profile",
"for",
"a",
"managed",
"cluster",
".",
"Gets",
"the",
"details",
"of",
"the",
"upgrade",
"profile",
"for",
"a",
"managed",
"cluster",
"with",
"a",
"specified",
"resource",
"group",
"and",
"name",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L383-L390 | train | Gets the upgrade profile for a managed cluster. | Of course, here is the Java code you requested:
```java
public Observable<ManagedClusterUpgradeProfileInner> getUpgradeProfileAsync(String resourceGroupName, String resourceName) {
return getUpgradeProfileWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ManagedClusterUpgr... |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java | AbstractCasWebflowConfigurer.containsSubflowState | public boolean containsSubflowState(final Flow flow, final String stateId) {
if (containsFlowState(flow, stateId)) {
return getState(flow, stateId, SubflowState.class) != null;
}
return false;
} | java | public boolean containsSubflowState(final Flow flow, final String stateId) {
if (containsFlowState(flow, stateId)) {
return getState(flow, stateId, SubflowState.class) != null;
}
return false;
} | [
"public",
"boolean",
"containsSubflowState",
"(",
"final",
"Flow",
"flow",
",",
"final",
"String",
"stateId",
")",
"{",
"if",
"(",
"containsFlowState",
"(",
"flow",
",",
"stateId",
")",
")",
"{",
"return",
"getState",
"(",
"flow",
",",
"stateId",
",",
"Sub... | Contains subflow state.
@param flow the flow
@param stateId the state id
@return the boolean | [
"Contains",
"subflow",
"state",
"."
] | b4b306433a8782cef803a39bea5b1f96740e0e9b | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java#L561-L566 | train | Check if a subflow state exists. | Of course, here is the Java code you requested:
```java
public boolean containsSubflowState(final Flow flow, final String stateId) {
if (containsFlowState(flow, stateId)) {
return getState(flow, stateId, SubflowState.class) != null;
}
return false;
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java | TraceSummary.withUsers | public TraceSummary withUsers(TraceUser... users) {
if (this.users == null) {
setUsers(new java.util.ArrayList<TraceUser>(users.length));
}
for (TraceUser ele : users) {
this.users.add(ele);
}
return this;
} | java | public TraceSummary withUsers(TraceUser... users) {
if (this.users == null) {
setUsers(new java.util.ArrayList<TraceUser>(users.length));
}
for (TraceUser ele : users) {
this.users.add(ele);
}
return this;
} | [
"public",
"TraceSummary",
"withUsers",
"(",
"TraceUser",
"...",
"users",
")",
"{",
"if",
"(",
"this",
".",
"users",
"==",
"null",
")",
"{",
"setUsers",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"TraceUser",
">",
"(",
"users",
".",
"length... | <p>
Users from the trace's segment documents.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setUsers(java.util.Collection)} or {@link #withUsers(java.util.Collection)} if you want to override the
existing values.
</p>
@param users
Users from the trace's segment documen... | [
"<p",
">",
"Users",
"from",
"the",
"trace",
"s",
"segment",
"documents",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
"(",
"if",
"an... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java#L641-L649 | train | A list of TraceUser objects. | Of course, here is the Java code you requested:
```java
public TraceSummary withUsers(TraceUser... users) {
if (this.users == null) {
setUsers(new java.util.ArrayList<TraceUser>(users.length));
}
for (TraceUser ele : users) {
this.users.add(ele);
}
return... |
echocat/jomon | runtime/src/main/java/org/echocat/jomon/runtime/CollectionUtils.java | CollectionUtils.asMap | @Nonnull
public static <K, V> Map<K, V> asMap(@Nullable Object... a) {
return putAll(new LinkedHashMap<K, V>(), a);
} | java | @Nonnull
public static <K, V> Map<K, V> asMap(@Nullable Object... a) {
return putAll(new LinkedHashMap<K, V>(), a);
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"asMap",
"(",
"@",
"Nullable",
"Object",
"...",
"a",
")",
"{",
"return",
"putAll",
"(",
"new",
"LinkedHashMap",
"<",
"K",
",",
"V",
">",
"(",
")",
",",... | Returns a {@link LinkedHashMap}
with the mappings <code>a[0] => a[1], a[2] => a[3], ...</code>.
@param a the elements to construct a {@link Map} from.
@return a {@link Map} constructed of the specified elements. | [
"Returns",
"a",
"{"
] | b3b81dc3f8ca2b17f87492090b86f3b8dea5fe32 | https://github.com/echocat/jomon/blob/b3b81dc3f8ca2b17f87492090b86f3b8dea5fe32/runtime/src/main/java/org/echocat/jomon/runtime/CollectionUtils.java#L69-L72 | valid | Returns a map containing all of the elements in the array. | Of course, here is the Java code you requested:
```java
@Nonnull
public static <K, V> Map<K, V> asMap(@Nullable Object... a) {
return putAll(new LinkedHashMap<K, V>(), a);
}
```
Hope this helps! |
Hack23/cia | model.external.riksdagen.dokumentstatus.impl/src/main/java/com/hack23/cia/model/external/riksdagen/dokumentstatus/impl/DocumentStatusContainer.java | DocumentStatusContainer.getDocumentProposal | @ManyToOne(targetEntity = DocumentProposalContainer.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "DOCUMENT_PROPOSAL_DOCUMENT_S_0")
public DocumentProposalContainer getDocumentProposal() {
return documentProposal;
} | java | @ManyToOne(targetEntity = DocumentProposalContainer.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "DOCUMENT_PROPOSAL_DOCUMENT_S_0")
public DocumentProposalContainer getDocumentProposal() {
return documentProposal;
} | [
"@",
"ManyToOne",
"(",
"targetEntity",
"=",
"DocumentProposalContainer",
".",
"class",
",",
"cascade",
"=",
"{",
"CascadeType",
".",
"ALL",
"}",
")",
"@",
"JoinColumn",
"(",
"name",
"=",
"\"DOCUMENT_PROPOSAL_DOCUMENT_S_0\"",
")",
"public",
"DocumentProposalContainer... | Gets the document proposal.
@return the document proposal | [
"Gets",
"the",
"document",
"proposal",
"."
] | 223312ca0eec74888a57a060de5b164f95a7785f | https://github.com/Hack23/cia/blob/223312ca0eec74888a57a060de5b164f95a7785f/model.external.riksdagen.dokumentstatus.impl/src/main/java/com/hack23/cia/model/external/riksdagen/dokumentstatus/impl/DocumentStatusContainer.java#L143-L149 | valid | Gets the value of the documentProposal property. | Of course, here is the Java code you requested:
```java
@ManyToOne(targetEntity = DocumentProposalContainer.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "DOCUMENT_PROPOSAL_DOCUMENT_S_0")
public DocumentProposalContainer getDocumentProposal() {
return documentProposal;
}
```
... |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/serialization/AbstractJacksonBackedStringSerializer.java | AbstractJacksonBackedStringSerializer.readObjectFromString | protected T readObjectFromString(final String jsonString) {
try {
LOGGER.trace("Attempting to consume [{}]", jsonString);
return this.objectMapper.readValue(jsonString, getTypeToSerialize());
} catch (final Exception e) {
LOGGER.error("Cannot read/parse [{}] to deseri... | java | protected T readObjectFromString(final String jsonString) {
try {
LOGGER.trace("Attempting to consume [{}]", jsonString);
return this.objectMapper.readValue(jsonString, getTypeToSerialize());
} catch (final Exception e) {
LOGGER.error("Cannot read/parse [{}] to deseri... | [
"protected",
"T",
"readObjectFromString",
"(",
"final",
"String",
"jsonString",
")",
"{",
"try",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Attempting to consume [{}]\"",
",",
"jsonString",
")",
";",
"return",
"this",
".",
"objectMapper",
".",
"readValue",
"(",
"jsonS... | Read object from json.
@param jsonString the json string
@return the type | [
"Read",
"object",
"from",
"json",
"."
] | b4b306433a8782cef803a39bea5b1f96740e0e9b | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/serialization/AbstractJacksonBackedStringSerializer.java#L229-L242 | train | Read object from string. | Of course, here is the Java code you requested:
```java
protected T readObjectFromString(final String jsonString) {
try {
LOGGER.trace("Attempting to consume [{}]", jsonString);
return this.objectMapper.readValue(jsonString, getTypeToSerialize());
} catch (final Exception e) {
... |
lucee/Lucee | core/src/main/java/lucee/transformer/cfml/expression/SimpleExprTransformer.java | SimpleExprTransformer.string | public Expression string(Factory f, SourceCode cfml) throws TemplateException {
cfml.removeSpace();
char quoter = cfml.getCurrentLower();
if (quoter != '"' && quoter != '\'') return null;
StringBuffer str = new StringBuffer();
boolean insideSpecial = false;
Position line = cfml.getPosition();
while (cfml.hasNex... | java | public Expression string(Factory f, SourceCode cfml) throws TemplateException {
cfml.removeSpace();
char quoter = cfml.getCurrentLower();
if (quoter != '"' && quoter != '\'') return null;
StringBuffer str = new StringBuffer();
boolean insideSpecial = false;
Position line = cfml.getPosition();
while (cfml.hasNex... | [
"public",
"Expression",
"string",
"(",
"Factory",
"f",
",",
"SourceCode",
"cfml",
")",
"throws",
"TemplateException",
"{",
"cfml",
".",
"removeSpace",
"(",
")",
";",
"char",
"quoter",
"=",
"cfml",
".",
"getCurrentLower",
"(",
")",
";",
"if",
"(",
"quoter",... | Liest den String ein
@return Element
@throws TemplateException | [
"Liest",
"den",
"String",
"ein"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/expression/SimpleExprTransformer.java#L69-L108 | train | Parse a string from the source code. | Of course, here is the Java code you requested:
```java
public Expression string(Factory f, SourceCode cfml) throws TemplateException {
cfml.removeSpace();
char quoter = cfml.getCurrentLower();
if (quoter != '"' && quoter != '\'') return null;
StringBuffer str = new StringBuffer();
boolean insideSpecial = false;
... |
FudanNLP/fnlp | fnlp-core/src/main/java/org/fnlp/nlp/similarity/train/WordCluster.java | WordCluster.mergeCluster | public void mergeCluster() {
int maxc1 = -1;
int maxc2 = -1;
float maxL = Float.NEGATIVE_INFINITY;
TIntIterator it1 = slots.iterator();
while(it1.hasNext()){
int i = it1.next();
TIntIterator it2 = slots.iterator();
// System.out.print(i+": ");
while(it2.hasNext()){
int j= it2.nex... | java | public void mergeCluster() {
int maxc1 = -1;
int maxc2 = -1;
float maxL = Float.NEGATIVE_INFINITY;
TIntIterator it1 = slots.iterator();
while(it1.hasNext()){
int i = it1.next();
TIntIterator it2 = slots.iterator();
// System.out.print(i+": ");
while(it2.hasNext()){
int j= it2.nex... | [
"public",
"void",
"mergeCluster",
"(",
")",
"{",
"int",
"maxc1",
"=",
"-",
"1",
";",
"int",
"maxc2",
"=",
"-",
"1",
";",
"float",
"maxL",
"=",
"Float",
".",
"NEGATIVE_INFINITY",
";",
"TIntIterator",
"it1",
"=",
"slots",
".",
"iterator",
"(",
")",
";"... | merge clusters | [
"merge",
"clusters"
] | ce258f3e4a5add2ba0b5e4cbac7cab2190af6659 | https://github.com/FudanNLP/fnlp/blob/ce258f3e4a5add2ba0b5e4cbac7cab2190af6659/fnlp-core/src/main/java/org/fnlp/nlp/similarity/train/WordCluster.java#L282-L311 | train | Merges the cluster with the data from the cluster. | Of course, here is the Java code you requested:
```java
public void mergeCluster() {
int maxc1 = -1;
int maxc2 = -1;
float maxL = Float.NEGATIVE_INFINITY;
TIntIterator it1 = slots.iterator();
while(it1.hasNext()){
int i = it1.next();
TIntIterator it2 = slots.iterator();
// System.out.pri... |
RestComm/media-core | control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/pkg/au/pr/PlayRecordContext.java | PlayRecordContext.getFailureAnnouncementSegments | private String[] getFailureAnnouncementSegments() {
String value = Optional.fromNullable(getParameter(SignalParameters.FAILURE_ANNOUNCEMENT.symbol())).or("");
return value.isEmpty() ? new String[0] : value.split(",");
} | java | private String[] getFailureAnnouncementSegments() {
String value = Optional.fromNullable(getParameter(SignalParameters.FAILURE_ANNOUNCEMENT.symbol())).or("");
return value.isEmpty() ? new String[0] : value.split(",");
} | [
"private",
"String",
"[",
"]",
"getFailureAnnouncementSegments",
"(",
")",
"{",
"String",
"value",
"=",
"Optional",
".",
"fromNullable",
"(",
"getParameter",
"(",
"SignalParameters",
".",
"FAILURE_ANNOUNCEMENT",
".",
"symbol",
"(",
")",
")",
")",
".",
"or",
"(... | Played when all data entry attempts have failed.
<p>
Consists of one or more audio segments. No default.
</p>
@return The array of audio prompts. Array will be empty if none is specified. | [
"Played",
"when",
"all",
"data",
"entry",
"attempts",
"have",
"failed",
".",
"<p",
">",
"Consists",
"of",
"one",
"or",
"more",
"audio",
"segments",
".",
"No",
"default",
".",
"<",
"/",
"p",
">"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/pkg/au/pr/PlayRecordContext.java#L140-L143 | train | Get the failure announcement segments. | Of course, here is the Java code you requested:
```java
private String[] getFailureAnnouncementSegments() {
String value = Optional.fromNullable(getParameter(SignalParameters.FAILURE_ANNOUNCEMENT.symbol())).or("");
return value.isEmpty() ? new String[0] : value.split(",");
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.