repo stringclasses 199
values | path stringlengths 28 169 | func_name stringlengths 6 98 | original_string stringlengths 91 27.2k | language stringclasses 1
value | code stringlengths 91 27.2k | code_tokens listlengths 21 5.01k | docstring stringlengths 1 6.47k | docstring_tokens listlengths 1 587 | sha stringclasses 199
values | url stringlengths 117 257 | partition stringclasses 1
value | summary stringlengths 3 207 | output stringlengths 170 27.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arnohaase/a-foundation | a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/LocalQueue.java | LocalQueue.popFifo | Runnable popFifo () {
long _base, _top;
while (true) {
// reading 'base' with volatile semantics emits the necessary barriers to ensure visibility of 'top'
_base = UNSAFE.getLongVolatile (this, OFFS_BASE);
_top = top;
if (_base == _top) {
... | java | Runnable popFifo () {
long _base, _top;
while (true) {
// reading 'base' with volatile semantics emits the necessary barriers to ensure visibility of 'top'
_base = UNSAFE.getLongVolatile (this, OFFS_BASE);
_top = top;
if (_base == _top) {
... | [
"Runnable",
"popFifo",
"(",
")",
"{",
"long",
"_base",
",",
"_top",
";",
"while",
"(",
"true",
")",
"{",
"// reading 'base' with volatile semantics emits the necessary barriers to ensure visibility of 'top'",
"_base",
"=",
"UNSAFE",
".",
"getLongVolatile",
"(",
"this",
... | Fetch (and remove) a task from the bottom of the queue, i.e. FIFO semantics. This method can be called by any thread. | [
"Fetch",
"(",
"and",
"remove",
")",
"a",
"task",
"from",
"the",
"bottom",
"of",
"the",
"queue",
"i",
".",
"e",
".",
"FIFO",
"semantics",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"any",
"thread",
"."
] | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/LocalQueue.java#L115-L143 | test | Pop a Runnable from the queue. | Of course, here is the Java code you requested:
```java
Runnable popFifo () {
long _base, _top;
while (true) {
// reading 'base' with volatile semantics emits the necessary barriers to ensure visibility of 'top'
_base = UNSAFE.getLongVolatile (this, OFFS_BASE);
_top... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/util/SwingUtils.java | SwingUtils.getComponentMap | public static Map<JComponent, List<JComponent>> getComponentMap(
JComponent container, boolean nested) {
HashMap<JComponent, List<JComponent>> retVal =
new HashMap<JComponent, List<JComponent>>();
for (JComponent component : getDescendantsOfType(JComponent.class,
container, ... | java | public static Map<JComponent, List<JComponent>> getComponentMap(
JComponent container, boolean nested) {
HashMap<JComponent, List<JComponent>> retVal =
new HashMap<JComponent, List<JComponent>>();
for (JComponent component : getDescendantsOfType(JComponent.class,
container, ... | [
"public",
"static",
"Map",
"<",
"JComponent",
",",
"List",
"<",
"JComponent",
">",
">",
"getComponentMap",
"(",
"JComponent",
"container",
",",
"boolean",
"nested",
")",
"{",
"HashMap",
"<",
"JComponent",
",",
"List",
"<",
"JComponent",
">",
">",
"retVal",
... | Convenience method for mapping a container in the hierarchy to its
contained components. The keys are the containers, and the values
are lists of contained components.
<P>
Implementation note: The returned value is a HashMap and the values
are of type ArrayList. This is subject to change, so callers should
code agai... | [
"Convenience",
"method",
"for",
"mapping",
"a",
"container",
"in",
"the",
"hierarchy",
"to",
"its",
"contained",
"components",
".",
"The",
"keys",
"are",
"the",
"containers",
"and",
"the",
"values",
"are",
"lists",
"of",
"contained",
"components",
".",
"<P",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/util/SwingUtils.java#L287-L303 | test | Get the component map. | Of course, here is the Java code you requested:
```java
public static Map<JComponent, List<JComponent>> getComponentMap(
JComponent container, boolean nested) {
HashMap<JComponent, List<JComponent>> retVal =
new HashMap<JComponent, List<JComponent>>();
for (JComponent component : getDe... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMatchStatement.java | OMatchStatement.addSingleResult | private boolean addSingleResult(OSQLAsynchQuery<ODocument> request, OBasicCommandContext ctx, ORecord record) {
if (((OBasicCommandContext) context).addToUniqueResult(record)) {
request.getResultListener().result(record);
long currentCount = ctx.getResultsProcessed().incrementAndGet();
long limitV... | java | private boolean addSingleResult(OSQLAsynchQuery<ODocument> request, OBasicCommandContext ctx, ORecord record) {
if (((OBasicCommandContext) context).addToUniqueResult(record)) {
request.getResultListener().result(record);
long currentCount = ctx.getResultsProcessed().incrementAndGet();
long limitV... | [
"private",
"boolean",
"addSingleResult",
"(",
"OSQLAsynchQuery",
"<",
"ODocument",
">",
"request",
",",
"OBasicCommandContext",
"ctx",
",",
"ORecord",
"record",
")",
"{",
"if",
"(",
"(",
"(",
"OBasicCommandContext",
")",
"context",
")",
".",
"addToUniqueResult",
... | @param request
@param ctx
@param record
@return false if limit was reached | [
"@param",
"request",
"@param",
"ctx",
"@param",
"record"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMatchStatement.java#L1027-L1040 | test | Add a single result to the unique result set. | Of course, here is the Java code you requested:
```java
private boolean addSingleResult(OSQLAsynchQuery<ODocument> request, OBasicCommandContext ctx, ORecord record) {
if (((OBasicCommandContext) context).addToUniqueResult(record)) {
request.getResultListener().result(record);
long currentCount = ctx.g... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/csiv2/CSIv2Util.java | CSIv2Util.createTargetSupports | public static int createTargetSupports(IORTransportConfigMetaData tc) {
int supports = 0;
if (tc != null) {
if (!tc.getIntegrity().equals(IORTransportConfigMetaData.INTEGRITY_NONE)) {
supports = supports | Integrity.value;
}
if (!tc.getConfidentiality... | java | public static int createTargetSupports(IORTransportConfigMetaData tc) {
int supports = 0;
if (tc != null) {
if (!tc.getIntegrity().equals(IORTransportConfigMetaData.INTEGRITY_NONE)) {
supports = supports | Integrity.value;
}
if (!tc.getConfidentiality... | [
"public",
"static",
"int",
"createTargetSupports",
"(",
"IORTransportConfigMetaData",
"tc",
")",
"{",
"int",
"supports",
"=",
"0",
";",
"if",
"(",
"tc",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"tc",
".",
"getIntegrity",
"(",
")",
".",
"equals",
"(",
"I... | <p>
Create the bitmask of what the target supports.
</p>
@param tc the transport configuration metadata.
@return an {@code int} representing the transport mechanisms supported by the target. | [
"<p",
">",
"Create",
"the",
"bitmask",
"of",
"what",
"the",
"target",
"supports",
".",
"<",
"/",
"p",
">"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/csiv2/CSIv2Util.java#L444-L469 | test | Create the target supports attribute of the tc object. | Of course, here is the Java code you requested:
```java
public static int createTargetSupports(IORTransportConfigMetaData tc) {
int supports = 0;
if (tc != null) {
if (!tc.getIntegrity().equals(IORTransportConfigMetaData.INTEGRITY_NONE)) {
supports = supports | Integrity.va... |
deeplearning4j/nd4j | nd4j-serde/nd4j-kryo/src/main/java/org/nd4j/Nd4jSerializer.java | Nd4jSerializer.read | @Override
public INDArray read(Kryo kryo, Input input, Class<INDArray> type) {
DataInputStream dis = new DataInputStream(input);
try {
return Nd4j.read(dis);
} catch (IOException e) {
throw new RuntimeException(e);
}
//Note: input should NOT be closed ... | java | @Override
public INDArray read(Kryo kryo, Input input, Class<INDArray> type) {
DataInputStream dis = new DataInputStream(input);
try {
return Nd4j.read(dis);
} catch (IOException e) {
throw new RuntimeException(e);
}
//Note: input should NOT be closed ... | [
"@",
"Override",
"public",
"INDArray",
"read",
"(",
"Kryo",
"kryo",
",",
"Input",
"input",
",",
"Class",
"<",
"INDArray",
">",
"type",
")",
"{",
"DataInputStream",
"dis",
"=",
"new",
"DataInputStream",
"(",
"input",
")",
";",
"try",
"{",
"return",
"Nd4j"... | Reads bytes and returns a new object of the specified concrete opType.
<p>
Before Kryo can be used to read child objects, {@link Kryo#reference(Object)} must be called with the parent object to
ensure it can be referenced by the child objects. Any serializer that uses {@link Kryo} to read a child object may need to
be ... | [
"Reads",
"bytes",
"and",
"returns",
"a",
"new",
"object",
"of",
"the",
"specified",
"concrete",
"opType",
".",
"<p",
">",
"Before",
"Kryo",
"can",
"be",
"used",
"to",
"read",
"child",
"objects",
"{",
"@link",
"Kryo#reference",
"(",
"Object",
")",
"}",
"m... | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-serde/nd4j-kryo/src/main/java/org/nd4j/Nd4jSerializer.java#L54-L63 | test | Read a CRAID SECTYPE vector from the input | Of course, here is the Java code you requested:
```java
@Override
public INDArray read(Kryo kryo, Input input, Class<INDArray> type) {
DataInputStream dis = new DataInputStream(input);
try {
return Nd4j.read(dis);
} catch (IOException e) {
throw new RuntimeException(... |
js-lib-com/tiny-container | src/main/java/js/container/Container.java | Container.pojoStaticInitialization | private static void pojoStaticInitialization(Config config) throws ConfigException {
Config pojoClassesSection = config.getChild("pojo-classes");
if (pojoClassesSection == null) {
return;
}
for (Config pojoClassElement : pojoClassesSection.getChildren()) {
String pojoClassName = pojoClassElement.g... | java | private static void pojoStaticInitialization(Config config) throws ConfigException {
Config pojoClassesSection = config.getChild("pojo-classes");
if (pojoClassesSection == null) {
return;
}
for (Config pojoClassElement : pojoClassesSection.getChildren()) {
String pojoClassName = pojoClassElement.g... | [
"private",
"static",
"void",
"pojoStaticInitialization",
"(",
"Config",
"config",
")",
"throws",
"ConfigException",
"{",
"Config",
"pojoClassesSection",
"=",
"config",
".",
"getChild",
"(",
"\"pojo-classes\"",
")",
";",
"if",
"(",
"pojoClassesSection",
"==",
"null",... | Plain Java objects static initialization. Inject static fields value into arbitrary Java classes. Note that this
mechanism is not related to managed classes; it acts on regular Java classes and only on static fields.
<p>
Here is a sample configuration for Java objects static injection. There is <code>pojo-classes</code... | [
"Plain",
"Java",
"objects",
"static",
"initialization",
".",
"Inject",
"static",
"fields",
"value",
"into",
"arbitrary",
"Java",
"classes",
".",
"Note",
"that",
"this",
"mechanism",
"is",
"not",
"related",
"to",
"managed",
"classes",
";",
"it",
"acts",
"on",
... | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/Container.java#L947-L990 | test | Creates the POJO static initialization section. | Of course, here is the Java code you requested:
```java
private static void pojoStaticInitialization(Config config) throws ConfigException {
Config pojoClassesSection = config.getChild("pojo-classes");
if (pojoClassesSection == null) {
return;
}
for (Config pojoClassElement : pojoClassesSection.getCh... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/ABaseSQLUtil.java | ABaseSQLUtil.closeConnection | public void closeConnection() {
if(this.connection == null) {
return;
}
try {
if(this.connection.isClosed()) {
return;
}
this.connection.close();
} catch (SQLException sqlExcept) {
throw new FluidSQLException(sqlExcept);
}
} | java | public void closeConnection() {
if(this.connection == null) {
return;
}
try {
if(this.connection.isClosed()) {
return;
}
this.connection.close();
} catch (SQLException sqlExcept) {
throw new FluidSQLException(sqlExcept);
}
} | [
"public",
"void",
"closeConnection",
"(",
")",
"{",
"if",
"(",
"this",
".",
"connection",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"if",
"(",
"this",
".",
"connection",
".",
"isClosed",
"(",
")",
")",
"{",
"return",
";",
"}",
"this",... | Close the SQL Connection. | [
"Close",
"the",
"SQL",
"Connection",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/ABaseSQLUtil.java#L109-L123 | test | Close the connection. | Of course, here is the Java code you requested:
```java
public void closeConnection() {
if(this.connection == null) {
return;
}
try {
if(this.connection.isClosed()) {
return;
}
this.connection.close();
} catch (SQLException sqlExcept) {
throw new FluidSQLException(sqlExcept);
}
}
```
H... |
lessthanoptimal/GeoRegression | main/src/georegression/struct/se/SpecialEuclideanOps_F64.java | SpecialEuclideanOps_F64.axisXyz | public static Se3_F64 axisXyz(double dx, double dy, double dz, double rotX, double rotY, double rotZ,
Se3_F64 se) {
if( se == null )
se = new Se3_F64();
double theta = Math.sqrt(rotX*rotX + rotY+rotY + rotZ*rotZ);
if( theta == 0 ) {
CommonOps_DDRM.setIdentity(se.R);
} else {
ConvertRotation3... | java | public static Se3_F64 axisXyz(double dx, double dy, double dz, double rotX, double rotY, double rotZ,
Se3_F64 se) {
if( se == null )
se = new Se3_F64();
double theta = Math.sqrt(rotX*rotX + rotY+rotY + rotZ*rotZ);
if( theta == 0 ) {
CommonOps_DDRM.setIdentity(se.R);
} else {
ConvertRotation3... | [
"public",
"static",
"Se3_F64",
"axisXyz",
"(",
"double",
"dx",
",",
"double",
"dy",
",",
"double",
"dz",
",",
"double",
"rotX",
",",
"double",
"rotY",
",",
"double",
"rotZ",
",",
"Se3_F64",
"se",
")",
"{",
"if",
"(",
"se",
"==",
"null",
")",
"se",
... | Create SE3 using axis-angle for rotation and XYZ tanslation
@param dx Translation along x-axis.
@param dy Translation along y-axis.
@param dz Translation along z-axis.
@param rotX x-axis component
@param rotY y-axis component
@param rotZ z-axis component
@param se If not null then the transform is written here... | [
"Create",
"SE3",
"using",
"axis",
"-",
"angle",
"for",
"rotation",
"and",
"XYZ",
"tanslation"
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/struct/se/SpecialEuclideanOps_F64.java#L217-L234 | test | Computes the 3D axis of a Se3_F64 image | Of course, here is the Java code you requested:
```java
public static Se3_F64 axisXyz(double dx, double dy, double dz, double rotX, double rotY, double rotZ,
Se3_F64 se) {
if( se == null )
se = new Se3_F64();
double theta = Math.sqrt(rotX*rotX + rotY+rotY + rotZ*rotZ);
if( theta == 0 ) {
CommonO... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java | GeometryMetadataDataSource.update | public boolean update(GeometryMetadata metadata) {
String whereClause = GeometryMetadata.COLUMN_GEOPACKAGE_ID
+ " = ? AND " + GeometryMetadata.COLUMN_TABLE_NAME + " = ? AND "
+ GeometryMetadata.COLUMN_ID + " = ?";
String[] whereArgs = new String[]{String.valueOf(metadata.... | java | public boolean update(GeometryMetadata metadata) {
String whereClause = GeometryMetadata.COLUMN_GEOPACKAGE_ID
+ " = ? AND " + GeometryMetadata.COLUMN_TABLE_NAME + " = ? AND "
+ GeometryMetadata.COLUMN_ID + " = ?";
String[] whereArgs = new String[]{String.valueOf(metadata.... | [
"public",
"boolean",
"update",
"(",
"GeometryMetadata",
"metadata",
")",
"{",
"String",
"whereClause",
"=",
"GeometryMetadata",
".",
"COLUMN_GEOPACKAGE_ID",
"+",
"\" = ? AND \"",
"+",
"GeometryMetadata",
".",
"COLUMN_TABLE_NAME",
"+",
"\" = ? AND \"",
"+",
"GeometryMeta... | Update the geometry metadata
@param metadata geometry metadata
@return updated flag | [
"Update",
"the",
"geometry",
"metadata"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java#L276-L294 | test | Update the GeometryMetadata object | Of course, here is the Java code you requested:
```java
public boolean update(GeometryMetadata metadata) {
String whereClause = GeometryMetadata.COLUMN_GEOPACKAGE_ID
+ " = ? AND " + GeometryMetadata.COLUMN_TABLE_NAME + " = ? AND "
+ GeometryMetadata.COLUMN_ID + " = ?";
S... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNCtx.java | CNCtx.createUsingURL | public static ResolveResult createUsingURL(String url, Hashtable env)
throws NamingException {
CNCtx ctx = new CNCtx();
if (env != null) {
env = (Hashtable) env.clone();
}
ctx._env = env;
String rest = ctx.initUsingUrl(env != null ? (org.omg.CORBA.ORB) env... | java | public static ResolveResult createUsingURL(String url, Hashtable env)
throws NamingException {
CNCtx ctx = new CNCtx();
if (env != null) {
env = (Hashtable) env.clone();
}
ctx._env = env;
String rest = ctx.initUsingUrl(env != null ? (org.omg.CORBA.ORB) env... | [
"public",
"static",
"ResolveResult",
"createUsingURL",
"(",
"String",
"url",
",",
"Hashtable",
"env",
")",
"throws",
"NamingException",
"{",
"CNCtx",
"ctx",
"=",
"new",
"CNCtx",
"(",
")",
";",
"if",
"(",
"env",
"!=",
"null",
")",
"{",
"env",
"=",
"(",
... | This method is used by the iiop and iiopname URL Context factories. | [
"This",
"method",
"is",
"used",
"by",
"the",
"iiop",
"and",
"iiopname",
"URL",
"Context",
"factories",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNCtx.java#L108-L124 | test | Create a new CNCtx using the URL. | Of course, here is the Java code you requested:
```java
public static ResolveResult createUsingURL(String url, Hashtable env)
throws NamingException {
CNCtx ctx = new CNCtx();
if (env != null) {
env = (Hashtable) env.clone();
}
ctx._env = env;
String rest... |
vdmeer/execs | src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java | Gen_ExecJarScripts.inExecJar | protected boolean inExecJar(){
Class<Gen_ExecJarScripts> clazz = Gen_ExecJarScripts.class;
String className = clazz.getSimpleName() + ".class";
String classPath = clazz.getResource(className).toString();
if (!classPath.startsWith("jar")) {
System.err.println(this.getAppName() + ": not started in a jar, ... | java | protected boolean inExecJar(){
Class<Gen_ExecJarScripts> clazz = Gen_ExecJarScripts.class;
String className = clazz.getSimpleName() + ".class";
String classPath = clazz.getResource(className).toString();
if (!classPath.startsWith("jar")) {
System.err.println(this.getAppName() + ": not started in a jar, ... | [
"protected",
"boolean",
"inExecJar",
"(",
")",
"{",
"Class",
"<",
"Gen_ExecJarScripts",
">",
"clazz",
"=",
"Gen_ExecJarScripts",
".",
"class",
";",
"String",
"className",
"=",
"clazz",
".",
"getSimpleName",
"(",
")",
"+",
"\".class\"",
";",
"String",
"classPat... | Tests if the class is run from an executable JAR.
@return true if run from an executable JAR (JAR with Main-Class in manifest), false otherwise with errors printed | [
"Tests",
"if",
"the",
"class",
"is",
"run",
"from",
"an",
"executable",
"JAR",
"."
] | ac73170bfd449de1f460248d56ece57ff3b0c761 | https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java#L177-L201 | test | Returns true if the application is in an executable JAR. | Of course, here is the Java code you requested:
```java
protected boolean inExecJar(){
Class<Gen_ExecJarScripts> clazz = Gen_ExecJarScripts.class;
String className = clazz.getSimpleName() + ".class";
String classPath = clazz.getResource(className).toString();
if (!classPath.startsWith("jar")) {
System.... |
RestComm/jain-slee | api/jar/src/main/java/javax/slee/usage/UsageThresholdFilter.java | UsageThresholdFilter.isNotificationEnabled | public boolean isNotificationEnabled(Notification notification) {
if (!(notification instanceof UsageNotification)) return false;
UsageNotification usageNotification = (UsageNotification)notification;
if (service != null) {
// SLEE 1.0 comparison
if (!service.equals(usag... | java | public boolean isNotificationEnabled(Notification notification) {
if (!(notification instanceof UsageNotification)) return false;
UsageNotification usageNotification = (UsageNotification)notification;
if (service != null) {
// SLEE 1.0 comparison
if (!service.equals(usag... | [
"public",
"boolean",
"isNotificationEnabled",
"(",
"Notification",
"notification",
")",
"{",
"if",
"(",
"!",
"(",
"notification",
"instanceof",
"UsageNotification",
")",
")",
"return",
"false",
";",
"UsageNotification",
"usageNotification",
"=",
"(",
"UsageNotificatio... | Determine whether the specified notification should be delivered to notification
listeners using this notification filter.
@param notification the notification to be sent.
@return <code>true</code> if the notification should be delivered to notification
listeners, <code>false</code> otherwise. This method always retur... | [
"Determine",
"whether",
"the",
"specified",
"notification",
"should",
"be",
"delivered",
"to",
"notification",
"listeners",
"using",
"this",
"notification",
"filter",
"."
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/usage/UsageThresholdFilter.java#L103-L131 | test | Check if the notification is enabled. | Of course, here is the Java code you requested:
```java
public boolean isNotificationEnabled(Notification notification) {
if (!(notification instanceof UsageNotification)) return false;
UsageNotification usageNotification = (UsageNotification)notification;
if (service != null) {
//... |
rockagen/commons-lib | src/main/java/com/rockagen/commons/util/XmlUtil.java | XmlUtil.formatCompact | public static String formatCompact(String xmlStr, String enc,
boolean isSuppressDeclaration) {
if (CommUtil.isBlank(xmlStr))
return xmlStr;
if (enc == null)
enc = ENCODING;
OutputFormat formater = OutputFormat.createCompactFormat(... | java | public static String formatCompact(String xmlStr, String enc,
boolean isSuppressDeclaration) {
if (CommUtil.isBlank(xmlStr))
return xmlStr;
if (enc == null)
enc = ENCODING;
OutputFormat formater = OutputFormat.createCompactFormat(... | [
"public",
"static",
"String",
"formatCompact",
"(",
"String",
"xmlStr",
",",
"String",
"enc",
",",
"boolean",
"isSuppressDeclaration",
")",
"{",
"if",
"(",
"CommUtil",
".",
"isBlank",
"(",
"xmlStr",
")",
")",
"return",
"xmlStr",
";",
"if",
"(",
"enc",
"=="... | Format xml {@link OutputFormat#createCompactFormat()}
@param xmlStr xml String
@param enc encoding
@param isSuppressDeclaration set supperss declaration
@return Compact xml String | [
"Format",
"xml",
"{",
"@link",
"OutputFormat#createCompactFormat",
"()",
"}"
] | f37141cf40be79d130db804c39ce61690541d5f1 | https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/util/XmlUtil.java#L115-L128 | test | Format a XML string using the XML compact format. | Of course, here is the Java code you requested:
```java
public static String formatCompact(String xmlStr, String enc,
boolean isSuppressDeclaration) {
if (CommUtil.isBlank(xmlStr))
return xmlStr;
if (enc == null)
enc = ENCODING;
... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/InstructionCompiler.java | InstructionCompiler.gatherPositionAndOccurrenceInfo | private void gatherPositionAndOccurrenceInfo(Term clause)
{
PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl();
PositionAndOccurrenceVisitor positionAndOccurrenceVisitor =
new PositionAndOccurrenceVisitor(interner, symbolTable, positionalTraverser);
p... | java | private void gatherPositionAndOccurrenceInfo(Term clause)
{
PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl();
PositionAndOccurrenceVisitor positionAndOccurrenceVisitor =
new PositionAndOccurrenceVisitor(interner, symbolTable, positionalTraverser);
p... | [
"private",
"void",
"gatherPositionAndOccurrenceInfo",
"(",
"Term",
"clause",
")",
"{",
"PositionalTermTraverser",
"positionalTraverser",
"=",
"new",
"PositionalTermTraverserImpl",
"(",
")",
";",
"PositionAndOccurrenceVisitor",
"positionAndOccurrenceVisitor",
"=",
"new",
"Posi... | Gather information about variable counts and positions of occurrence of constants and variable within a clause.
@param clause The clause to check the variable occurrence and position of occurrence within. | [
"Gather",
"information",
"about",
"variable",
"counts",
"and",
"positions",
"of",
"occurrence",
"of",
"constants",
"and",
"variable",
"within",
"a",
"clause",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/InstructionCompiler.java#L958-L970 | test | Gathers position and occurrence information from a clause. | Of course, here is the Java code you requested:
```java
private void gatherPositionAndOccurrenceInfo(Term clause)
{
PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl();
PositionAndOccurrenceVisitor positionAndOccurrenceVisitor =
new PositionAndOccurrenceVisit... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java | Eigen.eigenvalues | public static IComplexNDArray eigenvalues(INDArray A) {
assert A.rows() == A.columns();
INDArray WR = Nd4j.create(A.rows(), A.rows());
INDArray WI = WR.dup();
Nd4j.getBlasWrapper().geev('N', 'N', A.dup(), WR, WI, dummy, dummy);
return Nd4j.createComplex(WR, WI);
} | java | public static IComplexNDArray eigenvalues(INDArray A) {
assert A.rows() == A.columns();
INDArray WR = Nd4j.create(A.rows(), A.rows());
INDArray WI = WR.dup();
Nd4j.getBlasWrapper().geev('N', 'N', A.dup(), WR, WI, dummy, dummy);
return Nd4j.createComplex(WR, WI);
} | [
"public",
"static",
"IComplexNDArray",
"eigenvalues",
"(",
"INDArray",
"A",
")",
"{",
"assert",
"A",
".",
"rows",
"(",
")",
"==",
"A",
".",
"columns",
"(",
")",
";",
"INDArray",
"WR",
"=",
"Nd4j",
".",
"create",
"(",
"A",
".",
"rows",
"(",
")",
","... | Computes the eigenvalues of a general matrix. | [
"Computes",
"the",
"eigenvalues",
"of",
"a",
"general",
"matrix",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/eigen/Eigen.java#L39-L45 | test | Computes the eigenvalues of a matrix | Of course, here is the Java code you requested:
```java
public static IComplexNDArray eigenvalues(INDArray A) {
assert A.rows() == A.columns();
INDArray WR = Nd4j.create(A.rows(), A.rows());
INDArray WI = WR.dup();
Nd4j.getBlasWrapper().geev('N', 'N', A.dup(), WR, WI, dummy, dummy);
... |
medcl/elasticsearch-analysis-ik | src/main/java/org/wltea/analyzer/core/CJKSegmenter.java | CJKSegmenter.analyze | public void analyze(AnalyzeContext context) {
if(CharacterUtil.CHAR_USELESS != context.getCurrentCharType()){
//优先处理tmpHits中的hit
if(!this.tmpHits.isEmpty()){
//处理词段队列
Hit[] tmpArray = this.tmpHits.toArray(new Hit[this.tmpHits.size()]);
for(Hit hit : tmpArray){
hit = Dictionary.getSi... | java | public void analyze(AnalyzeContext context) {
if(CharacterUtil.CHAR_USELESS != context.getCurrentCharType()){
//优先处理tmpHits中的hit
if(!this.tmpHits.isEmpty()){
//处理词段队列
Hit[] tmpArray = this.tmpHits.toArray(new Hit[this.tmpHits.size()]);
for(Hit hit : tmpArray){
hit = Dictionary.getSi... | [
"public",
"void",
"analyze",
"(",
"AnalyzeContext",
"context",
")",
"{",
"if",
"(",
"CharacterUtil",
".",
"CHAR_USELESS",
"!=",
"context",
".",
"getCurrentCharType",
"(",
")",
")",
"{",
"//优先处理tmpHits中的hit\r",
"if",
"(",
"!",
"this",
".",
"tmpHits",
".",
"is... | /* (non-Javadoc)
@see org.wltea.analyzer.core.ISegmenter#analyze(org.wltea.analyzer.core.AnalyzeContext) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | a1d6ba8ca206d750e68bbf3e53a25284100174bd | https://github.com/medcl/elasticsearch-analysis-ik/blob/a1d6ba8ca206d750e68bbf3e53a25284100174bd/src/main/java/org/wltea/analyzer/core/CJKSegmenter.java#L53-L116 | test | Analyze the segment. | Of course, here is the Java code you requested:
```java
public void analyze(AnalyzeContext context) {
if(CharacterUtil.CHAR_USELESS != context.getCurrentCharType()){
//优先处理tmpHits中的hit
if(!this.tmpHits.isEmpty()){
//处理词段队列
Hit[] tmpArray = this.tmpHits.toArray(new Hit[this.tmpHits.size()]);
... |
vigna/fastutil | src/it/unimi/dsi/fastutil/io/InspectableFileCachedInputStream.java | InspectableFileCachedInputStream.write | @Override
public int write(final ByteBuffer byteBuffer) throws IOException {
ensureOpen();
final int remaining = byteBuffer.remaining();
if (inspectable < buffer.length) {
// Still some space in the inspectable buffer.
final int toBuffer = Math.min(buffer.length - inspectable, remaining);
byteBuffer.ge... | java | @Override
public int write(final ByteBuffer byteBuffer) throws IOException {
ensureOpen();
final int remaining = byteBuffer.remaining();
if (inspectable < buffer.length) {
// Still some space in the inspectable buffer.
final int toBuffer = Math.min(buffer.length - inspectable, remaining);
byteBuffer.ge... | [
"@",
"Override",
"public",
"int",
"write",
"(",
"final",
"ByteBuffer",
"byteBuffer",
")",
"throws",
"IOException",
"{",
"ensureOpen",
"(",
")",
";",
"final",
"int",
"remaining",
"=",
"byteBuffer",
".",
"remaining",
"(",
")",
";",
"if",
"(",
"inspectable",
... | Appends the content of a specified buffer to the end of the currently represented stream.
@param byteBuffer a byte buffer.
@return the number of bytes appended (i.e., {@link ByteBuffer#remaining() byteBuffer.remaining()}). | [
"Appends",
"the",
"content",
"of",
"a",
"specified",
"buffer",
"to",
"the",
"end",
"of",
"the",
"currently",
"represented",
"stream",
"."
] | 192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c | https://github.com/vigna/fastutil/blob/192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c/src/it/unimi/dsi/fastutil/io/InspectableFileCachedInputStream.java#L138-L156 | test | Write a ByteBuffer to the underlying file. | Of course, here is the Java code you requested:
```java
@Override
public int write(final ByteBuffer byteBuffer) throws IOException {
ensureOpen();
final int remaining = byteBuffer.remaining();
if (inspectable < buffer.length) {
// Still some space in the inspectable buffer.
final int toBuffer = Math.min(... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/authentication/session/AbstractSessionFixationProtectionStrategy.java | AbstractSessionFixationProtectionStrategy.onAuthentication | public void onAuthentication(Authentication authentication,
HttpServletRequest request, HttpServletResponse response) {
boolean hadSessionAlready = request.getSession(false) != null;
if (!hadSessionAlready && !alwaysCreateSession) {
// Session fixation isn't a problem if there's no session
return;
}
... | java | public void onAuthentication(Authentication authentication,
HttpServletRequest request, HttpServletResponse response) {
boolean hadSessionAlready = request.getSession(false) != null;
if (!hadSessionAlready && !alwaysCreateSession) {
// Session fixation isn't a problem if there's no session
return;
}
... | [
"public",
"void",
"onAuthentication",
"(",
"Authentication",
"authentication",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"boolean",
"hadSessionAlready",
"=",
"request",
".",
"getSession",
"(",
"false",
")",
"!=",
"null",
... | Called when a user is newly authenticated.
<p>
If a session already exists, and matches the session Id from the client, a new
session will be created, and the session attributes copied to it (if
{@code migrateSessionAttributes} is set). If the client's requested session Id is
invalid, nothing will be done, since there ... | [
"Called",
"when",
"a",
"user",
"is",
"newly",
"authenticated",
".",
"<p",
">",
"If",
"a",
"session",
"already",
"exists",
"and",
"matches",
"the",
"session",
"Id",
"from",
"the",
"client",
"a",
"new",
"session",
"will",
"be",
"created",
"and",
"the",
"se... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/session/AbstractSessionFixationProtectionStrategy.java#L65-L98 | test | This method is called when the user has been authenticated. | Of course, here is the Java code you requested:
```java
public void onAuthentication(Authentication authentication,
HttpServletRequest request, HttpServletResponse response) {
boolean hadSessionAlready = request.getSession(false) != null;
if (!hadSessionAlready && !alwaysCreateSession) {
// Session fixation... |
eclipse/packagedrone | bundles/org.tukani.xz/src/org/tukaani/xz/LZMA2Options.java | LZMA2Options.setMode | public void setMode(int mode) throws UnsupportedOptionsException {
if (mode < MODE_UNCOMPRESSED || mode > MODE_NORMAL)
throw new UnsupportedOptionsException(
"Unsupported compression mode: " + mode);
this.mode = mode;
} | java | public void setMode(int mode) throws UnsupportedOptionsException {
if (mode < MODE_UNCOMPRESSED || mode > MODE_NORMAL)
throw new UnsupportedOptionsException(
"Unsupported compression mode: " + mode);
this.mode = mode;
} | [
"public",
"void",
"setMode",
"(",
"int",
"mode",
")",
"throws",
"UnsupportedOptionsException",
"{",
"if",
"(",
"mode",
"<",
"MODE_UNCOMPRESSED",
"||",
"mode",
">",
"MODE_NORMAL",
")",
"throw",
"new",
"UnsupportedOptionsException",
"(",
"\"Unsupported compression mode:... | Sets the compression mode.
<p>
This specifies the method to analyze the data produced by
a match finder. The default is <code>MODE_FAST</code> for presets
0-3 and <code>MODE_NORMAL</code> for presets 4-9.
<p>
Usually <code>MODE_FAST</code> is used with Hash Chain match finders
and <code>MODE_NORMAL</code> with Binary T... | [
"Sets",
"the",
"compression",
"mode",
".",
"<p",
">",
"This",
"specifies",
"the",
"method",
"to",
"analyze",
"the",
"data",
"produced",
"by",
"a",
"match",
"finder",
".",
"The",
"default",
"is",
"<code",
">",
"MODE_FAST<",
"/",
"code",
">",
"for",
"prese... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.tukani.xz/src/org/tukaani/xz/LZMA2Options.java#L422-L428 | test | Sets the compression mode. | Of course, here is the Java code you requested:
```java
public void setMode(int mode) throws UnsupportedOptionsException {
if (mode < MODE_UNCOMPRESSED || mode > MODE_NORMAL)
throw new UnsupportedOptionsException(
"Unsupported compression mode: " + mode);
this.mode = mo... |
dschulten/hydra-java | hydra-spring/src/main/java/de/escalon/hypermedia/spring/hydra/LinkListSerializer.java | LinkListSerializer.getExposedPropertyOrParamName | private String getExposedPropertyOrParamName(ActionInputParameter inputParameter) {
final Expose expose = inputParameter.getAnnotation(Expose.class);
String property;
if (expose != null) {
property = expose.value();
} else {
property = inputParameter.getParameterN... | java | private String getExposedPropertyOrParamName(ActionInputParameter inputParameter) {
final Expose expose = inputParameter.getAnnotation(Expose.class);
String property;
if (expose != null) {
property = expose.value();
} else {
property = inputParameter.getParameterN... | [
"private",
"String",
"getExposedPropertyOrParamName",
"(",
"ActionInputParameter",
"inputParameter",
")",
"{",
"final",
"Expose",
"expose",
"=",
"inputParameter",
".",
"getAnnotation",
"(",
"Expose",
".",
"class",
")",
";",
"String",
"property",
";",
"if",
"(",
"e... | Gets exposed property or parameter name.
@param inputParameter for exposure
@return property name | [
"Gets",
"exposed",
"property",
"or",
"parameter",
"name",
"."
] | 21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a | https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/hydra-spring/src/main/java/de/escalon/hypermedia/spring/hydra/LinkListSerializer.java#L745-L754 | test | Gets the exposed property or parameter name. | Of course, here is the Java code you requested:
```java
private String getExposedPropertyOrParamName(ActionInputParameter inputParameter) {
final Expose expose = inputParameter.getAnnotation(Expose.class);
String property;
if (expose != null) {
property = expose.value();
} e... |
liveontologies/elk-reasoner | elk-util-parent/elk-util-hashing/src/main/java/org/semanticweb/elk/util/hashing/HashGenerator.java | HashGenerator.combineMultisetHash | public static <T> int combineMultisetHash(boolean finalize,
Iterator<? extends T> hashObjectIterator, Hasher<T> hasher) {
int hash = 0;
while (hashObjectIterator.hasNext()) {
hash += hasher.hash(hashObjectIterator.next());
}
if (finalize) {
hash = combineListHash(hash);
}
return hash;
} | java | public static <T> int combineMultisetHash(boolean finalize,
Iterator<? extends T> hashObjectIterator, Hasher<T> hasher) {
int hash = 0;
while (hashObjectIterator.hasNext()) {
hash += hasher.hash(hashObjectIterator.next());
}
if (finalize) {
hash = combineListHash(hash);
}
return hash;
} | [
"public",
"static",
"<",
"T",
">",
"int",
"combineMultisetHash",
"(",
"boolean",
"finalize",
",",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"hashObjectIterator",
",",
"Hasher",
"<",
"T",
">",
"hasher",
")",
"{",
"int",
"hash",
"=",
"0",
";",
"while",
... | Combine the hash codes of a collection of objects with an associative
commutative hash function. Associativity ensures that the result of this
functions can be further combined with other hash codes for getting the
same result as if all hash codes had been combined in one step.
If finalize is false, then the method as... | [
"Combine",
"the",
"hash",
"codes",
"of",
"a",
"collection",
"of",
"objects",
"with",
"an",
"associative",
"commutative",
"hash",
"function",
".",
"Associativity",
"ensures",
"that",
"the",
"result",
"of",
"this",
"functions",
"can",
"be",
"further",
"combined",
... | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-util-parent/elk-util-hashing/src/main/java/org/semanticweb/elk/util/hashing/HashGenerator.java#L203-L213 | test | Combine the hash of the given iterator with the given hasher. | Of course, here is the Java code you requested:
```java
public static <T> int combineMultisetHash(boolean finalize,
Iterator<? extends T> hashObjectIterator, Hasher<T> hasher) {
int hash = 0;
while (hashObjectIterator.hasNext()) {
hash += hasher.hash(hashObjectIterator.next());
}
if (finalize) {
hash ... |
GojaFramework/goja | goja-core/src/main/java/goja/core/kits/lang/KeyCodeKit.java | KeyCodeKit.digestPassword | private static String digestPassword(String password) {
try {
SecureRandom random = new SecureRandom();
byte[] salt = new byte[EncodeKit.SALT_SIZE];
random.nextBytes(salt);
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(salt);
... | java | private static String digestPassword(String password) {
try {
SecureRandom random = new SecureRandom();
byte[] salt = new byte[EncodeKit.SALT_SIZE];
random.nextBytes(salt);
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(salt);
... | [
"private",
"static",
"String",
"digestPassword",
"(",
"String",
"password",
")",
"{",
"try",
"{",
"SecureRandom",
"random",
"=",
"new",
"SecureRandom",
"(",
")",
";",
"byte",
"[",
"]",
"salt",
"=",
"new",
"byte",
"[",
"EncodeKit",
".",
"SALT_SIZE",
"]",
... | 加密
@param password 需要加密的字符串 | [
"加密"
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/lang/KeyCodeKit.java#L51-L71 | test | Digest password. | Of course, here is the Java code you requested:
```java
private static String digestPassword(String password) {
try {
SecureRandom random = new SecureRandom();
byte[] salt = new byte[EncodeKit.SALT_SIZE];
random.nextBytes(salt);
MessageDigest md = MessageDigest.... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/util/ABaseUtil.java | ABaseUtil.toLongSafe | protected long toLongSafe(String toParseParam) {
if (toParseParam == null || toParseParam.trim().isEmpty()) {
return -1;
}
try {
return Long.parseLong(toParseParam.trim());
} catch (NumberFormatException e) {
return -1;
}
} | java | protected long toLongSafe(String toParseParam) {
if (toParseParam == null || toParseParam.trim().isEmpty()) {
return -1;
}
try {
return Long.parseLong(toParseParam.trim());
} catch (NumberFormatException e) {
return -1;
}
} | [
"protected",
"long",
"toLongSafe",
"(",
"String",
"toParseParam",
")",
"{",
"if",
"(",
"toParseParam",
"==",
"null",
"||",
"toParseParam",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"try",
"{",
"return",
... | Returns -1 if there is a problem with conversion.
@param toParseParam The {@code String} value to convert to {@code long}.
@return {@code long} primitive version of {@code toParseParam}. | [
"Returns",
"-",
"1",
"if",
"there",
"is",
"a",
"problem",
"with",
"conversion",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/ABaseUtil.java#L113-L123 | test | toLongSafe This method is used to convert a String to a long. | Of course, here is the Java code you requested:
```java
protected long toLongSafe(String toParseParam) {
if (toParseParam == null || toParseParam.trim().isEmpty()) {
return -1;
}
try {
return Long.parseLong(toParseParam.trim());
} catch (NumberFormatException e) {
return -1;
}
}
```
Hope this hel... |
streamsets/datacollector | hdfs-protolib/src/main/java/com/streamsets/pipeline/stage/destination/hdfs/writer/RecordWriter.java | RecordWriter.getLength | public long getLength() throws IOException {
long length = -1;
if (generator != null) {
length = textOutputStream.getByteCount();
} else if (seqWriter != null) {
length = seqWriter.getLength();
}
return length;
} | java | public long getLength() throws IOException {
long length = -1;
if (generator != null) {
length = textOutputStream.getByteCount();
} else if (seqWriter != null) {
length = seqWriter.getLength();
}
return length;
} | [
"public",
"long",
"getLength",
"(",
")",
"throws",
"IOException",
"{",
"long",
"length",
"=",
"-",
"1",
";",
"if",
"(",
"generator",
"!=",
"null",
")",
"{",
"length",
"=",
"textOutputStream",
".",
"getByteCount",
"(",
")",
";",
"}",
"else",
"if",
"(",
... | buffer size. | [
"buffer",
"size",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/hdfs-protolib/src/main/java/com/streamsets/pipeline/stage/destination/hdfs/writer/RecordWriter.java#L197-L205 | test | Get the length of the sequence. | Of course, here is the Java code you requested:
```java
public long getLength() throws IOException {
long length = -1;
if (generator != null) {
length = textOutputStream.getByteCount();
} else if (seqWriter != null) {
length = seqWriter.getLength();
}
return length;
}
```
Hope this h... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/result/JsonResult.java | JsonResult.of | public static JsonResult of(final Object object) {
final String json = JsonSerializer.create().deep(true).serialize(object);
return new JsonResult(json);
} | java | public static JsonResult of(final Object object) {
final String json = JsonSerializer.create().deep(true).serialize(object);
return new JsonResult(json);
} | [
"public",
"static",
"JsonResult",
"of",
"(",
"final",
"Object",
"object",
")",
"{",
"final",
"String",
"json",
"=",
"JsonSerializer",
".",
"create",
"(",
")",
".",
"deep",
"(",
"true",
")",
".",
"serialize",
"(",
"object",
")",
";",
"return",
"new",
"J... | Creates JSON result from given object. The object will be serialized to JSON. | [
"Creates",
"JSON",
"result",
"from",
"given",
"object",
".",
"The",
"object",
"will",
"be",
"serialized",
"to",
"JSON",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/result/JsonResult.java#L57-L60 | test | Create a JsonResult from an object. | Of course, here is the Java code you requested:
```java
public static JsonResult of(final Object object) {
final String json = JsonSerializer.create().deep(true).serialize(object);
return new JsonResult(json);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/NetcdfFile.java | NetcdfFile.setDebugFlags | static public void setDebugFlags(ucar.nc2.util.DebugFlags debugFlag) {
debugSPI = debugFlag.isSet("NetcdfFile/debugSPI");
debugCompress = debugFlag.isSet("NetcdfFile/debugCompress");
debugStructureIterator = debugFlag.isSet("NetcdfFile/structureIterator");
N3header.disallowFileTruncation = debugFlag.isS... | java | static public void setDebugFlags(ucar.nc2.util.DebugFlags debugFlag) {
debugSPI = debugFlag.isSet("NetcdfFile/debugSPI");
debugCompress = debugFlag.isSet("NetcdfFile/debugCompress");
debugStructureIterator = debugFlag.isSet("NetcdfFile/structureIterator");
N3header.disallowFileTruncation = debugFlag.isS... | [
"static",
"public",
"void",
"setDebugFlags",
"(",
"ucar",
".",
"nc2",
".",
"util",
".",
"DebugFlags",
"debugFlag",
")",
"{",
"debugSPI",
"=",
"debugFlag",
".",
"isSet",
"(",
"\"NetcdfFile/debugSPI\"",
")",
";",
"debugCompress",
"=",
"debugFlag",
".",
"isSet",
... | debugging
@param debugFlag debug flags | [
"debugging"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L406-L413 | test | Set the debug flags | Of course, here is the Java code you requested:
```java
static public void setDebugFlags(ucar.nc2.util.DebugFlags debugFlag) {
debugSPI = debugFlag.isSet("NetcdfFile/debugSPI");
debugCompress = debugFlag.isSet("NetcdfFile/debugCompress");
debugStructureIterator = debugFlag.isSet("NetcdfFile/structureIterat... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java | ObjectFactory.createGrz | @XmlElementDecl(namespace = "", name = "grz")
public JAXBElement<String> createGrz(String value) {
return new JAXBElement<String>(_Grz_QNAME, String.class, null, value);
} | java | @XmlElementDecl(namespace = "", name = "grz")
public JAXBElement<String> createGrz(String value) {
return new JAXBElement<String>(_Grz_QNAME, String.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"\"",
",",
"name",
"=",
"\"grz\"",
")",
"public",
"JAXBElement",
"<",
"String",
">",
"createGrz",
"(",
"String",
"value",
")",
"{",
"return",
"new",
"JAXBElement",
"<",
"String",
">",
"(",
"_Grz_QNAME",
",",
... | Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"String",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2202-L2205 | test | Create an instance of the GRAZ JAXBElement. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "", name = "grz")
public JAXBElement<String> createGrz(String value) {
return new JAXBElement<String>(_Grz_QNAME, String.class, null, value);
}
```
Hope this helps! |
oblac/jodd | jodd-lagarto/src/main/java/jodd/csselly/selector/PseudoClassSelector.java | PseudoClassSelector.lookupPseudoClass | public static PseudoClass lookupPseudoClass(final String pseudoClassName) {
PseudoClass pseudoClass = PSEUDO_CLASS_MAP.get(pseudoClassName);
if (pseudoClass == null) {
throw new CSSellyException("Unsupported pseudo class: " + pseudoClassName);
}
return pseudoClass;
} | java | public static PseudoClass lookupPseudoClass(final String pseudoClassName) {
PseudoClass pseudoClass = PSEUDO_CLASS_MAP.get(pseudoClassName);
if (pseudoClass == null) {
throw new CSSellyException("Unsupported pseudo class: " + pseudoClassName);
}
return pseudoClass;
} | [
"public",
"static",
"PseudoClass",
"lookupPseudoClass",
"(",
"final",
"String",
"pseudoClassName",
")",
"{",
"PseudoClass",
"pseudoClass",
"=",
"PSEUDO_CLASS_MAP",
".",
"get",
"(",
"pseudoClassName",
")",
";",
"if",
"(",
"pseudoClass",
"==",
"null",
")",
"{",
"t... | Lookups pseudo class for given pseudo class name. | [
"Lookups",
"pseudo",
"class",
"for",
"given",
"pseudo",
"class",
"name",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/csselly/selector/PseudoClassSelector.java#L105-L111 | test | Lookup a pseudo class by name. | Of course, here is the Java code you requested:
```java
public static PseudoClass lookupPseudoClass(final String pseudoClassName) {
PseudoClass pseudoClass = PSEUDO_CLASS_MAP.get(pseudoClassName);
if (pseudoClass == null) {
throw new CSSellyException("Unsupported pseudo class: " + pseudoClassName);
}
return... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/ComplexUtil.java | ComplexUtil.pow | public static IComplexNumber pow(IComplexNumber num, IComplexNumber power) {
Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).pow(
new Complex(power.realComponent().doubleValue(), power.imaginaryComponent().doubleValue()));
if (c.... | java | public static IComplexNumber pow(IComplexNumber num, IComplexNumber power) {
Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).pow(
new Complex(power.realComponent().doubleValue(), power.imaginaryComponent().doubleValue()));
if (c.... | [
"public",
"static",
"IComplexNumber",
"pow",
"(",
"IComplexNumber",
"num",
",",
"IComplexNumber",
"power",
")",
"{",
"Complex",
"c",
"=",
"new",
"Complex",
"(",
"num",
".",
"realComponent",
"(",
")",
".",
"doubleValue",
"(",
")",
",",
"num",
".",
"imaginar... | Raise a complex number to a power
@param num the number to raise
@param power the power to raise to
@return the number raised to a power | [
"Raise",
"a",
"complex",
"number",
"to",
"a",
"power"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/ComplexUtil.java#L214-L221 | test | pow of two complex numbers | Of course, here is the Java code you requested:
```java
public static IComplexNumber pow(IComplexNumber num, IComplexNumber power) {
Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).pow(
new Complex(power.realComponent().doubleValue(), p... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/http/handler/ResourceProxyRequestHandler.java | ResourceProxyRequestHandler.isResourceChanged | protected boolean isResourceChanged(final HttpServletRequest request) {
try {
final long ifModifiedSince = request.getDateHeader(HttpHeader.IF_MODIFIED_SINCE.toString());
return ifModifiedSince < getHeadersConfigurer().getLastModifiedTimestamp();
} catch (final Exception e) {
LOG.warn("Could n... | java | protected boolean isResourceChanged(final HttpServletRequest request) {
try {
final long ifModifiedSince = request.getDateHeader(HttpHeader.IF_MODIFIED_SINCE.toString());
return ifModifiedSince < getHeadersConfigurer().getLastModifiedTimestamp();
} catch (final Exception e) {
LOG.warn("Could n... | [
"protected",
"boolean",
"isResourceChanged",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"try",
"{",
"final",
"long",
"ifModifiedSince",
"=",
"request",
".",
"getDateHeader",
"(",
"HttpHeader",
".",
"IF_MODIFIED_SINCE",
".",
"toString",
"(",
")",
")",... | Used to identify whether the {@link HttpServletResponse#SC_NOT_MODIFIED} or {@link HttpServletResponse#SC_OK}
should be returned. Currently a single timestamp is used to detect the change for all resources. This might be no
accurate, but at least it allows sending NOT_MODIFIED header much often resulting in less load o... | [
"Used",
"to",
"identify",
"whether",
"the",
"{",
"@link",
"HttpServletResponse#SC_NOT_MODIFIED",
"}",
"or",
"{",
"@link",
"HttpServletResponse#SC_OK",
"}",
"should",
"be",
"returned",
".",
"Currently",
"a",
"single",
"timestamp",
"is",
"used",
"to",
"detect",
"the... | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/http/handler/ResourceProxyRequestHandler.java#L113-L121 | test | Check if the resource has been modified since the last modified time. | Of course, here is the Java code you requested:
```java
protected boolean isResourceChanged(final HttpServletRequest request) {
try {
final long ifModifiedSince = request.getDateHeader(HttpHeader.IF_MODIFIED_SINCE.toString());
return ifModifiedSince < getHeadersConfigurer().getLastModifiedTimestamp();
... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.ok | public static Result ok(File content, String filename) {
return ok(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | java | public static Result ok(File content, String filename) {
return ok(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | [
"public",
"static",
"Result",
"ok",
"(",
"File",
"content",
",",
"String",
"filename",
")",
"{",
"return",
"ok",
"(",
"content",
",",
"filename",
",",
"StaticFileMimeTypes",
".",
"fileMimeTypes",
"(",
")",
")",
";",
"}"
] | Generates a 200 OK result.
@param content The file to send.
@param filename The name to send the file as.
@return the result | [
"Generates",
"a",
"200",
"OK",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L545-L547 | test | Check if content is ok. | Of course, here is the Java code you requested:
```java
public static Result ok(File content, String filename) {
return ok(content, filename, StaticFileMimeTypes.fileMimeTypes());
}
```
Hope this helps! |
oblac/jodd | jodd-proxetta/src/main/java/jodd/proxetta/asm/TargetClassInfoReader.java | TargetClassInfoReader.visitEnd | @Override
public void visitEnd() {
// prepare class annotations
if (classAnnotations != null) {
annotations = classAnnotations.toArray(new AnnotationInfo[0]);
classAnnotations = null;
}
List<String> superList = new ArrayList<>();
Set<String> allInterfaces = new HashSet<>();
if (nextInterfaces != ... | java | @Override
public void visitEnd() {
// prepare class annotations
if (classAnnotations != null) {
annotations = classAnnotations.toArray(new AnnotationInfo[0]);
classAnnotations = null;
}
List<String> superList = new ArrayList<>();
Set<String> allInterfaces = new HashSet<>();
if (nextInterfaces != ... | [
"@",
"Override",
"public",
"void",
"visitEnd",
"(",
")",
"{",
"// prepare class annotations",
"if",
"(",
"classAnnotations",
"!=",
"null",
")",
"{",
"annotations",
"=",
"classAnnotations",
".",
"toArray",
"(",
"new",
"AnnotationInfo",
"[",
"0",
"]",
")",
";",
... | Stores signatures for all super public methods not already overridden by target class.
All this methods will be accepted for proxyfication. | [
"Stores",
"signatures",
"for",
"all",
"super",
"public",
"methods",
"not",
"already",
"overridden",
"by",
"target",
"class",
".",
"All",
"this",
"methods",
"will",
"be",
"accepted",
"for",
"proxyfication",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/asm/TargetClassInfoReader.java#L191-L277 | test | Visit the end of the class. | Of course, here is the Java code you requested:
```java
@Override
public void visitEnd() {
// prepare class annotations
if (classAnnotations != null) {
annotations = classAnnotations.toArray(new AnnotationInfo[0]);
classAnnotations = null;
}
List<String> superList = new ArrayList<>();
Set<String> a... |
google/guice | core/src/com/google/inject/internal/MembersInjectorStore.java | MembersInjectorStore.get | @SuppressWarnings("unchecked") // the MembersInjector type always agrees with the passed type
public <T> MembersInjectorImpl<T> get(TypeLiteral<T> key, Errors errors) throws ErrorsException {
return (MembersInjectorImpl<T>) cache.get(key, errors);
} | java | @SuppressWarnings("unchecked") // the MembersInjector type always agrees with the passed type
public <T> MembersInjectorImpl<T> get(TypeLiteral<T> key, Errors errors) throws ErrorsException {
return (MembersInjectorImpl<T>) cache.get(key, errors);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// the MembersInjector type always agrees with the passed type",
"public",
"<",
"T",
">",
"MembersInjectorImpl",
"<",
"T",
">",
"get",
"(",
"TypeLiteral",
"<",
"T",
">",
"key",
",",
"Errors",
"errors",
")",
"throw... | Returns a new complete members injector with injection listeners registered. | [
"Returns",
"a",
"new",
"complete",
"members",
"injector",
"with",
"injection",
"listeners",
"registered",
"."
] | a0552a16d813ead98fe73737fb001db336650251 | https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/MembersInjectorStore.java#L67-L70 | test | Get the members injector for the given type. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked") // the MembersInjector type always agrees with the passed type
public <T> MembersInjectorImpl<T> get(TypeLiteral<T> key, Errors errors) throws ErrorsException {
return (MembersInjectorImpl<T>) cache.get(key, errors);
}
```
... |
DigitalPebble/storm-crawler | core/src/main/java/com/digitalpebble/stormcrawler/ConfigurableTopology.java | ConfigurableTopology.submit | protected int submit(Config conf, TopologyBuilder builder) {
String name = ConfUtils.getString(conf, Config.TOPOLOGY_NAME);
if (StringUtils.isBlank(name))
throw new RuntimeException("No value found for "
+ Config.TOPOLOGY_NAME);
return submit(name, conf, builder);... | java | protected int submit(Config conf, TopologyBuilder builder) {
String name = ConfUtils.getString(conf, Config.TOPOLOGY_NAME);
if (StringUtils.isBlank(name))
throw new RuntimeException("No value found for "
+ Config.TOPOLOGY_NAME);
return submit(name, conf, builder);... | [
"protected",
"int",
"submit",
"(",
"Config",
"conf",
",",
"TopologyBuilder",
"builder",
")",
"{",
"String",
"name",
"=",
"ConfUtils",
".",
"getString",
"(",
"conf",
",",
"Config",
".",
"TOPOLOGY_NAME",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(... | Submits the topology with the name taken from the configuration * | [
"Submits",
"the",
"topology",
"with",
"the",
"name",
"taken",
"from",
"the",
"configuration",
"*"
] | 5d0465192ab8fbd89a90db32cb20960a282411ea | https://github.com/DigitalPebble/storm-crawler/blob/5d0465192ab8fbd89a90db32cb20960a282411ea/core/src/main/java/com/digitalpebble/stormcrawler/ConfigurableTopology.java#L60-L66 | test | Submit a SequenceStore to the Cluster | Of course, here is the Java code you requested:
```java
protected int submit(Config conf, TopologyBuilder builder) {
String name = ConfUtils.getString(conf, Config.TOPOLOGY_NAME);
if (StringUtils.isBlank(name))
throw new RuntimeException("No value found for "
+ Config.TO... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/grib/Grib2DataPanel.java | Grib2DataPanel.checkDuplicates | private void checkDuplicates(Formatter f) {
// how unique are the pds ?
Set<Long> pdsMap = new HashSet<>();
int dups = 0;
int count = 0;
// do all records have the same runtime ?
Map<CalendarDate, DateCount> dateMap = new HashMap<>();
List<Grib2ParameterBean> params = param2BeanTable.getB... | java | private void checkDuplicates(Formatter f) {
// how unique are the pds ?
Set<Long> pdsMap = new HashSet<>();
int dups = 0;
int count = 0;
// do all records have the same runtime ?
Map<CalendarDate, DateCount> dateMap = new HashMap<>();
List<Grib2ParameterBean> params = param2BeanTable.getB... | [
"private",
"void",
"checkDuplicates",
"(",
"Formatter",
"f",
")",
"{",
"// how unique are the pds ?",
"Set",
"<",
"Long",
">",
"pdsMap",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"int",
"dups",
"=",
"0",
";",
"int",
"count",
"=",
"0",
";",
"// do all r... | /* private void checkRuntimes(Formatter f) {
Map<Date, DateCount> runs = new HashMap<Date, DateCount>();
List<Grib2ParameterBean> params = param2BeanTable.getBeans();
for (Grib2ParameterBean pb : params) {
List<Grib2RecordBean> records = pb.getRecordBeans();
for (Grib2RecordBean record : records) {
Date d = record.getB... | [
"/",
"*",
"private",
"void",
"checkRuntimes",
"(",
"Formatter",
"f",
")",
"{",
"Map<Date",
"DateCount",
">",
"runs",
"=",
"new",
"HashMap<Date",
"DateCount",
">",
"()",
";",
"List<Grib2ParameterBean",
">",
"params",
"=",
"param2BeanTable",
".",
"getBeans",
"()... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/grib/Grib2DataPanel.java#L496-L539 | test | check duplicates in the table | Of course, here is the Java code you requested:
```java
private void checkDuplicates(Formatter f) {
// how unique are the pds ?
Set<Long> pdsMap = new HashSet<>();
int dups = 0;
int count = 0;
// do all records have the same runtime ?
Map<CalendarDate, DateCount> dateMap = new HashMap<>();
... |
deeplearning4j/nd4j | nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java | BigDecimalMath.multiplyRound | static public BigDecimal multiplyRound(final BigDecimal x, final BigDecimal y) {
BigDecimal resul = x.multiply(y);
/* The estimation of the relative error in the result is the sum of the relative
* errors |err(y)/y|+|err(x)/x|
*/
MathContext mc = new MathContext(Math.min(x.pr... | java | static public BigDecimal multiplyRound(final BigDecimal x, final BigDecimal y) {
BigDecimal resul = x.multiply(y);
/* The estimation of the relative error in the result is the sum of the relative
* errors |err(y)/y|+|err(x)/x|
*/
MathContext mc = new MathContext(Math.min(x.pr... | [
"static",
"public",
"BigDecimal",
"multiplyRound",
"(",
"final",
"BigDecimal",
"x",
",",
"final",
"BigDecimal",
"y",
")",
"{",
"BigDecimal",
"resul",
"=",
"x",
".",
"multiply",
"(",
"y",
")",
";",
"/* The estimation of the relative error in the result is the sum of th... | Multiply and round.
@param x The left factor.
@param y The right factor.
@return The product x*y. | [
"Multiply",
"and",
"round",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java#L2105-L2118 | test | Multiply two logarithmic numbers. | Of course, here is the Java code you requested:
```java
static public BigDecimal multiplyRound(final BigDecimal x, final BigDecimal y) {
BigDecimal resul = x.multiply(y);
/* The estimation of the relative error in the result is the sum of the relative
* errors |err(y)/y|+|err(x)/x|
... |
RestComm/jain-slee | container/components/components/src/main/java/org/mobicents/slee/container/component/ResourceAdaptorTypeComponentImpl.java | ResourceAdaptorTypeComponentImpl.getSpecsDescriptor | public javax.slee.resource.ResourceAdaptorTypeDescriptor getSpecsDescriptor() {
if (specsDescriptor == null) {
final LibraryID[] libraryIDs = descriptor.getLibraryRefs().toArray(new LibraryID[descriptor.getLibraryRefs().size()]);
final String[] activityTypes = descriptor.getActivityTypes().toArray(new String... | java | public javax.slee.resource.ResourceAdaptorTypeDescriptor getSpecsDescriptor() {
if (specsDescriptor == null) {
final LibraryID[] libraryIDs = descriptor.getLibraryRefs().toArray(new LibraryID[descriptor.getLibraryRefs().size()]);
final String[] activityTypes = descriptor.getActivityTypes().toArray(new String... | [
"public",
"javax",
".",
"slee",
".",
"resource",
".",
"ResourceAdaptorTypeDescriptor",
"getSpecsDescriptor",
"(",
")",
"{",
"if",
"(",
"specsDescriptor",
"==",
"null",
")",
"{",
"final",
"LibraryID",
"[",
"]",
"libraryIDs",
"=",
"descriptor",
".",
"getLibraryRef... | Retrieves the JAIN SLEE specs descriptor
@return | [
"Retrieves",
"the",
"JAIN",
"SLEE",
"specs",
"descriptor"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/ResourceAdaptorTypeComponentImpl.java#L199-L208 | test | Gets the SpecsDescriptor field from this DeploymentUnit. | Of course, here is the Java code you requested:
```java
public javax.slee.resource.ResourceAdaptorTypeDescriptor getSpecsDescriptor() {
if (specsDescriptor == null) {
final LibraryID[] libraryIDs = descriptor.getLibraryRefs().toArray(new LibraryID[descriptor.getLibraryRefs().size()]);
final String[] activit... |
rupertlssmith/lojix | lojix/interpreter/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionInterpreter.java | ResolutionInterpreter.interpreterLoop | public void interpreterLoop() throws IOException
{
// Display the welcome message.
printIntroduction();
// Initialize the JLine console.
consoleReader = initializeCommandLineReader();
// Used to buffer input, and only feed it to the parser when a PERIOD is encountered.
... | java | public void interpreterLoop() throws IOException
{
// Display the welcome message.
printIntroduction();
// Initialize the JLine console.
consoleReader = initializeCommandLineReader();
// Used to buffer input, and only feed it to the parser when a PERIOD is encountered.
... | [
"public",
"void",
"interpreterLoop",
"(",
")",
"throws",
"IOException",
"{",
"// Display the welcome message.",
"printIntroduction",
"(",
")",
";",
"// Initialize the JLine console.",
"consoleReader",
"=",
"initializeCommandLineReader",
"(",
")",
";",
"// Used to buffer input... | Implements the top-level interpreter loop. This will parse and evaluate sentences until it encounters an CTRL-D
in query mode, at which point the interpreter will terminate.
@throws SourceCodeException If malformed code is encountered.
@throws IOException If an IO error is encountered whilst reading the source... | [
"Implements",
"the",
"top",
"-",
"level",
"interpreter",
"loop",
".",
"This",
"will",
"parse",
"and",
"evaluate",
"sentences",
"until",
"it",
"encounters",
"an",
"CTRL",
"-",
"D",
"in",
"query",
"mode",
"at",
"which",
"point",
"the",
"interpreter",
"will",
... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/interpreter/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionInterpreter.java#L135-L334 | test | The interpreter loop. | Of course, here is the Java code you requested:
```java
public void interpreterLoop() throws IOException
{
// Display the welcome message.
printIntroduction();
// Initialize the JLine console.
consoleReader = initializeCommandLineReader();
// Used to buffer input, and only... |
eclipse/packagedrone | bundles/org.tukani.xz/src/org/tukaani/xz/XZOutputStream.java | XZOutputStream.write | public void write(byte[] buf, int off, int len) throws IOException {
if (off < 0 || len < 0 || off + len < 0 || off + len > buf.length)
throw new IndexOutOfBoundsException();
if (exception != null)
throw exception;
if (finished)
throw new XZIOException("Stre... | java | public void write(byte[] buf, int off, int len) throws IOException {
if (off < 0 || len < 0 || off + len < 0 || off + len > buf.length)
throw new IndexOutOfBoundsException();
if (exception != null)
throw exception;
if (finished)
throw new XZIOException("Stre... | [
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"off",
"<",
"0",
"||",
"len",
"<",
"0",
"||",
"off",
"+",
"len",
"<",
"0",
"||",
"off",
"+",
"len",
"... | Writes an array of bytes to be compressed.
The compressors tend to do internal buffering and thus the written
data won't be readable from the compressed output immediately.
Use <code>flush()</code> to force everything written so far to
be written to the underlaying output stream, but be aware that
flushing reduces comp... | [
"Writes",
"an",
"array",
"of",
"bytes",
"to",
"be",
"compressed",
".",
"The",
"compressors",
"tend",
"to",
"do",
"internal",
"buffering",
"and",
"thus",
"the",
"written",
"data",
"won",
"t",
"be",
"readable",
"from",
"the",
"compressed",
"output",
"immediate... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.tukani.xz/src/org/tukaani/xz/XZOutputStream.java#L385-L405 | test | Write a byte array to the stream. | Of course, here is the Java code you requested:
```java
public void write(byte[] buf, int off, int len) throws IOException {
if (off < 0 || len < 0 || off + len < 0 || off + len > buf.length)
throw new IndexOutOfBoundsException();
if (exception != null)
throw exception;
... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.buffer | @CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Flowable<List<T>> buffer(long timespan, long timeskip, TimeUnit unit) {
return buffer(timespan, timeskip, unit, Schedulers.computation(), ArrayListSupplier.<T>asCallable());
... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Flowable<List<T>> buffer(long timespan, long timeskip, TimeUnit unit) {
return buffer(timespan, timeskip, unit, Schedulers.computation(), ArrayListSupplier.<T>asCallable());
... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"ERROR",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"COMPUTATION",
")",
"public",
"final",
"Flowable",
"<",
"List",
"<",
"T",
">",
">",
"buffer",
"(",
"long",
"... | Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
Publisher starts a new buffer periodically, as determined by the {@code timeskip} argument. It emits
each buffer after a fixed timespan, specified by the {@code timespan} argument. When the source
Publisher completes, th... | [
"Returns",
"a",
"Flowable",
"that",
"emits",
"buffers",
"of",
"items",
"it",
"collects",
"from",
"the",
"source",
"Publisher",
".",
"The",
"resulting",
"Publisher",
"starts",
"a",
"new",
"buffer",
"periodically",
"as",
"determined",
"by",
"the",
"{",
"@code",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L6351-L6356 | test | Creates a sequence of tokens from the source source. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Flowable<List<T>> buffer(long timespan, long timeskip, TimeUnit unit) {
return buffer(timespan, timeskip, unit, Schedul... |
OpenEstate/OpenEstate-IO | ImmobiliareIT/src/main/jaxb/org/openestate/io/immobiliare_it/xml/ObjectFactory.java | ObjectFactory.createFeedProjectsProjectAgentSalesOfficeCity | public Feed.Projects.Project.Agent.SalesOffice.City createFeedProjectsProjectAgentSalesOfficeCity() {
return new Feed.Projects.Project.Agent.SalesOffice.City();
} | java | public Feed.Projects.Project.Agent.SalesOffice.City createFeedProjectsProjectAgentSalesOfficeCity() {
return new Feed.Projects.Project.Agent.SalesOffice.City();
} | [
"public",
"Feed",
".",
"Projects",
".",
"Project",
".",
"Agent",
".",
"SalesOffice",
".",
"City",
"createFeedProjectsProjectAgentSalesOfficeCity",
"(",
")",
"{",
"return",
"new",
"Feed",
".",
"Projects",
".",
"Project",
".",
"Agent",
".",
"SalesOffice",
".",
"... | Create an instance of {@link Feed.Projects.Project.Agent.SalesOffice.City } | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"Feed",
".",
"Projects",
".",
"Project",
".",
"Agent",
".",
"SalesOffice",
".",
"City",
"}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmobiliareIT/src/main/jaxb/org/openestate/io/immobiliare_it/xml/ObjectFactory.java#L412-L414 | test | Create a Feed projects project agent s salesOffice city. | Of course, here is the Java code you requested:
```java
public Feed.Projects.Project.Agent.SalesOffice.City createFeedProjectsProjectAgentSalesOfficeCity() {
return new Feed.Projects.Project.Agent.SalesOffice.City();
}
```
Hope this helps! |
lessthanoptimal/GeoRegression | main/src/georegression/metric/Distance2D_F64.java | Distance2D_F64.distanceSq | public static double distanceSq( LineSegment2D_F64 line, Point2D_F64 p ) {
double a = line.b.x - line.a.x;
double b = line.b.y - line.a.y;
double t = a * ( p.x - line.a.x ) + b * ( p.y - line.a.y );
t /= ( a * a + b * b );
// if the point of intersection is past the end points return the distance
// from ... | java | public static double distanceSq( LineSegment2D_F64 line, Point2D_F64 p ) {
double a = line.b.x - line.a.x;
double b = line.b.y - line.a.y;
double t = a * ( p.x - line.a.x ) + b * ( p.y - line.a.y );
t /= ( a * a + b * b );
// if the point of intersection is past the end points return the distance
// from ... | [
"public",
"static",
"double",
"distanceSq",
"(",
"LineSegment2D_F64",
"line",
",",
"Point2D_F64",
"p",
")",
"{",
"double",
"a",
"=",
"line",
".",
"b",
".",
"x",
"-",
"line",
".",
"a",
".",
"x",
";",
"double",
"b",
"=",
"line",
".",
"b",
".",
"y",
... | <p>
Returns the Euclidean distance squared of the closest point on a line segment to the specified point.
</p>
@param line A line segment. Not modified.
@param p The point. Not modified.
@return Euclidean distance squared of the closest point on a line is away from a point. | [
"<p",
">",
"Returns",
"the",
"Euclidean",
"distance",
"squared",
"of",
"the",
"closest",
"point",
"on",
"a",
"line",
"segment",
"to",
"the",
"specified",
"point",
".",
"<",
"/",
"p",
">"
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/Distance2D_F64.java#L152-L168 | test | Returns the squared Euclidean distance between the two points. | Of course, here is the Java code you requested:
```java
public static double distanceSq( LineSegment2D_F64 line, Point2D_F64 p ) {
double a = line.b.x - line.a.x;
double b = line.b.y - line.a.y;
double t = a * ( p.x - line.a.x ) + b * ( p.y - line.a.y );
t /= ( a * a + b * b );
// if the point of intersect... |
streamsets/datacollector | common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Pattern.java | Pattern.isInsideCharClass | static private boolean isInsideCharClass(String s, int pos) {
boolean openBracketFound = false;
boolean closeBracketFound = false;
// find last non-escaped open-bracket
String s2 = s.substring(0, pos);
int posOpen = pos;
while ((posOpen = s2.lastIndexOf('[', posOpen - 1... | java | static private boolean isInsideCharClass(String s, int pos) {
boolean openBracketFound = false;
boolean closeBracketFound = false;
// find last non-escaped open-bracket
String s2 = s.substring(0, pos);
int posOpen = pos;
while ((posOpen = s2.lastIndexOf('[', posOpen - 1... | [
"static",
"private",
"boolean",
"isInsideCharClass",
"(",
"String",
"s",
",",
"int",
"pos",
")",
"{",
"boolean",
"openBracketFound",
"=",
"false",
";",
"boolean",
"closeBracketFound",
"=",
"false",
";",
"// find last non-escaped open-bracket",
"String",
"s2",
"=",
... | Determines if a string's character is within a regex character class
@param s string to evaluate
@param pos the position of the character to evaluate
@return true if the character is inside a character class; otherwise false | [
"Determines",
"if",
"a",
"string",
"s",
"character",
"is",
"within",
"a",
"regex",
"character",
"class"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Pattern.java#L360-L388 | test | isInsideCharClass This method returns true if the char class is inside of an open - bracket or close - bracket. | Of course, here is the Java code you requested:
```java
static private boolean isInsideCharClass(String s, int pos) {
boolean openBracketFound = false;
boolean closeBracketFound = false;
// find last non-escaped open-bracket
String s2 = s.substring(0, pos);
int posOpen = pos;
... |
oblac/jodd | jodd-core/src/main/java/jodd/util/collection/SortedArrayList.java | SortedArrayList.findInsertionPoint | protected int findInsertionPoint(final E o, int low, int high) {
while (low <= high) {
int mid = (low + high) >>> 1;
int delta = compare(get(mid), o);
if (delta > 0) {
high = mid - 1;
} else {
low = mid + 1;
}
}
return low;
} | java | protected int findInsertionPoint(final E o, int low, int high) {
while (low <= high) {
int mid = (low + high) >>> 1;
int delta = compare(get(mid), o);
if (delta > 0) {
high = mid - 1;
} else {
low = mid + 1;
}
}
return low;
} | [
"protected",
"int",
"findInsertionPoint",
"(",
"final",
"E",
"o",
",",
"int",
"low",
",",
"int",
"high",
")",
"{",
"while",
"(",
"low",
"<=",
"high",
")",
"{",
"int",
"mid",
"=",
"(",
"low",
"+",
"high",
")",
">>>",
"1",
";",
"int",
"delta",
"=",... | Conducts a binary search to find the index where Object
should be inserted. | [
"Conducts",
"a",
"binary",
"search",
"to",
"find",
"the",
"index",
"where",
"Object",
"should",
"be",
"inserted",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/collection/SortedArrayList.java#L163-L177 | test | Find the insertion point. | Of course, here is the Java code you requested:
```java
protected int findInsertionPoint(final E o, int low, int high) {
while (low <= high) {
int mid = (low + high) >>> 1;
int delta = compare(get(mid), o);
if (delta > 0) {
high = mid - 1;
} else {
low = mid + 1;
}
}
return low;
}
```
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OPerformanceStatisticManager.java | OPerformanceStatisticManager.startMonitoring | public void startMonitoring() {
switchLock.acquireWriteLock();
try {
if (!statistics.isEmpty() && !enabled)
throw new IllegalStateException("Monitoring is already started on thread level and can not be started on system level");
deadThreadsStatistic = null;
postMeasurementStatistic = ... | java | public void startMonitoring() {
switchLock.acquireWriteLock();
try {
if (!statistics.isEmpty() && !enabled)
throw new IllegalStateException("Monitoring is already started on thread level and can not be started on system level");
deadThreadsStatistic = null;
postMeasurementStatistic = ... | [
"public",
"void",
"startMonitoring",
"(",
")",
"{",
"switchLock",
".",
"acquireWriteLock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"statistics",
".",
"isEmpty",
"(",
")",
"&&",
"!",
"enabled",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Monito... | Starts performance monitoring only for whole system.
After call of this method you can not start monitoring on thread level till call of {@link #stopMonitoring()} is performed. | [
"Starts",
"performance",
"monitoring",
"only",
"for",
"whole",
"system",
".",
"After",
"call",
"of",
"this",
"method",
"you",
"can",
"not",
"start",
"monitoring",
"on",
"thread",
"level",
"till",
"call",
"of",
"{"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OPerformanceStatisticManager.java#L336-L349 | test | Start monitoring on thread level | Of course, here is the Java code you requested:
```java
public void startMonitoring() {
switchLock.acquireWriteLock();
try {
if (!statistics.isEmpty() && !enabled)
throw new IllegalStateException("Monitoring is already started on thread level and can not be started on system level");
deadT... |
jboss/jboss-common-core | src/main/java/org/jboss/util/TimerQueue.java | TimerQueue.schedule | public void schedule(TimerTask t, long delay)
{
if (t == null) throw new IllegalArgumentException("Can't schedule a null TimerTask");
if (delay < 0) delay = 0;
t.setNextExecutionTime(System.currentTimeMillis() + delay);
putJob(t);
} | java | public void schedule(TimerTask t, long delay)
{
if (t == null) throw new IllegalArgumentException("Can't schedule a null TimerTask");
if (delay < 0) delay = 0;
t.setNextExecutionTime(System.currentTimeMillis() + delay);
putJob(t);
} | [
"public",
"void",
"schedule",
"(",
"TimerTask",
"t",
",",
"long",
"delay",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can't schedule a null TimerTask\"",
")",
";",
"if",
"(",
"delay",
"<",
"0",
")",
"de... | Schedule the given TimerTask to be executed after <code>delay</code>
milliseconds.
@param t
@param delay | [
"Schedule",
"the",
"given",
"TimerTask",
"to",
"be",
"executed",
"after",
"<code",
">",
"delay<",
"/",
"code",
">",
"milliseconds",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/TimerQueue.java#L75-L81 | test | Schedule a new task for execution. | Of course, here is the Java code you requested:
```java
public void schedule(TimerTask t, long delay)
{
if (t == null) throw new IllegalArgumentException("Can't schedule a null TimerTask");
if (delay < 0) delay = 0;
t.setNextExecutionTime(System.currentTimeMillis() + delay);
putJob(t);
}... |
Unidata/thredds | legacy/src/main/java/thredds/catalog/query/QueryCapability.java | QueryCapability.appendErrorMessage | public void appendErrorMessage( String message, boolean fatal) {
errLog.append( message);
errLog.append( "\n");
fatalError = fatalError || fatal;
} | java | public void appendErrorMessage( String message, boolean fatal) {
errLog.append( message);
errLog.append( "\n");
fatalError = fatalError || fatal;
} | [
"public",
"void",
"appendErrorMessage",
"(",
"String",
"message",
",",
"boolean",
"fatal",
")",
"{",
"errLog",
".",
"append",
"(",
"message",
")",
";",
"errLog",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"fatalError",
"=",
"fatalError",
"||",
"fatal",
";",
... | Append an error message to the message log. Call check() to get the log when
everything is done.
@param message append this message to log
@param fatal true if this is a fatal error. | [
"Append",
"an",
"error",
"message",
"to",
"the",
"message",
"log",
".",
"Call",
"check",
"()",
"to",
"get",
"the",
"log",
"when",
"everything",
"is",
"done",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/query/QueryCapability.java#L52-L56 | test | Append error message. | Of course, here is the Java code you requested:
```java
public void appendErrorMessage( String message, boolean fatal) {
errLog.append( message);
errLog.append( "\n");
fatalError = fatalError || fatal;
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/stream/NcStreamWriter.java | NcStreamWriter.sendData2 | public long sendData2(Variable v, Section section, OutputStream out, NcStreamCompression compress) throws IOException, InvalidRangeException {
if (show) System.out.printf(" %s section=%s%n", v.getFullName(), section);
boolean isVlen = v.isVariableLength(); // && v.getRank() > 1;
if (isVlen)
v.r... | java | public long sendData2(Variable v, Section section, OutputStream out, NcStreamCompression compress) throws IOException, InvalidRangeException {
if (show) System.out.printf(" %s section=%s%n", v.getFullName(), section);
boolean isVlen = v.isVariableLength(); // && v.getRank() > 1;
if (isVlen)
v.r... | [
"public",
"long",
"sendData2",
"(",
"Variable",
"v",
",",
"Section",
"section",
",",
"OutputStream",
"out",
",",
"NcStreamCompression",
"compress",
")",
"throws",
"IOException",
",",
"InvalidRangeException",
"{",
"if",
"(",
"show",
")",
"System",
".",
"out",
"... | LOOK compression not used | [
"LOOK",
"compression",
"not",
"used"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/stream/NcStreamWriter.java#L120-L139 | test | Send data to the specified output stream. | Of course, here is the Java code you requested:
```java
public long sendData2(Variable v, Section section, OutputStream out, NcStreamCompression compress) throws IOException, InvalidRangeException {
if (show) System.out.printf(" %s section=%s%n", v.getFullName(), section);
boolean isVlen = v.isVariableLeng... |
javadev/moneytostr-russian | src/main/java/com/github/moneytostr/MoneyToStrApp.java | MoneyToStrApp.setupMoneyToStrVariables | private void setupMoneyToStrVariables() {
moneyToStrTxt = new MoneyToStr(MoneyToStr.Currency.values()[jComboBox2.getSelectedIndex()],
MoneyToStr.Language.values()[jComboBox1.getSelectedIndex()],
MoneyToStr.Pennies.values()[jComboBox3.getSelectedIndex()]);
moneyToStrNum = ... | java | private void setupMoneyToStrVariables() {
moneyToStrTxt = new MoneyToStr(MoneyToStr.Currency.values()[jComboBox2.getSelectedIndex()],
MoneyToStr.Language.values()[jComboBox1.getSelectedIndex()],
MoneyToStr.Pennies.values()[jComboBox3.getSelectedIndex()]);
moneyToStrNum = ... | [
"private",
"void",
"setupMoneyToStrVariables",
"(",
")",
"{",
"moneyToStrTxt",
"=",
"new",
"MoneyToStr",
"(",
"MoneyToStr",
".",
"Currency",
".",
"values",
"(",
")",
"[",
"jComboBox2",
".",
"getSelectedIndex",
"(",
")",
"]",
",",
"MoneyToStr",
".",
"Language",... | GEN-LAST:event_jTextField7KeyTyped | [
"GEN",
"-",
"LAST",
":",
"event_jTextField7KeyTyped"
] | f9ae5a043400b440ad5dcd6b7425d9166f3cf256 | https://github.com/javadev/moneytostr-russian/blob/f9ae5a043400b440ad5dcd6b7425d9166f3cf256/src/main/java/com/github/moneytostr/MoneyToStrApp.java#L1139-L1172 | test | Setup the variables needed to display the money to str. | Of course, here is the Java code you requested:
```java
private void setupMoneyToStrVariables() {
moneyToStrTxt = new MoneyToStr(MoneyToStr.Currency.values()[jComboBox2.getSelectedIndex()],
MoneyToStr.Language.values()[jComboBox1.getSelectedIndex()],
MoneyToStr.Pennies.values()[... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/printer/UnoptimizedLabelPrinter.java | UnoptimizedLabelPrinter.enterPredicate | protected void enterPredicate(Predicate predicate)
{
if (predicate instanceof WAMCompiledPredicate)
{
WAMOptimizeableListing compiledPredicate = (WAMCompiledPredicate) predicate;
for (WAMInstruction instruction : compiledPredicate.getUnoptimizedInstructions())
{
... | java | protected void enterPredicate(Predicate predicate)
{
if (predicate instanceof WAMCompiledPredicate)
{
WAMOptimizeableListing compiledPredicate = (WAMCompiledPredicate) predicate;
for (WAMInstruction instruction : compiledPredicate.getUnoptimizedInstructions())
{
... | [
"protected",
"void",
"enterPredicate",
"(",
"Predicate",
"predicate",
")",
"{",
"if",
"(",
"predicate",
"instanceof",
"WAMCompiledPredicate",
")",
"{",
"WAMOptimizeableListing",
"compiledPredicate",
"=",
"(",
"WAMCompiledPredicate",
")",
"predicate",
";",
"for",
"(",
... | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/printer/UnoptimizedLabelPrinter.java#L75-L88 | test | Enter a predicate in the sequence. | Of course, here is the Java code you requested:
```java
protected void enterPredicate(Predicate predicate)
{
if (predicate instanceof WAMCompiledPredicate)
{
WAMOptimizeableListing compiledPredicate = (WAMCompiledPredicate) predicate;
for (WAMInstruction instruction : compi... |
GojaFramework/goja | goja-web/src/main/java/goja/security/goja/SecurityKit.java | SecurityKit.login | public static <T extends Model> boolean login(T user, String password, boolean remember
, HttpServletRequest request, HttpServletResponse response) {
boolean matcher =
SecurityKit.checkPassword(user.getStr("salt"), user.getStr("password"), password);
if (matcher) {
... | java | public static <T extends Model> boolean login(T user, String password, boolean remember
, HttpServletRequest request, HttpServletResponse response) {
boolean matcher =
SecurityKit.checkPassword(user.getStr("salt"), user.getStr("password"), password);
if (matcher) {
... | [
"public",
"static",
"<",
"T",
"extends",
"Model",
">",
"boolean",
"login",
"(",
"T",
"user",
",",
"String",
"password",
",",
"boolean",
"remember",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"boolean",
"matcher",
"=... | Check the user's password, and execute the login request
@param user user.
@param password password.
@param remember has remember.
@param request request.
@param response http response.
@param <T> User type.
@return True login Success. | [
"Check",
"the",
"user",
"s",
"password",
"and",
"execute",
"the",
"login",
"request"
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/security/goja/SecurityKit.java#L86-L94 | test | login method. | Of course, here is the Java code you requested:
```java
public static <T extends Model> boolean login(T user, String password, boolean remember
, HttpServletRequest request, HttpServletResponse response) {
boolean matcher =
SecurityKit.checkPassword(user.getStr("salt"), user.getStr(... |
subchen/jetbrick-all-1x | jetbrick-webmvc/src/main/java/jetbrick/web/mvc/router/RestfulMatcher.java | RestfulMatcher.register | public void register(ActionInfo action, String url) {
if (url.indexOf('{') == -1) {
staticUrls.put(url, new RouteInfo(action));
} else {
String[] urlSegments = StringUtils.split(url.substring(1), '/');
if (urlSegments.length >= MAX_PATH_PARTS) {
throw ... | java | public void register(ActionInfo action, String url) {
if (url.indexOf('{') == -1) {
staticUrls.put(url, new RouteInfo(action));
} else {
String[] urlSegments = StringUtils.split(url.substring(1), '/');
if (urlSegments.length >= MAX_PATH_PARTS) {
throw ... | [
"public",
"void",
"register",
"(",
"ActionInfo",
"action",
",",
"String",
"url",
")",
"{",
"if",
"(",
"url",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
")",
"{",
"staticUrls",
".",
"put",
"(",
"url",
",",
"new",
"RouteInfo",
"(",
"action",... | 按照长度分组 | [
"按照长度分组"
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-webmvc/src/main/java/jetbrick/web/mvc/router/RestfulMatcher.java#L45-L60 | test | Register a static url. | Of course, here is the Java code you requested:
```java
public void register(ActionInfo action, String url) {
if (url.indexOf('{') == -1) {
staticUrls.put(url, new RouteInfo(action));
} else {
String[] urlSegments = StringUtils.split(url.substring(1), '/');
if (urlSe... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/result/AbstractTemplateViewActionResult.java | AbstractTemplateViewActionResult.targetNotFound | protected void targetNotFound(final ActionRequest actionRequest, final String actionAndResultPath) throws IOException {
final HttpServletResponse response = actionRequest.getHttpServletResponse();
if (!response.isCommitted()) {
response.sendError(SC_NOT_FOUND, "Result not found: " + actionAndResultPath);
}
} | java | protected void targetNotFound(final ActionRequest actionRequest, final String actionAndResultPath) throws IOException {
final HttpServletResponse response = actionRequest.getHttpServletResponse();
if (!response.isCommitted()) {
response.sendError(SC_NOT_FOUND, "Result not found: " + actionAndResultPath);
}
} | [
"protected",
"void",
"targetNotFound",
"(",
"final",
"ActionRequest",
"actionRequest",
",",
"final",
"String",
"actionAndResultPath",
")",
"throws",
"IOException",
"{",
"final",
"HttpServletResponse",
"response",
"=",
"actionRequest",
".",
"getHttpServletResponse",
"(",
... | Called when target not found. By default sends 404 to the response. | [
"Called",
"when",
"target",
"not",
"found",
".",
"By",
"default",
"sends",
"404",
"to",
"the",
"response",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/result/AbstractTemplateViewActionResult.java#L201-L207 | test | Target not found. | Of course, here is the Java code you requested:
```java
protected void targetNotFound(final ActionRequest actionRequest, final String actionAndResultPath) throws IOException {
final HttpServletResponse response = actionRequest.getHttpServletResponse();
if (!response.isCommitted()) {
response.sendError(SC_NOT_F... |
streamsets/datacollector | container/src/main/java/com/streamsets/datacollector/definition/ConfigValueExtractor.java | ConfigValueExtractor.extractAsRuntime | private Object extractAsRuntime(Field field, String valueStr) {
if (field.getType() == Byte.TYPE || field.getType() == Byte.class ||
field.getType() == Short.TYPE || field.getType() == Short.class ||
field.getType() == Integer.TYPE || field.getType() == Integer.class ||
field.getType() =... | java | private Object extractAsRuntime(Field field, String valueStr) {
if (field.getType() == Byte.TYPE || field.getType() == Byte.class ||
field.getType() == Short.TYPE || field.getType() == Short.class ||
field.getType() == Integer.TYPE || field.getType() == Integer.class ||
field.getType() =... | [
"private",
"Object",
"extractAsRuntime",
"(",
"Field",
"field",
",",
"String",
"valueStr",
")",
"{",
"if",
"(",
"field",
".",
"getType",
"(",
")",
"==",
"Byte",
".",
"TYPE",
"||",
"field",
".",
"getType",
"(",
")",
"==",
"Byte",
".",
"class",
"||",
"... | RUNTIME supports only Numeric types and String at the moment | [
"RUNTIME",
"supports",
"only",
"Numeric",
"types",
"and",
"String",
"at",
"the",
"moment"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/definition/ConfigValueExtractor.java#L249-L262 | test | Extract value as runtime type. | Of course, here is the Java code you requested:
```java
private Object extractAsRuntime(Field field, String valueStr) {
if (field.getType() == Byte.TYPE || field.getType() == Byte.class ||
field.getType() == Short.TYPE || field.getType() == Short.class ||
field.getType() == Integer.TYPE || field... |
Jasig/NotificationPortlet | notification-portlet-api/src/main/java/org/jasig/portlet/notice/NotificationResponse.java | NotificationResponse.size | @JsonIgnore
@XmlTransient
public int size() {
return categories.stream()
.map(NotificationCategory::getEntries)
.mapToInt(List::size)
.sum();
} | java | @JsonIgnore
@XmlTransient
public int size() {
return categories.stream()
.map(NotificationCategory::getEntries)
.mapToInt(List::size)
.sum();
} | [
"@",
"JsonIgnore",
"@",
"XmlTransient",
"public",
"int",
"size",
"(",
")",
"{",
"return",
"categories",
".",
"stream",
"(",
")",
".",
"map",
"(",
"NotificationCategory",
"::",
"getEntries",
")",
".",
"mapToInt",
"(",
"List",
"::",
"size",
")",
".",
"sum"... | Provides the total number of notifications contained in the response. | [
"Provides",
"the",
"total",
"number",
"of",
"notifications",
"contained",
"in",
"the",
"response",
"."
] | a74b87c145b66166a2cb6849d17ce9b0f2c98f3b | https://github.com/Jasig/NotificationPortlet/blob/a74b87c145b66166a2cb6849d17ce9b0f2c98f3b/notification-portlet-api/src/main/java/org/jasig/portlet/notice/NotificationResponse.java#L207-L214 | test | Get the size of the list of all the n - grams. | Of course, here is the Java code you requested:
```java
@JsonIgnore
@XmlTransient
public int size() {
return categories.stream()
.map(NotificationCategory::getEntries)
.mapToInt(List::size)
.sum();
}
```
Hope this helps! |
boonproject/boon | boon/src/main/java/org/boon/core/reflection/Fields.java | Fields.hasStringField | public static boolean hasStringField( final Object value1, final String name ) {
Class<?> clz = value1.getClass();
return classHasStringField( clz, name );
} | java | public static boolean hasStringField( final Object value1, final String name ) {
Class<?> clz = value1.getClass();
return classHasStringField( clz, name );
} | [
"public",
"static",
"boolean",
"hasStringField",
"(",
"final",
"Object",
"value1",
",",
"final",
"String",
"name",
")",
"{",
"Class",
"<",
"?",
">",
"clz",
"=",
"value1",
".",
"getClass",
"(",
")",
";",
"return",
"classHasStringField",
"(",
"clz",
",",
"... | Checks to see if we have a string field.
@param value1
@param name
@return | [
"Checks",
"to",
"see",
"if",
"we",
"have",
"a",
"string",
"field",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/core/reflection/Fields.java#L65-L69 | test | Check if the value1 has a string field with the given name. | Of course, here is the Java code you requested:
```java
public static boolean hasStringField( final Object value1, final String name ) {
Class<?> clz = value1.getClass();
return classHasStringField( clz, name );
}
```
Hope this helps! |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/ClassReader.java | ClassReader.readParameterAnnotations | private void readParameterAnnotations(
final MethodVisitor methodVisitor,
final Context context,
final int runtimeParameterAnnotationsOffset,
final boolean visible) {
int currentOffset = runtimeParameterAnnotationsOffset;
int numParameters = b[currentOffset++] & 0xFF;
methodVisitor.v... | java | private void readParameterAnnotations(
final MethodVisitor methodVisitor,
final Context context,
final int runtimeParameterAnnotationsOffset,
final boolean visible) {
int currentOffset = runtimeParameterAnnotationsOffset;
int numParameters = b[currentOffset++] & 0xFF;
methodVisitor.v... | [
"private",
"void",
"readParameterAnnotations",
"(",
"final",
"MethodVisitor",
"methodVisitor",
",",
"final",
"Context",
"context",
",",
"final",
"int",
"runtimeParameterAnnotationsOffset",
",",
"final",
"boolean",
"visible",
")",
"{",
"int",
"currentOffset",
"=",
"run... | Reads a Runtime[In]VisibleParameterAnnotations attribute and makes the given visitor visit it.
@param methodVisitor the visitor that must visit the parameter annotations.
@param context information about the class being parsed.
@param runtimeParameterAnnotationsOffset the start offset of a
Runtime[In]VisibleParameterA... | [
"Reads",
"a",
"Runtime",
"[",
"In",
"]",
"VisibleParameterAnnotations",
"attribute",
"and",
"makes",
"the",
"given",
"visitor",
"visit",
"it",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassReader.java#L2699-L2724 | test | Read the annotation information for the parameter types. | Of course, here is the Java code you requested:
```java
private void readParameterAnnotations(
final MethodVisitor methodVisitor,
final Context context,
final int runtimeParameterAnnotationsOffset,
final boolean visible) {
int currentOffset = runtimeParameterAnnotationsOffset;
int numPa... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNCtx.java | CNCtx.listBindings | public NamingEnumeration listBindings(Name name)
throws NamingException {
if (_nc == null)
throw IIOPLogger.ROOT_LOGGER.notANamingContext(name.toString());
if (name.size() > 0) {
try {
java.lang.Object obj = lookup(name);
if (obj instan... | java | public NamingEnumeration listBindings(Name name)
throws NamingException {
if (_nc == null)
throw IIOPLogger.ROOT_LOGGER.notANamingContext(name.toString());
if (name.size() > 0) {
try {
java.lang.Object obj = lookup(name);
if (obj instan... | [
"public",
"NamingEnumeration",
"listBindings",
"(",
"Name",
"name",
")",
"throws",
"NamingException",
"{",
"if",
"(",
"_nc",
"==",
"null",
")",
"throw",
"IIOPLogger",
".",
"ROOT_LOGGER",
".",
"notANamingContext",
"(",
"name",
".",
"toString",
"(",
")",
")",
... | Returns a BindingEnumeration object which has a list of name
class pairs. Lists the current context if the name is empty.
@param name JNDI Name
@return a list of bindings as a BindingEnumeration.
@throws NamingException all exceptions returned by lookup. | [
"Returns",
"a",
"BindingEnumeration",
"object",
"which",
"has",
"a",
"list",
"of",
"name",
"class",
"pairs",
".",
"Lists",
"the",
"current",
"context",
"if",
"the",
"name",
"is",
"empty",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNCtx.java#L823-L846 | test | List all bindings of a name. | Of course, here is the Java code you requested:
```java
public NamingEnumeration listBindings(Name name)
throws NamingException {
if (_nc == null)
throw IIOPLogger.ROOT_LOGGER.notANamingContext(name.toString());
if (name.size() > 0) {
try {
java.lang.... |
eclipse/packagedrone | bundles/org.eclipse.packagedrone.repo.channel.web/src/org/eclipse/packagedrone/repo/channel/web/channel/AspectInformation.java | AspectInformation.filterIds | public static List<AspectInformation> filterIds ( final List<AspectInformation> list, final Predicate<String> predicate )
{
if ( list == null )
{
return null;
}
return list.stream ().filter ( ( i ) -> predicate.test ( i.getFactoryId () ) ).collect ( Collectors.toList () ... | java | public static List<AspectInformation> filterIds ( final List<AspectInformation> list, final Predicate<String> predicate )
{
if ( list == null )
{
return null;
}
return list.stream ().filter ( ( i ) -> predicate.test ( i.getFactoryId () ) ).collect ( Collectors.toList () ... | [
"public",
"static",
"List",
"<",
"AspectInformation",
">",
"filterIds",
"(",
"final",
"List",
"<",
"AspectInformation",
">",
"list",
",",
"final",
"Predicate",
"<",
"String",
">",
"predicate",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
... | Filter the provided aspect lists by a predicate on the ID
@param list
the list to filter
@param predicate
the ID predicate
@return the filtered list, returns only <code>null</code> when the list
was <code>null</code> | [
"Filter",
"the",
"provided",
"aspect",
"lists",
"by",
"a",
"predicate",
"on",
"the",
"ID"
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.eclipse.packagedrone.repo.channel.web/src/org/eclipse/packagedrone/repo/channel/web/channel/AspectInformation.java#L177-L185 | test | Filter ids. | Of course, here is the Java code you requested:
```java
public static List<AspectInformation> filterIds ( final List<AspectInformation> list, final Predicate<String> predicate )
{
if ( list == null )
{
return null;
}
return list.stream ().filter ( ( i ) -> predicate.tes... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasSsymv | public static void cublasSsymv(char uplo, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy)
{
cublasSsymvNative(uplo, n, alpha, A, lda, x, incx, beta, y, incy);
checkResultBLAS();
} | java | public static void cublasSsymv(char uplo, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy)
{
cublasSsymvNative(uplo, n, alpha, A, lda, x, incx, beta, y, incy);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasSsymv",
"(",
"char",
"uplo",
",",
"int",
"n",
",",
"float",
"alpha",
",",
"Pointer",
"A",
",",
"int",
"lda",
",",
"Pointer",
"x",
",",
"int",
"incx",
",",
"float",
"beta",
",",
"Pointer",
"y",
",",
"int",
"incy",
... | <pre>
void
cublasSsymv (char uplo, int n, float alpha, const float *A, int lda,
const float *x, int incx, float beta, float *y, int incy)
performs the matrix-vector operation
y = alpha*A*x + beta*y
Alpha and beta are single precision scalars, and x and y are single
precision vectors, each with n elements. A is a sym... | [
"<pre",
">",
"void",
"cublasSsymv",
"(",
"char",
"uplo",
"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#L3411-L3415 | test | Cublas symmetric vector. | Of course, here is the Java code you requested:
```java
public static void cublasSsymv(char uplo, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy)
{
cublasSsymvNative(uplo, n, alpha, A, lda, x, incx, beta, y, incy);
checkResultBLAS();
}
```
Hope... |
orientechnologies/orientdb | graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java | OrientVertex.getEdge | protected static OrientEdge getEdge(final OrientBaseGraph graph, final ODocument doc, String fieldName,
final OPair<Direction, String> connection, final Object fieldValue, final OIdentifiable iTargetVertex,
final String[] iLabels) {
final OrientEdge toAdd;
final ODocument fieldRecord = ((OIdentifia... | java | protected static OrientEdge getEdge(final OrientBaseGraph graph, final ODocument doc, String fieldName,
final OPair<Direction, String> connection, final Object fieldValue, final OIdentifiable iTargetVertex,
final String[] iLabels) {
final OrientEdge toAdd;
final ODocument fieldRecord = ((OIdentifia... | [
"protected",
"static",
"OrientEdge",
"getEdge",
"(",
"final",
"OrientBaseGraph",
"graph",
",",
"final",
"ODocument",
"doc",
",",
"String",
"fieldName",
",",
"final",
"OPair",
"<",
"Direction",
",",
"String",
">",
"connection",
",",
"final",
"Object",
"fieldValue... | (Internal only) | [
"(",
"Internal",
"only",
")"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java#L287-L326 | test | Get an edge from the document. | Of course, here is the Java code you requested:
```java
protected static OrientEdge getEdge(final OrientBaseGraph graph, final ODocument doc, String fieldName,
final OPair<Direction, String> connection, final Object fieldValue, final OIdentifiable iTargetVertex,
final String[] iLabels) {
final OrientEd... |
boonproject/boon | boon/src/main/java/org/boon/core/reflection/Fields.java | Fields.classHasStringField | public static boolean classHasStringField( Class<?> clz, String name ) {
List<Field> fields = Reflection.getAllFields( clz );
for ( Field field : fields ) {
if (
field.getType().equals( Typ.string ) &&
field.getName().equals( name ) &&
... | java | public static boolean classHasStringField( Class<?> clz, String name ) {
List<Field> fields = Reflection.getAllFields( clz );
for ( Field field : fields ) {
if (
field.getType().equals( Typ.string ) &&
field.getName().equals( name ) &&
... | [
"public",
"static",
"boolean",
"classHasStringField",
"(",
"Class",
"<",
"?",
">",
"clz",
",",
"String",
"name",
")",
"{",
"List",
"<",
"Field",
">",
"fields",
"=",
"Reflection",
".",
"getAllFields",
"(",
"clz",
")",
";",
"for",
"(",
"Field",
"field",
... | Checks to see if this class has a string field.
@param clz
@param name
@return | [
"Checks",
"to",
"see",
"if",
"this",
"class",
"has",
"a",
"string",
"field",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/core/reflection/Fields.java#L78-L93 | test | Checks if a class has a string field with the given name. | Of course, here is the Java code you requested:
```java
public static boolean classHasStringField( Class<?> clz, String name ) {
List<Field> fields = Reflection.getAllFields( clz );
for ( Field field : fields ) {
if (
field.getType().equals( Typ.string ) &&
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/conv/CF1Convention.java | CF1Convention.getAxisType | protected AxisType getAxisType(NetcdfDataset ncDataset, VariableEnhanced v) {
// standard names for unitless vertical coords
String sname = ncDataset.findAttValueIgnoreCase((Variable) v, CF.STANDARD_NAME, null);
if (sname != null) {
sname = sname.trim();
for (String vertical_coord : ve... | java | protected AxisType getAxisType(NetcdfDataset ncDataset, VariableEnhanced v) {
// standard names for unitless vertical coords
String sname = ncDataset.findAttValueIgnoreCase((Variable) v, CF.STANDARD_NAME, null);
if (sname != null) {
sname = sname.trim();
for (String vertical_coord : ve... | [
"protected",
"AxisType",
"getAxisType",
"(",
"NetcdfDataset",
"ncDataset",
",",
"VariableEnhanced",
"v",
")",
"{",
"// standard names for unitless vertical coords\r",
"String",
"sname",
"=",
"ncDataset",
".",
"findAttValueIgnoreCase",
"(",
"(",
"Variable",
")",
"v",
","... | Augment COARDS axis type identification with Standard names (including dimensionless vertical coordinates) and CF.AXIS attributes | [
"Augment",
"COARDS",
"axis",
"type",
"identification",
"with",
"Standard",
"names",
"(",
"including",
"dimensionless",
"vertical",
"coordinates",
")",
"and",
"CF",
".",
"AXIS",
"attributes"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/conv/CF1Convention.java#L365-L444 | test | Get the AxisType attribute of the VariableEnhanced object | Of course, here is the Java code you requested:
```java
protected AxisType getAxisType(NetcdfDataset ncDataset, VariableEnhanced v) {
// standard names for unitless vertical coords
String sname = ncDataset.findAttValueIgnoreCase((Variable) v, CF.STANDARD_NAME, null);
if (sname != null) {
sname... |
apache/parquet-mr | parquet-hadoop/src/main/java/org/apache/parquet/hadoop/metadata/ColumnChunkMetaData.java | IntColumnChunkMetaData.positiveLongToInt | private int positiveLongToInt(long value) {
if (!ColumnChunkMetaData.positiveLongFitsInAnInt(value)) {
throw new IllegalArgumentException("value should be positive and fit in an int: " + value);
}
return (int)(value + Integer.MIN_VALUE);
} | java | private int positiveLongToInt(long value) {
if (!ColumnChunkMetaData.positiveLongFitsInAnInt(value)) {
throw new IllegalArgumentException("value should be positive and fit in an int: " + value);
}
return (int)(value + Integer.MIN_VALUE);
} | [
"private",
"int",
"positiveLongToInt",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"!",
"ColumnChunkMetaData",
".",
"positiveLongFitsInAnInt",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"value should be positive and fit in an int: \""... | stores a positive long into an int (assuming it fits)
@param value
@return | [
"stores",
"a",
"positive",
"long",
"into",
"an",
"int",
"(",
"assuming",
"it",
"fits",
")"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/metadata/ColumnChunkMetaData.java#L341-L346 | test | Returns the integer value of a positive long. | Of course, here is the Java code you requested:
```java
private int positiveLongToInt(long value) {
if (!ColumnChunkMetaData.positiveLongFitsInAnInt(value)) {
throw new IllegalArgumentException("value should be positive and fit in an int: " + value);
}
return (int)(value + Integer.MIN_VALUE);
}
```... |
jkuhnert/ognl | src/main/java/ognl/Ognl.java | Ognl.addDefaultContext | public static Map addDefaultContext(Object root, MemberAccess memberAccess, ClassResolver classResolver,
TypeConverter converter, Map context)
{
OgnlContext result;
if (context instanceof OgnlContext) {
result = (OgnlContext) context;
} el... | java | public static Map addDefaultContext(Object root, MemberAccess memberAccess, ClassResolver classResolver,
TypeConverter converter, Map context)
{
OgnlContext result;
if (context instanceof OgnlContext) {
result = (OgnlContext) context;
} el... | [
"public",
"static",
"Map",
"addDefaultContext",
"(",
"Object",
"root",
",",
"MemberAccess",
"memberAccess",
",",
"ClassResolver",
"classResolver",
",",
"TypeConverter",
"converter",
",",
"Map",
"context",
")",
"{",
"OgnlContext",
"result",
";",
"if",
"(",
"context... | Appends the standard naming context for evaluating an OGNL expression into the context given
so that cached maps can be used as a context.
@param root
the root of the object graph
@param memberAccess
Definition for handling private/protected access.
@param classResolver
The class loading resolver that should be used t... | [
"Appends",
"the",
"standard",
"naming",
"context",
"for",
"evaluating",
"an",
"OGNL",
"expression",
"into",
"the",
"context",
"given",
"so",
"that",
"cached",
"maps",
"can",
"be",
"used",
"as",
"a",
"context",
"."
] | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/Ognl.java#L316-L329 | test | Add a context to the result. | Of course, here is the Java code you requested:
```java
public static Map addDefaultContext(Object root, MemberAccess memberAccess, ClassResolver classResolver,
TypeConverter converter, Map context)
{
OgnlContext result;
if (context instanceof OgnlContext) {... |
jboss/jboss-common-core | src/main/java/org/jboss/util/timeout/TimeoutPriorityQueueImpl.java | TimeoutPriorityQueueImpl.normalizeUp | private boolean normalizeUp(int index)
{
// INV: assertExpr(index > 0);
// INV: assertExpr(index <= size);
// INV: assertExpr(queue[index] != null);
if (index == 1)
return false; // at root
boolean ret = false;
long t = queue[index].time;
int p = index >> 1;
w... | java | private boolean normalizeUp(int index)
{
// INV: assertExpr(index > 0);
// INV: assertExpr(index <= size);
// INV: assertExpr(queue[index] != null);
if (index == 1)
return false; // at root
boolean ret = false;
long t = queue[index].time;
int p = index >> 1;
w... | [
"private",
"boolean",
"normalizeUp",
"(",
"int",
"index",
")",
"{",
"// INV: assertExpr(index > 0);",
"// INV: assertExpr(index <= size);",
"// INV: assertExpr(queue[index] != null);",
"if",
"(",
"index",
"==",
"1",
")",
"return",
"false",
";",
"// at root",
"boolean",
"r... | A new node has been added at index <code>index</code>.
Normalize the tree by moving the new node up the tree.
@return true if the tree was modified. | [
"A",
"new",
"node",
"has",
"been",
"added",
"at",
"index",
"<code",
">",
"index<",
"/",
"code",
">",
".",
"Normalize",
"the",
"tree",
"by",
"moving",
"the",
"new",
"node",
"up",
"the",
"tree",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/timeout/TimeoutPriorityQueueImpl.java#L369-L390 | test | Normalize up. | Of course, here is the Java code you requested:
```java
private boolean normalizeUp(int index)
{
// INV: assertExpr(index > 0);
// INV: assertExpr(index <= size);
// INV: assertExpr(queue[index] != null);
if (index == 1)
return false; // at root
boolean ret = false;
long... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/ferry/Buffer.java | Buffer.make | public static Buffer make(RefCounted requestor, int bufferSize) {
long cPtr = FerryJNI.Buffer_make__SWIG_0(RefCounted.getCPtr(requestor), requestor, bufferSize);
return (cPtr == 0) ? null : new Buffer(cPtr, false);
} | java | public static Buffer make(RefCounted requestor, int bufferSize) {
long cPtr = FerryJNI.Buffer_make__SWIG_0(RefCounted.getCPtr(requestor), requestor, bufferSize);
return (cPtr == 0) ? null : new Buffer(cPtr, false);
} | [
"public",
"static",
"Buffer",
"make",
"(",
"RefCounted",
"requestor",
",",
"int",
"bufferSize",
")",
"{",
"long",
"cPtr",
"=",
"FerryJNI",
".",
"Buffer_make__SWIG_0",
"(",
"RefCounted",
".",
"getCPtr",
"(",
"requestor",
")",
",",
"requestor",
",",
"bufferSize"... | Allocate a new buffer of at least bufferSize.<br>
<br>
@param requestor An optional value telling the Buffer class what object requested it. This is used for debugging memory leaks; it's a marker for the FERRY object (e.g. IPacket) that actually requested the buffer. If you're not an FERRY object, pass in null here.<... | [
"Allocate",
"a",
"new",
"buffer",
"of",
"at",
"least",
"bufferSize",
".",
"<br",
">",
"<br",
">"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/Buffer.java#L1106-L1109 | test | Create a new Buffer of the specified size. | Of course, here is the Java code you requested:
```java
public static Buffer make(RefCounted requestor, int bufferSize) {
long cPtr = FerryJNI.Buffer_make__SWIG_0(RefCounted.getCPtr(requestor), requestor, bufferSize);
return (cPtr == 0) ? null : new Buffer(cPtr, false);
}
```
Hope this helps! |
eclipse/packagedrone | bundles/org.eclipse.packagedrone.repo.importer.aether/src/org/eclipse/packagedrone/repo/importer/aether/AetherImporter.java | AetherImporter.prepareDependencies | public static AetherResult prepareDependencies ( final Path tmpDir, final ImportConfiguration cfg ) throws RepositoryException
{
Objects.requireNonNull ( tmpDir );
Objects.requireNonNull ( cfg );
final RepositoryContext ctx = new RepositoryContext ( tmpDir, cfg.getRepositoryUrl (), cfg.isAl... | java | public static AetherResult prepareDependencies ( final Path tmpDir, final ImportConfiguration cfg ) throws RepositoryException
{
Objects.requireNonNull ( tmpDir );
Objects.requireNonNull ( cfg );
final RepositoryContext ctx = new RepositoryContext ( tmpDir, cfg.getRepositoryUrl (), cfg.isAl... | [
"public",
"static",
"AetherResult",
"prepareDependencies",
"(",
"final",
"Path",
"tmpDir",
",",
"final",
"ImportConfiguration",
"cfg",
")",
"throws",
"RepositoryException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"tmpDir",
")",
";",
"Objects",
".",
"requireNonNu... | Prepare an import with dependencies
<p>
This method does resolve even transient dependencies and also adds the
sources if requested
</p> | [
"Prepare",
"an",
"import",
"with",
"dependencies",
"<p",
">",
"This",
"method",
"does",
"resolve",
"even",
"transient",
"dependencies",
"and",
"also",
"adds",
"the",
"sources",
"if",
"requested",
"<",
"/",
"p",
">"
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.eclipse.packagedrone.repo.importer.aether/src/org/eclipse/packagedrone/repo/importer/aether/AetherImporter.java#L188-L224 | test | Prepare dependencies for a JCR node. | Of course, here is the Java code you requested:
```java
public static AetherResult prepareDependencies ( final Path tmpDir, final ImportConfiguration cfg ) throws RepositoryException
{
Objects.requireNonNull ( tmpDir );
Objects.requireNonNull ( cfg );
final RepositoryContext ctx = new Repo... |
sharneng/gm4java | src/main/java/org/gm4java/im4java/GMOperation.java | GMOperation.limitThreads | public GMOperation limitThreads(final int threadsPerProcess) {
final List<String> args = getCmdArgs();
args.add("-limit");
args.add("threads");
args.add(Integer.toString(threadsPerProcess));
return this;
} | java | public GMOperation limitThreads(final int threadsPerProcess) {
final List<String> args = getCmdArgs();
args.add("-limit");
args.add("threads");
args.add(Integer.toString(threadsPerProcess));
return this;
} | [
"public",
"GMOperation",
"limitThreads",
"(",
"final",
"int",
"threadsPerProcess",
")",
"{",
"final",
"List",
"<",
"String",
">",
"args",
"=",
"getCmdArgs",
"(",
")",
";",
"args",
".",
"add",
"(",
"\"-limit\"",
")",
";",
"args",
".",
"add",
"(",
"\"threa... | Limits the number of threads used by the GraphicsMagick process during execution. Note that no validation is
made, so ensure that the value is a non-positive integer presumably less than the maximum CPU cores on the host.
@param threadsPerProcess
Number of threads to use per process.
@return Builder object for chained... | [
"Limits",
"the",
"number",
"of",
"threads",
"used",
"by",
"the",
"GraphicsMagick",
"process",
"during",
"execution",
".",
"Note",
"that",
"no",
"validation",
"is",
"made",
"so",
"ensure",
"that",
"the",
"value",
"is",
"a",
"non",
"-",
"positive",
"integer",
... | 92f3f3b64a45f312ef6978f2367263ec64ff0c04 | https://github.com/sharneng/gm4java/blob/92f3f3b64a45f312ef6978f2367263ec64ff0c04/src/main/java/org/gm4java/im4java/GMOperation.java#L171-L177 | test | Limit number of threads to be executed. | Of course, here is the Java code you requested:
```java
public GMOperation limitThreads(final int threadsPerProcess) {
final List<String> args = getCmdArgs();
args.add("-limit");
args.add("threads");
args.add(Integer.toString(threadsPerProcess));
return this;
}
```
Hope thi... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java | ObjectFactory.createGruppennummer | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "gruppennummer")
public JAXBElement<String> createGruppennummer(String value) {
return new JAXBElement<String>(_Gruppennummer_QNAME, String.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "gruppennummer")
public JAXBElement<String> createGruppennummer(String value) {
return new JAXBElement<String>(_Gruppennummer_QNAME, String.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immoxml.de\"",
",",
"name",
"=",
"\"gruppennummer\"",
")",
"public",
"JAXBElement",
"<",
"String",
">",
"createGruppennummer",
"(",
"String",
"value",
")",
"{",
"return",
"new",
"JAXBElement",
"<",
"Strin... | Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"String",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L2232-L2235 | test | Create an instance of a Gruppennummer type. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "gruppennummer")
public JAXBElement<String> createGruppennummer(String value) {
return new JAXBElement<String>(_Gruppennummer_QNAME, String.class, null, value);
}
```
Hope this helps! |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/gfd/SnapshotRecordReader.java | SnapshotRecordReader.readSnapshotRecord | public SnapshotRecord readSnapshotRecord() throws IOException, ClassNotFoundException {
byte[] key = DataSerializer.readByteArray(dis);
if (key == null) {
return null;
}
byte[] value = DataSerializer.readByteArray(dis);
return new SnapshotRecord(key, value);
} | java | public SnapshotRecord readSnapshotRecord() throws IOException, ClassNotFoundException {
byte[] key = DataSerializer.readByteArray(dis);
if (key == null) {
return null;
}
byte[] value = DataSerializer.readByteArray(dis);
return new SnapshotRecord(key, value);
} | [
"public",
"SnapshotRecord",
"readSnapshotRecord",
"(",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"byte",
"[",
"]",
"key",
"=",
"DataSerializer",
".",
"readByteArray",
"(",
"dis",
")",
";",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"re... | Reads a snapshot entry. If the last entry has been read, a null value will be returned.
@return the entry or null
@throws IOException unable to read entry
@throws ClassNotFoundException unable to create entry | [
"Reads",
"a",
"snapshot",
"entry",
".",
"If",
"the",
"last",
"entry",
"has",
"been",
"read",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/gfd/SnapshotRecordReader.java#L141-L149 | test | Read a SnapshotRecord from the stream. | Of course, here is the Java code you requested:
```java
public SnapshotRecord readSnapshotRecord() throws IOException, ClassNotFoundException {
byte[] key = DataSerializer.readByteArray(dis);
if (key == null) {
return null;
}
byte[] value = DataSerializer.readByteArray(dis);
retu... |
kocakosm/pitaya | src/org/kocakosm/pitaya/time/Dates.java | Dates.isSameInstant | public static boolean isSameInstant(Calendar cal1, Calendar cal2)
{
return isSameInstant(cal1.getTime(), cal2.getTime());
} | java | public static boolean isSameInstant(Calendar cal1, Calendar cal2)
{
return isSameInstant(cal1.getTime(), cal2.getTime());
} | [
"public",
"static",
"boolean",
"isSameInstant",
"(",
"Calendar",
"cal1",
",",
"Calendar",
"cal2",
")",
"{",
"return",
"isSameInstant",
"(",
"cal1",
".",
"getTime",
"(",
")",
",",
"cal2",
".",
"getTime",
"(",
")",
")",
";",
"}"
] | Returns whether the given {@code Calendar}s represent the same instant.
@param cal1 the first {@code Calendar}.
@param cal2 the second {@code Calendar}.
@return whether the given {@code Calendar}s represent the same instant.
@throws NullPointerException if one of the arguments is {@code null}. | [
"Returns",
"whether",
"the",
"given",
"{",
"@code",
"Calendar",
"}",
"s",
"represent",
"the",
"same",
"instant",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/time/Dates.java#L85-L88 | test | Checks if two calendars are in the same instant. | Of course, here is the Java code you requested:
```java
public static boolean isSameInstant(Calendar cal1, Calendar cal2)
{
return isSameInstant(cal1.getTime(), cal2.getTime());
}
```
Hope this helps! |
Unidata/thredds | grib/src/main/java/ucar/nc2/grib/grib1/tables/FnmocTables.java | FnmocTables.getLevelType | protected VertCoordType getLevelType(int code) {
if (levelTypesMap == null)
levelTypesMap = readFnmocTable3(fnmocTable3);
if (levelTypesMap == null)
return super.getLevelType(code);
VertCoordType levelType = levelTypesMap.get(code);
if (levelType != null) return levelType;
retur... | java | protected VertCoordType getLevelType(int code) {
if (levelTypesMap == null)
levelTypesMap = readFnmocTable3(fnmocTable3);
if (levelTypesMap == null)
return super.getLevelType(code);
VertCoordType levelType = levelTypesMap.get(code);
if (levelType != null) return levelType;
retur... | [
"protected",
"VertCoordType",
"getLevelType",
"(",
"int",
"code",
")",
"{",
"if",
"(",
"levelTypesMap",
"==",
"null",
")",
"levelTypesMap",
"=",
"readFnmocTable3",
"(",
"fnmocTable3",
")",
";",
"if",
"(",
"levelTypesMap",
"==",
"null",
")",
"return",
"super",
... | / levels | [
"/",
"levels"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib1/tables/FnmocTables.java#L97-L106 | test | Get the VertCoordType for a level code. | Of course, here is the Java code you requested:
```java
protected VertCoordType getLevelType(int code) {
if (levelTypesMap == null)
levelTypesMap = readFnmocTable3(fnmocTable3);
if (levelTypesMap == null)
return super.getLevelType(code);
VertCoordType levelType = levelTypesMap.get(code);... |
sinetja/netty-router | src/main/java/io/netty/handler/codec/http/router/Router.java | Router.CONNECT_LAST | public Router<T> CONNECT_LAST(String path, T target) {
return addRouteLast(HttpMethod.CONNECT, path, target);
} | java | public Router<T> CONNECT_LAST(String path, T target) {
return addRouteLast(HttpMethod.CONNECT, path, target);
} | [
"public",
"Router",
"<",
"T",
">",
"CONNECT_LAST",
"(",
"String",
"path",
",",
"T",
"target",
")",
"{",
"return",
"addRouteLast",
"(",
"HttpMethod",
".",
"CONNECT",
",",
"path",
",",
"target",
")",
";",
"}"
] | -------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------"
] | 1bdace050de26bc4d7629b7a0c1fbea238f88e5a | https://github.com/sinetja/netty-router/blob/1bdace050de26bc4d7629b7a0c1fbea238f88e5a/src/main/java/io/netty/handler/codec/http/router/Router.java#L592-L594 | test | Add a CONNECT route to the router. | Of course, here is the Java code you requested:
```java
public Router<T> CONNECT_LAST(String path, T target) {
return addRouteLast(HttpMethod.CONNECT, path, target);
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/CommandUtility.java | CommandUtility.evaluateNormalCells | public static void evaluateNormalCells(final Cell cell,
final String strValue, final Map<String, Object> context,
final ExpressionEngine engine) {
if (strValue.contains(TieConstants.METHOD_PREFIX)) {
Object evaluationResult = evaluate(strValue, context, engine);
if (evaluationResult == null) {
... | java | public static void evaluateNormalCells(final Cell cell,
final String strValue, final Map<String, Object> context,
final ExpressionEngine engine) {
if (strValue.contains(TieConstants.METHOD_PREFIX)) {
Object evaluationResult = evaluate(strValue, context, engine);
if (evaluationResult == null) {
... | [
"public",
"static",
"void",
"evaluateNormalCells",
"(",
"final",
"Cell",
"cell",
",",
"final",
"String",
"strValue",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"context",
",",
"final",
"ExpressionEngine",
"engine",
")",
"{",
"if",
"(",
"strValue... | Evaluate normal cells.
@param cell
cell.
@param strValue
string value.
@param context
context.
@param engine
engine. | [
"Evaluate",
"normal",
"cells",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/CommandUtility.java#L518-L532 | test | Evaluate normal cells. | Of course, here is the Java code you requested:
```java
public static void evaluateNormalCells(final Cell cell,
final String strValue, final Map<String, Object> context,
final ExpressionEngine engine) {
if (strValue.contains(TieConstants.METHOD_PREFIX)) {
Object evaluationResult = evaluate(strValue, c... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/proj4/AlbersEqualAreaEllipse.java | AlbersEqualAreaEllipse.latLonToProj | public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) {
double fromLat = Math.toRadians(latLon.getLatitude());
double theta = computeTheta(latLon.getLongitude());
double term = earth.isSpherical() ? n2 * Math.sin(fromLat) : n * MapMath.qsfn(Math.sin(fromLat), e, one_es);
... | java | public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) {
double fromLat = Math.toRadians(latLon.getLatitude());
double theta = computeTheta(latLon.getLongitude());
double term = earth.isSpherical() ? n2 * Math.sin(fromLat) : n * MapMath.qsfn(Math.sin(fromLat), e, one_es);
... | [
"public",
"ProjectionPoint",
"latLonToProj",
"(",
"LatLonPoint",
"latLon",
",",
"ProjectionPointImpl",
"result",
")",
"{",
"double",
"fromLat",
"=",
"Math",
".",
"toRadians",
"(",
"latLon",
".",
"getLatitude",
"(",
")",
")",
";",
"double",
"theta",
"=",
"compu... | also see Snyder p 101 | [
"also",
"see",
"Snyder",
"p",
"101"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/proj4/AlbersEqualAreaEllipse.java#L400-L417 | test | Converts a LatLonPoint to a ProjectionPoint. | Of course, here is the Java code you requested:
```java
public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) {
double fromLat = Math.toRadians(latLon.getLatitude());
double theta = computeTheta(latLon.getLongitude());
double term = earth.isSpherical() ? n2 * Math.sin(fro... |
streamsets/datacollector | basic-lib/src/main/java/com/streamsets/pipeline/stage/processor/schemagen/generators/AvroSchemaGenerator.java | AvroSchemaGenerator.complexSchemaForType | private Schema complexSchemaForType(
String fieldPath,
Record record,
Field field
) throws OnRecordErrorException {
Schema simpleSchema = simpleSchemaForType(fieldPath, record, field);
Schema finalSchema = simpleSchema;
if(getConfig().avroNullableFields) {
finalSchema = Schema.cre... | java | private Schema complexSchemaForType(
String fieldPath,
Record record,
Field field
) throws OnRecordErrorException {
Schema simpleSchema = simpleSchemaForType(fieldPath, record, field);
Schema finalSchema = simpleSchema;
if(getConfig().avroNullableFields) {
finalSchema = Schema.cre... | [
"private",
"Schema",
"complexSchemaForType",
"(",
"String",
"fieldPath",
",",
"Record",
"record",
",",
"Field",
"field",
")",
"throws",
"OnRecordErrorException",
"{",
"Schema",
"simpleSchema",
"=",
"simpleSchemaForType",
"(",
"fieldPath",
",",
"record",
",",
"field"... | Generates complex schema for given field that will include optional union with null and potentially default value
as well. Particularly useful to generate nested structures. | [
"Generates",
"complex",
"schema",
"for",
"given",
"field",
"that",
"will",
"include",
"optional",
"union",
"with",
"null",
"and",
"potentially",
"default",
"value",
"as",
"well",
".",
"Particularly",
"useful",
"to",
"generate",
"nested",
"structures",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/basic-lib/src/main/java/com/streamsets/pipeline/stage/processor/schemagen/generators/AvroSchemaGenerator.java#L132-L153 | test | Create a complex schema for the given field path. | Of course, here is the Java code you requested:
```java
private Schema complexSchemaForType(
String fieldPath,
Record record,
Field field
) throws OnRecordErrorException {
Schema simpleSchema = simpleSchemaForType(fieldPath, record, field);
Schema finalSchema = simpleSchema;
if(getConf... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/standard/Evaluator.java | Evaluator.findNestedStructure | static public Structure findNestedStructure(Structure s) {
for (Variable v : s.getVariables()) {
if ((v instanceof Structure))
return (Structure) v;
}
return null;
} | java | static public Structure findNestedStructure(Structure s) {
for (Variable v : s.getVariables()) {
if ((v instanceof Structure))
return (Structure) v;
}
return null;
} | [
"static",
"public",
"Structure",
"findNestedStructure",
"(",
"Structure",
"s",
")",
"{",
"for",
"(",
"Variable",
"v",
":",
"s",
".",
"getVariables",
"(",
")",
")",
"{",
"if",
"(",
"(",
"v",
"instanceof",
"Structure",
")",
")",
"return",
"(",
"Structure",... | Find first nested structure
@param s in this structure
@return first nested structure or null | [
"Find",
"first",
"nested",
"structure"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/Evaluator.java#L182-L188 | test | Find the nested structure. | Of course, here is the Java code you requested:
```java
static public Structure findNestedStructure(Structure s) {
for (Variable v : s.getVariables()) {
if ((v instanceof Structure))
return (Structure) v;
}
return null;
}
```
Hope this helps! |
rupertlssmith/lojix | lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/PrologParser.java | PrologParser.doubleLiteral | public Term doubleLiteral() throws SourceCodeException
{
Token valToken = consumeToken(FLOATING_POINT_LITERAL);
NumericType result = new DoubleLiteral(Double.parseDouble(valToken.image));
// Set the position that the literal was parsed from.
SourceCodePosition position =
... | java | public Term doubleLiteral() throws SourceCodeException
{
Token valToken = consumeToken(FLOATING_POINT_LITERAL);
NumericType result = new DoubleLiteral(Double.parseDouble(valToken.image));
// Set the position that the literal was parsed from.
SourceCodePosition position =
... | [
"public",
"Term",
"doubleLiteral",
"(",
")",
"throws",
"SourceCodeException",
"{",
"Token",
"valToken",
"=",
"consumeToken",
"(",
"FLOATING_POINT_LITERAL",
")",
";",
"NumericType",
"result",
"=",
"new",
"DoubleLiteral",
"(",
"Double",
".",
"parseDouble",
"(",
"val... | Parses a real number literal.
@return A real number literal.
@throws SourceCodeException If the next token in the sequence is not a real number literal. | [
"Parses",
"a",
"real",
"number",
"literal",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/PrologParser.java#L643-L655 | test | Consumes a DOUBLE_LITERAL token. | Of course, here is the Java code you requested:
```java
public Term doubleLiteral() throws SourceCodeException
{
Token valToken = consumeToken(FLOATING_POINT_LITERAL);
NumericType result = new DoubleLiteral(Double.parseDouble(valToken.image));
// Set the position that the literal was pars... |
ieb/sparsemapcontent | core/src/main/java/org/sakaiproject/nakamura/lite/content/ContentManagerImpl.java | ContentManagerImpl.getVersionInputStream | public InputStream getVersionInputStream(String path, String versionId, String streamId) throws AccessDeniedException,
StorageClientException, IOException {
long t = System.currentTimeMillis();
try {
accessControlManager.check(Security.ZONE_CONTENT, path, Permissions.CAN_READ);
... | java | public InputStream getVersionInputStream(String path, String versionId, String streamId) throws AccessDeniedException,
StorageClientException, IOException {
long t = System.currentTimeMillis();
try {
accessControlManager.check(Security.ZONE_CONTENT, path, Permissions.CAN_READ);
... | [
"public",
"InputStream",
"getVersionInputStream",
"(",
"String",
"path",
",",
"String",
"versionId",
",",
"String",
"streamId",
")",
"throws",
"AccessDeniedException",
",",
"StorageClientException",
",",
"IOException",
"{",
"long",
"t",
"=",
"System",
".",
"currentT... | TODO: Unit test | [
"TODO",
":",
"Unit",
"test"
] | 0570fdf868adbbf7734790cbc09fe66480e5f2dc | https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/core/src/main/java/org/sakaiproject/nakamura/lite/content/ContentManagerImpl.java#L928-L952 | test | Gets the input stream for a version of a file. | Of course, here is the Java code you requested:
```java
public InputStream getVersionInputStream(String path, String versionId, String streamId) throws AccessDeniedException,
StorageClientException, IOException {
long t = System.currentTimeMillis();
try {
accessControlManager.ch... |
lessthanoptimal/GeoRegression | main/src/georegression/struct/se/Se3_F64.java | Se3_F64.transformReverse | public Vector3D_F64 transformReverse(Vector3D_F64 src, @Nullable Vector3D_F64 dst ) {
return GeometryMath_F64.multTran(R,src,dst);
} | java | public Vector3D_F64 transformReverse(Vector3D_F64 src, @Nullable Vector3D_F64 dst ) {
return GeometryMath_F64.multTran(R,src,dst);
} | [
"public",
"Vector3D_F64",
"transformReverse",
"(",
"Vector3D_F64",
"src",
",",
"@",
"Nullable",
"Vector3D_F64",
"dst",
")",
"{",
"return",
"GeometryMath_F64",
".",
"multTran",
"(",
"R",
",",
"src",
",",
"dst",
")",
";",
"}"
] | Applies the reverse rotation to the src vector and stores the result in dst. src and dst can be the same instance
@see GeometryMath_F64#multTran(DMatrixRMaj, GeoTuple3D_F64, GeoTuple3D_F64)
@param src Input
@param dst Output | [
"Applies",
"the",
"reverse",
"rotation",
"to",
"the",
"src",
"vector",
"and",
"stores",
"the",
"result",
"in",
"dst",
".",
"src",
"and",
"dst",
"can",
"be",
"the",
"same",
"instance"
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/struct/se/Se3_F64.java#L283-L285 | test | Transform the source vector into the destination vector. | Of course, here is the Java code you requested:
```java
public Vector3D_F64 transformReverse(Vector3D_F64 src, @Nullable Vector3D_F64 dst ) {
return GeometryMath_F64.multTran(R,src,dst);
}
```
Hope this helps! |
workplacesystems/utilsj | src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java | WorkerThread.run | @Override
public void run() {
while (running) {
Runnable _runnable = null;
synchronized (this) {
while (running && runnable == null) {
try {
this.wait();
} catch (InterruptedException e) {} // Ignore, as interrupts are not used ... | java | @Override
public void run() {
while (running) {
Runnable _runnable = null;
synchronized (this) {
while (running && runnable == null) {
try {
this.wait();
} catch (InterruptedException e) {} // Ignore, as interrupts are not used ... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"while",
"(",
"running",
")",
"{",
"Runnable",
"_runnable",
"=",
"null",
";",
"synchronized",
"(",
"this",
")",
"{",
"while",
"(",
"running",
"&&",
"runnable",
"==",
"null",
")",
"{",
"try",
"{... | /* (non-Javadoc)
@see java.lang.Runnable#run() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 1b638be51997eafac4d368c14f62a16624a08d3e | https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/threadpool/WorkerThread.java#L132-L163 | test | Run method for the
WebElement. | Of course, here is the Java code you requested:
```java
@Override
public void run() {
while (running) {
Runnable _runnable = null;
synchronized (this) {
while (running && runnable == null) {
try {
this.wait();
} catch (Interrup... |
lessthanoptimal/GeoRegression | main/src/georegression/struct/shapes/Quadrilateral_F64.java | Quadrilateral_F64.set | public void set( List<Point2D_F64> list ) {
if( list.size() != 4 )
throw new IllegalArgumentException("List must have size of 4");
a.set(list.get(0));
b.set(list.get(1));
c.set(list.get(2));
d.set(list.get(3));
} | java | public void set( List<Point2D_F64> list ) {
if( list.size() != 4 )
throw new IllegalArgumentException("List must have size of 4");
a.set(list.get(0));
b.set(list.get(1));
c.set(list.get(2));
d.set(list.get(3));
} | [
"public",
"void",
"set",
"(",
"List",
"<",
"Point2D_F64",
">",
"list",
")",
"{",
"if",
"(",
"list",
".",
"size",
"(",
")",
"!=",
"4",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"List must have size of 4\"",
")",
";",
"a",
".",
"set",
"(",
... | Sets the polygon to be the same as the list. A true copy is created and no references
to points in the list are saved.
@param list List which the polygon will be set to | [
"Sets",
"the",
"polygon",
"to",
"be",
"the",
"same",
"as",
"the",
"list",
".",
"A",
"true",
"copy",
"is",
"created",
"and",
"no",
"references",
"to",
"points",
"in",
"the",
"list",
"are",
"saved",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/struct/shapes/Quadrilateral_F64.java#L198-L206 | test | Sets the data from the list of points. | Of course, here is the Java code you requested:
```java
public void set( List<Point2D_F64> list ) {
if( list.size() != 4 )
throw new IllegalArgumentException("List must have size of 4");
a.set(list.get(0));
b.set(list.get(1));
c.set(list.get(2));
d.set(list.get(3));
}
```
Hope this helps! |
streamsets/datacollector | container/src/main/java/com/streamsets/datacollector/bundles/SupportBundleManager.java | SupportBundleManager.generateNewBundleFromInstances | public SupportBundle generateNewBundleFromInstances(
List<BundleContentGenerator> generators,
BundleType bundleType
) throws IOException {
PipedInputStream inputStream = new PipedInputStream();
PipedOutputStream outputStream = new PipedOutputStream();
inputStream.connect(outputStream);
ZipOutp... | java | public SupportBundle generateNewBundleFromInstances(
List<BundleContentGenerator> generators,
BundleType bundleType
) throws IOException {
PipedInputStream inputStream = new PipedInputStream();
PipedOutputStream outputStream = new PipedOutputStream();
inputStream.connect(outputStream);
ZipOutp... | [
"public",
"SupportBundle",
"generateNewBundleFromInstances",
"(",
"List",
"<",
"BundleContentGenerator",
">",
"generators",
",",
"BundleType",
"bundleType",
")",
"throws",
"IOException",
"{",
"PipedInputStream",
"inputStream",
"=",
"new",
"PipedInputStream",
"(",
")",
"... | Return InputStream from which a new generated resource bundle can be retrieved. | [
"Return",
"InputStream",
"from",
"which",
"a",
"new",
"generated",
"resource",
"bundle",
"can",
"be",
"retrieved",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/bundles/SupportBundleManager.java#L219-L238 | test | Generate a new bundle from a list of instances. | Of course, here is the Java code you requested:
```java
public SupportBundle generateNewBundleFromInstances(
List<BundleContentGenerator> generators,
BundleType bundleType
) throws IOException {
PipedInputStream inputStream = new PipedInputStream();
PipedOutputStream outputStream = new PipedOutputStr... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/CellUtility.java | CellUtility.getRowColFromComponentAttributes | public static int[] getRowColFromComponentAttributes(final UIComponent target) {
int rowIndex = (Integer) target.getAttributes().get("data-row");
int colIndex = (Integer) target.getAttributes().get("data-column");
int[] list = new int[2];
list[0] = rowIndex;
list[1] = colIndex;
return list;
} | java | public static int[] getRowColFromComponentAttributes(final UIComponent target) {
int rowIndex = (Integer) target.getAttributes().get("data-row");
int colIndex = (Integer) target.getAttributes().get("data-column");
int[] list = new int[2];
list[0] = rowIndex;
list[1] = colIndex;
return list;
} | [
"public",
"static",
"int",
"[",
"]",
"getRowColFromComponentAttributes",
"(",
"final",
"UIComponent",
"target",
")",
"{",
"int",
"rowIndex",
"=",
"(",
"Integer",
")",
"target",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"\"data-row\"",
")",
";",
"int",... | Gets the row col from component attributes.
@param target
the target
@return the row col from component attributes | [
"Gets",
"the",
"row",
"col",
"from",
"component",
"attributes",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/CellUtility.java#L793-L801 | test | Gets the row and column from the component attributes. | Of course, here is the Java code you requested:
```java
public static int[] getRowColFromComponentAttributes(final UIComponent target) {
int rowIndex = (Integer) target.getAttributes().get("data-row");
int colIndex = (Integer) target.getAttributes().get("data-column");
int[] list = new int[2];
list[0] = ... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormFieldUtil.java | SQLFormFieldUtil.getFormFields | public List<Field> getFormFields(
Long electronicFormIdParam,
boolean includeTableFieldsParam,
boolean includeTableFieldFormRecordInfoParam
) {
List<Field> returnVal = new ArrayList();
if(electronicFormIdParam == null) {
return returnVal;
}
List<FormFieldMapping> fieldMappings =
this.getFormF... | java | public List<Field> getFormFields(
Long electronicFormIdParam,
boolean includeTableFieldsParam,
boolean includeTableFieldFormRecordInfoParam
) {
List<Field> returnVal = new ArrayList();
if(electronicFormIdParam == null) {
return returnVal;
}
List<FormFieldMapping> fieldMappings =
this.getFormF... | [
"public",
"List",
"<",
"Field",
">",
"getFormFields",
"(",
"Long",
"electronicFormIdParam",
",",
"boolean",
"includeTableFieldsParam",
",",
"boolean",
"includeTableFieldFormRecordInfoParam",
")",
"{",
"List",
"<",
"Field",
">",
"returnVal",
"=",
"new",
"ArrayList",
... | Retrieves the Form Fields {@code VALUES} for the
Electronic Form with id {@code electronicFormIdParam}.
@param electronicFormIdParam The Electronic Form to fetch fields for.
@param includeTableFieldsParam Whether to populate the table fields.
@param includeTableFieldFormRecordInfoParam Does table record form data need... | [
"Retrieves",
"the",
"Form",
"Fields",
"{",
"@code",
"VALUES",
"}",
"for",
"the",
"Electronic",
"Form",
"with",
"id",
"{",
"@code",
"electronicFormIdParam",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormFieldUtil.java#L296-L350 | test | Get the form fields for the given parameters. | Of course, here is the Java code you requested:
```java
public List<Field> getFormFields(
Long electronicFormIdParam,
boolean includeTableFieldsParam,
boolean includeTableFieldFormRecordInfoParam
) {
List<Field> returnVal = new ArrayList();
if(electronicFormIdParam == null) {
return returnVal;
}
... |
oblac/jodd | jodd-core/src/main/java/jodd/util/StringBand.java | StringBand.append | public StringBand append(String s) {
if (s == null) {
s = StringPool.NULL;
}
if (index >= array.length) {
expandCapacity();
}
array[index++] = s;
length += s.length();
return this;
} | java | public StringBand append(String s) {
if (s == null) {
s = StringPool.NULL;
}
if (index >= array.length) {
expandCapacity();
}
array[index++] = s;
length += s.length();
return this;
} | [
"public",
"StringBand",
"append",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"s",
"=",
"StringPool",
".",
"NULL",
";",
"}",
"if",
"(",
"index",
">=",
"array",
".",
"length",
")",
"{",
"expandCapacity",
"(",
")",
";",
"}... | Appends a string. | [
"Appends",
"a",
"string",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/StringBand.java#L146-L159 | test | Appends the specified string to this string band. | Of course, here is the Java code you requested:
```java
public StringBand append(String s) {
if (s == null) {
s = StringPool.NULL;
}
if (index >= array.length) {
expandCapacity();
}
array[index++] = s;
length += s.length();
return this;
}
```
Hope this helps! |
WASdev/ci.common | src/main/java/net/wasdev/wlp/common/plugins/util/SpringBootUtil.java | SpringBootUtil.isSpringBootUberJar | public static boolean isSpringBootUberJar(File artifact) {
if (artifact == null || !artifact.exists() || !artifact.isFile()) {
return false;
}
try (JarFile jarFile = new JarFile(artifact)) {
Manifest manifest = jarFile.getManifest();
if (manifest != null) {
... | java | public static boolean isSpringBootUberJar(File artifact) {
if (artifact == null || !artifact.exists() || !artifact.isFile()) {
return false;
}
try (JarFile jarFile = new JarFile(artifact)) {
Manifest manifest = jarFile.getManifest();
if (manifest != null) {
... | [
"public",
"static",
"boolean",
"isSpringBootUberJar",
"(",
"File",
"artifact",
")",
"{",
"if",
"(",
"artifact",
"==",
"null",
"||",
"!",
"artifact",
".",
"exists",
"(",
")",
"||",
"!",
"artifact",
".",
"isFile",
"(",
")",
")",
"{",
"return",
"false",
"... | Check whether the given artifact is a Spring Boot Uber JAR
@param artifact
@return true if so, false otherwise | [
"Check",
"whether",
"the",
"given",
"artifact",
"is",
"a",
"Spring",
"Boot",
"Uber",
"JAR"
] | 24fc917383e9ff60ea6a42972c86577fe0f4591e | https://github.com/WASdev/ci.common/blob/24fc917383e9ff60ea6a42972c86577fe0f4591e/src/main/java/net/wasdev/wlp/common/plugins/util/SpringBootUtil.java#L39-L65 | test | Checks if the given file is a Spring Boot Uber jar. | Of course, here is the Java code you requested:
```java
public static boolean isSpringBootUberJar(File artifact) {
if (artifact == null || !artifact.exists() || !artifact.isFile()) {
return false;
}
try (JarFile jarFile = new JarFile(artifact)) {
Manifest manifest = jar... |
robeio/robe | robe-quartz/src/main/java/io/robe/quartz/info/JobInfoProvider.java | JobInfoProvider.setCountIntervalValues | private static void setCountIntervalValues(TriggerInfo dto, TriggerBuilder<org.quartz.Trigger> builder) {
SimpleScheduleBuilder builderSc = SimpleScheduleBuilder.simpleSchedule();
if (dto.getRepeatCount() != 0)
builderSc.withRepeatCount(dto.getRepeatCount());
if (dto.getRepeatInterv... | java | private static void setCountIntervalValues(TriggerInfo dto, TriggerBuilder<org.quartz.Trigger> builder) {
SimpleScheduleBuilder builderSc = SimpleScheduleBuilder.simpleSchedule();
if (dto.getRepeatCount() != 0)
builderSc.withRepeatCount(dto.getRepeatCount());
if (dto.getRepeatInterv... | [
"private",
"static",
"void",
"setCountIntervalValues",
"(",
"TriggerInfo",
"dto",
",",
"TriggerBuilder",
"<",
"org",
".",
"quartz",
".",
"Trigger",
">",
"builder",
")",
"{",
"SimpleScheduleBuilder",
"builderSc",
"=",
"SimpleScheduleBuilder",
".",
"simpleSchedule",
"... | Helps to set count and intervals
@param dto
@param builder | [
"Helps",
"to",
"set",
"count",
"and",
"intervals"
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-quartz/src/main/java/io/robe/quartz/info/JobInfoProvider.java#L72-L80 | test | set count interval values | Of course, here is the Java code you requested:
```java
private static void setCountIntervalValues(TriggerInfo dto, TriggerBuilder<org.quartz.Trigger> builder) {
SimpleScheduleBuilder builderSc = SimpleScheduleBuilder.simpleSchedule();
if (dto.getRepeatCount() != 0)
builderSc.withRepeatCoun... |
jboss/jboss-common-core | src/main/java/org/jboss/util/graph/Vertex.java | Vertex.findEdge | public Edge<T> findEdge(Vertex<T> dest)
{
for (Edge<T> e : outgoingEdges)
{
if (e.getTo() == dest)
return e;
}
return null;
} | java | public Edge<T> findEdge(Vertex<T> dest)
{
for (Edge<T> e : outgoingEdges)
{
if (e.getTo() == dest)
return e;
}
return null;
} | [
"public",
"Edge",
"<",
"T",
">",
"findEdge",
"(",
"Vertex",
"<",
"T",
">",
"dest",
")",
"{",
"for",
"(",
"Edge",
"<",
"T",
">",
"e",
":",
"outgoingEdges",
")",
"{",
"if",
"(",
"e",
".",
"getTo",
"(",
")",
"==",
"dest",
")",
"return",
"e",
";"... | Search the outgoing edges looking for an edge whose's
edge.to == dest.
@param dest the destination
@return the outgoing edge going to dest if one exists,
null otherwise. | [
"Search",
"the",
"outgoing",
"edges",
"looking",
"for",
"an",
"edge",
"whose",
"s",
"edge",
".",
"to",
"==",
"dest",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/graph/Vertex.java#L236-L244 | test | Find the edge from the given destination vertex. | Of course, here is the Java code you requested:
```java
public Edge<T> findEdge(Vertex<T> dest)
{
for (Edge<T> e : outgoingEdges)
{
if (e.getTo() == dest)
return e;
}
return null;
}
```
Hope this helps! |
oaqa/baseqa | src/main/java/edu/cmu/lti/oaqa/type/nlp/Token.java | Token.getDepLabel | public String getDepLabel() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_depLabel == null)
jcasType.jcas.throwFeatMissing("depLabel", "edu.cmu.lti.oaqa.type.nlp.Token");
return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_depLabel);} | java | public String getDepLabel() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_depLabel == null)
jcasType.jcas.throwFeatMissing("depLabel", "edu.cmu.lti.oaqa.type.nlp.Token");
return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_depLabel);} | [
"public",
"String",
"getDepLabel",
"(",
")",
"{",
"if",
"(",
"Token_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeat_depLabel",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"depLabel\""... | getter for depLabel - gets The dependency label of the token with respect to its head.
@generated
@return value of the feature | [
"getter",
"for",
"depLabel",
"-",
"gets",
"The",
"dependency",
"label",
"of",
"the",
"token",
"with",
"respect",
"to",
"its",
"head",
"."
] | 6ea632d8e51e3e617d4876fc1185c49be0ad7eb8 | https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/nlp/Token.java#L108-L111 | test | getter for depLabel - gets | Of course, here is the Java code you requested:
```java
public String getDepLabel() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_depLabel == null)
jcasType.jcas.throwFeatMissing("depLabel", "edu.cmu.lti.oaqa.type.nlp.Token");
return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jca... |
vigna/fastutil | src/it/unimi/dsi/fastutil/Arrays.java | Arrays.ensureOffsetLength | public static void ensureOffsetLength(final int arrayLength, final int offset, final int length) {
if (offset < 0) throw new ArrayIndexOutOfBoundsException("Offset (" + offset + ") is negative");
if (length < 0) throw new IllegalArgumentException("Length (" + length + ") is negative");
if (offset + length > array... | java | public static void ensureOffsetLength(final int arrayLength, final int offset, final int length) {
if (offset < 0) throw new ArrayIndexOutOfBoundsException("Offset (" + offset + ") is negative");
if (length < 0) throw new IllegalArgumentException("Length (" + length + ") is negative");
if (offset + length > array... | [
"public",
"static",
"void",
"ensureOffsetLength",
"(",
"final",
"int",
"arrayLength",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"if",
"(",
"offset",
"<",
"0",
")",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"\"Offset (... | Ensures that a range given by an offset and a length fits an array of given length.
<p>This method may be used whenever an array range check is needed.
@param arrayLength an array length.
@param offset a start index for the fragment
@param length a length (the number of elements in the fragment).
@throws IllegalArgum... | [
"Ensures",
"that",
"a",
"range",
"given",
"by",
"an",
"offset",
"and",
"a",
"length",
"fits",
"an",
"array",
"of",
"given",
"length",
"."
] | 192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c | https://github.com/vigna/fastutil/blob/192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c/src/it/unimi/dsi/fastutil/Arrays.java#L70-L74 | test | Ensures that the offset and length are valid. | Of course, here is the Java code you requested:
```java
public static void ensureOffsetLength(final int arrayLength, final int offset, final int length) {
if (offset < 0) throw new ArrayIndexOutOfBoundsException("Offset (" + offset + ") is negative");
if (length < 0) throw new IllegalArgumentException("Length (" +... |
kocakosm/pitaya | src/org/kocakosm/pitaya/util/BaseEncoding.java | BaseEncoding.decode | public byte[] decode(String in)
{
String encoded = n > 0 ? in.replace(separator, "") : in;
ByteBuffer buf = new ByteBuffer(maxDecodedLength(encoded.length()));
int accu = 0;
int count = 0;
int decoded = 0;
for (int i = 0; i < encoded.length(); i++) {
char c = encoded.charAt(i);
if (isPaddingChar(c) &... | java | public byte[] decode(String in)
{
String encoded = n > 0 ? in.replace(separator, "") : in;
ByteBuffer buf = new ByteBuffer(maxDecodedLength(encoded.length()));
int accu = 0;
int count = 0;
int decoded = 0;
for (int i = 0; i < encoded.length(); i++) {
char c = encoded.charAt(i);
if (isPaddingChar(c) &... | [
"public",
"byte",
"[",
"]",
"decode",
"(",
"String",
"in",
")",
"{",
"String",
"encoded",
"=",
"n",
">",
"0",
"?",
"in",
".",
"replace",
"(",
"separator",
",",
"\"\"",
")",
":",
"in",
";",
"ByteBuffer",
"buf",
"=",
"new",
"ByteBuffer",
"(",
"maxDec... | Decodes the given encoded {@code String} according to this
{@code BaseEncoding}'s configuration. Decoding is not case-sensitive
when possible (namely for Base16, Base32 and Base32Hex schemes).
@param in the input {@code String}.
@return the decoded data.
@throws NullPointerException if {@code in} is {@code null}.
@t... | [
"Decodes",
"the",
"given",
"encoded",
"{",
"@code",
"String",
"}",
"according",
"to",
"this",
"{",
"@code",
"BaseEncoding",
"}",
"s",
"configuration",
".",
"Decoding",
"is",
"not",
"case",
"-",
"sensitive",
"when",
"possible",
"(",
"namely",
"for",
"Base16",... | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/BaseEncoding.java#L228-L257 | test | Decodes a string into a byte array. | Of course, here is the Java code you requested:
```java
public byte[] decode(String in)
{
String encoded = n > 0 ? in.replace(separator, "") : in;
ByteBuffer buf = new ByteBuffer(maxDecodedLength(encoded.length()));
int accu = 0;
int count = 0;
int decoded = 0;
for (int i = 0; i < encoded.length(); i++) {... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormFieldClient.java | FormFieldClient.createFieldTextMasked | public Field createFieldTextMasked(
Field formFieldParam, String maskValueParam)
{
if(formFieldParam != null && this.serviceTicket != null)
{
formFieldParam.setServiceTicket(this.serviceTicket);
}
if(maskValueParam == null || maskValueParam.trim().isEmpty())
... | java | public Field createFieldTextMasked(
Field formFieldParam, String maskValueParam)
{
if(formFieldParam != null && this.serviceTicket != null)
{
formFieldParam.setServiceTicket(this.serviceTicket);
}
if(maskValueParam == null || maskValueParam.trim().isEmpty())
... | [
"public",
"Field",
"createFieldTextMasked",
"(",
"Field",
"formFieldParam",
",",
"String",
"maskValueParam",
")",
"{",
"if",
"(",
"formFieldParam",
"!=",
"null",
"&&",
"this",
".",
"serviceTicket",
"!=",
"null",
")",
"{",
"formFieldParam",
".",
"setServiceTicket",... | Create a new Text Masked field.
@param formFieldParam Field to Create.
@param maskValueParam The masked value. Example: (999) 999 xxx.
@return Created Field. | [
"Create",
"a",
"new",
"Text",
"Masked",
"field",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormFieldClient.java#L84-L105 | test | Create a Field in Text. MASKED format. | Of course, here is the Java code you requested:
```java
public Field createFieldTextMasked(
Field formFieldParam, String maskValueParam)
{
if(formFieldParam != null && this.serviceTicket != null)
{
formFieldParam.setServiceTicket(this.serviceTicket);
}
if(ma... |
hazelcast/hazelcast-simulator | simulator/src/main/java/com/hazelcast/simulator/utils/FileUtils.java | FileUtils.copyDirectory | public static void copyDirectory(File src, File target) {
checkNotNull(src, "src can't be null");
checkNotNull(target, "target can't be null");
File[] files = src.listFiles();
if (files == null) {
return;
}
for (File srcFile : files) {
if (srcFil... | java | public static void copyDirectory(File src, File target) {
checkNotNull(src, "src can't be null");
checkNotNull(target, "target can't be null");
File[] files = src.listFiles();
if (files == null) {
return;
}
for (File srcFile : files) {
if (srcFil... | [
"public",
"static",
"void",
"copyDirectory",
"(",
"File",
"src",
",",
"File",
"target",
")",
"{",
"checkNotNull",
"(",
"src",
",",
"\"src can't be null\"",
")",
";",
"checkNotNull",
"(",
"target",
",",
"\"target can't be null\"",
")",
";",
"File",
"[",
"]",
... | Copies a directory recursively.
@param src the src directory
@param target the target directory | [
"Copies",
"a",
"directory",
"recursively",
"."
] | 231ecd05c2f33a5406d2104f74dd8a8065402034 | https://github.com/hazelcast/hazelcast-simulator/blob/231ecd05c2f33a5406d2104f74dd8a8065402034/simulator/src/main/java/com/hazelcast/simulator/utils/FileUtils.java#L410-L428 | test | Copy directory. | Of course, here is the Java code you requested:
```java
public static void copyDirectory(File src, File target) {
checkNotNull(src, "src can't be null");
checkNotNull(target, "target can't be null");
File[] files = src.listFiles();
if (files == null) {
return;
}
... |
wildfly/wildfly | jpa/subsystem/src/main/java/org/jboss/as/jpa/container/NonTxEmCloser.java | NonTxEmCloser.popCall | public static void popCall() {
Map<String, EntityManager> emStack = nonTxStack.pop();
if (emStack != null) {
for (EntityManager entityManager : emStack.values()) {
try {
if (entityManager.isOpen()) {
entityManager.close();
... | java | public static void popCall() {
Map<String, EntityManager> emStack = nonTxStack.pop();
if (emStack != null) {
for (EntityManager entityManager : emStack.values()) {
try {
if (entityManager.isOpen()) {
entityManager.close();
... | [
"public",
"static",
"void",
"popCall",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"EntityManager",
">",
"emStack",
"=",
"nonTxStack",
".",
"pop",
"(",
")",
";",
"if",
"(",
"emStack",
"!=",
"null",
")",
"{",
"for",
"(",
"EntityManager",
"entityManager",
... | current session bean invocation is ending, close any transactional entity managers created without a JTA
transaction. | [
"current",
"session",
"bean",
"invocation",
"is",
"ending",
"close",
"any",
"transactional",
"entity",
"managers",
"created",
"without",
"a",
"JTA",
"transaction",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/subsystem/src/main/java/org/jboss/as/jpa/container/NonTxEmCloser.java#L58-L75 | test | Pop the call from the non - transactional stack. | Of course, here is the Java code you requested:
```java
public static void popCall() {
Map<String, EntityManager> emStack = nonTxStack.pop();
if (emStack != null) {
for (EntityManager entityManager : emStack.values()) {
try {
if (entityManager.isOpen()) {... |
lightcouch/LightCouch | src/main/java/org/lightcouch/CouchDbClientBase.java | CouchDbClientBase.post | HttpResponse post(URI uri, String json) {
HttpPost post = new HttpPost(uri);
setEntity(post, json);
return executeRequest(post);
} | java | HttpResponse post(URI uri, String json) {
HttpPost post = new HttpPost(uri);
setEntity(post, json);
return executeRequest(post);
} | [
"HttpResponse",
"post",
"(",
"URI",
"uri",
",",
"String",
"json",
")",
"{",
"HttpPost",
"post",
"=",
"new",
"HttpPost",
"(",
"uri",
")",
";",
"setEntity",
"(",
"post",
",",
"json",
")",
";",
"return",
"executeRequest",
"(",
"post",
")",
";",
"}"
] | Performs a HTTP POST request.
@return {@link HttpResponse} | [
"Performs",
"a",
"HTTP",
"POST",
"request",
"."
] | 9646889503475e862fd2158487e1cdd805447f4a | https://github.com/lightcouch/LightCouch/blob/9646889503475e862fd2158487e1cdd805447f4a/src/main/java/org/lightcouch/CouchDbClientBase.java#L618-L622 | test | Execute a POST request. | Of course, here is the Java code you requested:
```java
HttpResponse post(URI uri, String json) {
HttpPost post = new HttpPost(uri);
setEntity(post, json);
return executeRequest(post);
}
```
Hope this helps! |
rupertlssmith/lojix | debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingMainWindow.java | SwingMainWindow.showCentrePane | public void showCentrePane(JComponent component)
{
frame.getContentPane().add(component, DesktopAppLayout.CENTER);
frame.pack();
centreComponent = component;
} | java | public void showCentrePane(JComponent component)
{
frame.getContentPane().add(component, DesktopAppLayout.CENTER);
frame.pack();
centreComponent = component;
} | [
"public",
"void",
"showCentrePane",
"(",
"JComponent",
"component",
")",
"{",
"frame",
".",
"getContentPane",
"(",
")",
".",
"add",
"(",
"component",
",",
"DesktopAppLayout",
".",
"CENTER",
")",
";",
"frame",
".",
"pack",
"(",
")",
";",
"centreComponent",
... | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingMainWindow.java#L94-L100 | test | Show the center pane of the component. | Of course, here is the Java code you requested:
```java
public void showCentrePane(JComponent component)
{
frame.getContentPane().add(component, DesktopAppLayout.CENTER);
frame.pack();
centreComponent = component;
}
```
Hope this helps! |
spring-projects/spring-security | core/src/main/java/org/springframework/security/core/context/ReactiveSecurityContextHolder.java | ReactiveSecurityContextHolder.getContext | public static Mono<SecurityContext> getContext() {
return Mono.subscriberContext()
.filter( c -> c.hasKey(SECURITY_CONTEXT_KEY))
.flatMap( c-> c.<Mono<SecurityContext>>get(SECURITY_CONTEXT_KEY));
} | java | public static Mono<SecurityContext> getContext() {
return Mono.subscriberContext()
.filter( c -> c.hasKey(SECURITY_CONTEXT_KEY))
.flatMap( c-> c.<Mono<SecurityContext>>get(SECURITY_CONTEXT_KEY));
} | [
"public",
"static",
"Mono",
"<",
"SecurityContext",
">",
"getContext",
"(",
")",
"{",
"return",
"Mono",
".",
"subscriberContext",
"(",
")",
".",
"filter",
"(",
"c",
"->",
"c",
".",
"hasKey",
"(",
"SECURITY_CONTEXT_KEY",
")",
")",
".",
"flatMap",
"(",
"c"... | Gets the {@code Mono<SecurityContext>} from Reactor {@link Context}
@return the {@code Mono<SecurityContext>} | [
"Gets",
"the",
"{"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/core/context/ReactiveSecurityContextHolder.java#L39-L43 | test | Get the security context. | Of course, here is the Java code you requested:
```java
public static Mono<SecurityContext> getContext() {
return Mono.subscriberContext()
.filter( c -> c.hasKey(SECURITY_CONTEXT_KEY))
.flatMap( c-> c.<Mono<SecurityContext>>get(SECURITY_CONTEXT_KEY));
}
```
Hope this helps! |
jcodec/jcodec | src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java | BlockInterpolator.getLuma11Unsafe | void getLuma11Unsafe(byte[] pic, int picW, int imgH, byte[] blk, int blkOff, int blkStride, int x, int y,
int blkW, int blkH) {
getLuma20Unsafe(pic, picW, imgH, blk, blkOff, blkStride, x, y, blkW, blkH);
getLuma02Unsafe(pic, picW, imgH, tmp3, 0, blkW, x, y, blkW, blkH);
merge(blk, t... | java | void getLuma11Unsafe(byte[] pic, int picW, int imgH, byte[] blk, int blkOff, int blkStride, int x, int y,
int blkW, int blkH) {
getLuma20Unsafe(pic, picW, imgH, blk, blkOff, blkStride, x, y, blkW, blkH);
getLuma02Unsafe(pic, picW, imgH, tmp3, 0, blkW, x, y, blkW, blkH);
merge(blk, t... | [
"void",
"getLuma11Unsafe",
"(",
"byte",
"[",
"]",
"pic",
",",
"int",
"picW",
",",
"int",
"imgH",
",",
"byte",
"[",
"]",
"blk",
",",
"int",
"blkOff",
",",
"int",
"blkStride",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"blkW",
",",
"int",
"blkH"... | Qpel (1, 1) unsafe | [
"Qpel",
"(",
"1",
"1",
")",
"unsafe"
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java#L697-L703 | test | getLuma11Unsafe This is a version of getMergeLuma2 except that it is used to merge the blocks of the image. | Of course, here is the Java code you requested:
```java
void getLuma11Unsafe(byte[] pic, int picW, int imgH, byte[] blk, int blkOff, int blkStride, int x, int y,
int blkW, int blkH) {
getLuma20Unsafe(pic, picW, imgH, blk, blkOff, blkStride, x, y, blkW, blkH);
getLuma02Unsafe(pic, picW, imgH... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.