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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LukeDeighton/WheelView | WheelViewLib/src/main/java/com/lukedeighton/wheelview/WheelView.java | WheelView.setAngle | public void setAngle(float angle) {
mAngle = angle;
updateSelectedPosition();
if (mOnAngleChangeListener != null) {
mOnAngleChangeListener.onWheelAngleChange(mAngle);
}
invalidate();
} | java | public void setAngle(float angle) {
mAngle = angle;
updateSelectedPosition();
if (mOnAngleChangeListener != null) {
mOnAngleChangeListener.onWheelAngleChange(mAngle);
}
invalidate();
} | [
"public",
"void",
"setAngle",
"(",
"float",
"angle",
")",
"{",
"mAngle",
"=",
"angle",
";",
"updateSelectedPosition",
"(",
")",
";",
"if",
"(",
"mOnAngleChangeListener",
"!=",
"null",
")",
"{",
"mOnAngleChangeListener",
".",
"onWheelAngleChange",
"(",
"mAngle",
... | Set the angle of the wheel instantaneously.
Note this does not animate to the provided angle.
@param angle given in degrees and can be any value (not only between 0 and 360) | [
"Set",
"the",
"angle",
"of",
"the",
"wheel",
"instantaneously",
".",
"Note",
"this",
"does",
"not",
"animate",
"to",
"the",
"provided",
"angle",
"."
] | 0949e04df02f7ad43e1c0384542fa4c9bebe5161 | https://github.com/LukeDeighton/WheelView/blob/0949e04df02f7ad43e1c0384542fa4c9bebe5161/WheelViewLib/src/main/java/com/lukedeighton/wheelview/WheelView.java#L915-L925 | test | Sets the angle of the wheel. | Of course, here is the Java code you requested:
```java
public void setAngle(float angle) {
mAngle = angle;
updateSelectedPosition();
if (mOnAngleChangeListener != null) {
mOnAngleChangeListener.onWheelAngleChange(mAngle);
}
invalidate();
}
```
Hope this help... |
real-logic/aeron | aeron-driver/src/main/java/io/aeron/driver/media/UdpChannel.java | UdpChannel.canonicalise | public static String canonicalise(final InetSocketAddress localData, final InetSocketAddress remoteData)
{
final StringBuilder builder = new StringBuilder(48);
builder.append("UDP-");
toHex(builder, localData.getAddress().getAddress())
.append('-')
.append(localData... | java | public static String canonicalise(final InetSocketAddress localData, final InetSocketAddress remoteData)
{
final StringBuilder builder = new StringBuilder(48);
builder.append("UDP-");
toHex(builder, localData.getAddress().getAddress())
.append('-')
.append(localData... | [
"public",
"static",
"String",
"canonicalise",
"(",
"final",
"InetSocketAddress",
"localData",
",",
"final",
"InetSocketAddress",
"remoteData",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"48",
")",
";",
"builder",
".",
"append"... | Return a string which is a canonical form of the channel suitable for use as a file or directory
name and also as a method of hashing, etc.
<p>
A canonical form:
<ul>
<li>begins with the string "UDP-"</li>
<li>has all addresses converted to hexadecimal</li>
<li>uses "-" as all field separators</li>
</ul>
<p>
The genera... | [
"Return",
"a",
"string",
"which",
"is",
"a",
"canonical",
"form",
"of",
"the",
"channel",
"suitable",
"for",
"use",
"as",
"a",
"file",
"or",
"directory",
"name",
"and",
"also",
"as",
"a",
"method",
"of",
"hashing",
"etc",
".",
"<p",
">",
"A",
"canonica... | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-driver/src/main/java/io/aeron/driver/media/UdpChannel.java#L226-L243 | test | Canonicalise the local and remote data to a string. | Of course, here is the Java code you requested:
```java
public static String canonicalise(final InetSocketAddress localData, final InetSocketAddress remoteData)
{
final StringBuilder builder = new StringBuilder(48);
builder.append("UDP-");
toHex(builder, localData.getAddress().getAddress(... |
streamsets/datacollector | mysql-binlog-lib/src/main/java/com/streamsets/pipeline/stage/origin/mysql/EventBuffer.java | EventBuffer.poll | public EnrichedEvent poll(long timeout, TimeUnit unit) throws StageException {
try {
return queue.poll(timeout, unit);
} catch (InterruptedException e) {
LOG.error(Errors.MYSQL_001.getMessage(), e.toString(), e);
Thread.currentThread().interrupt();
throw new StageException(Errors.MYSQL_0... | java | public EnrichedEvent poll(long timeout, TimeUnit unit) throws StageException {
try {
return queue.poll(timeout, unit);
} catch (InterruptedException e) {
LOG.error(Errors.MYSQL_001.getMessage(), e.toString(), e);
Thread.currentThread().interrupt();
throw new StageException(Errors.MYSQL_0... | [
"public",
"EnrichedEvent",
"poll",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"StageException",
"{",
"try",
"{",
"return",
"queue",
".",
"poll",
"(",
"timeout",
",",
"unit",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")"... | Read next event from buffer with respect to maximum timeout.
@param timeout timeout.
@param unit timeout time unit.
@return next event of null
@throws StageException | [
"Read",
"next",
"event",
"from",
"buffer",
"with",
"respect",
"to",
"maximum",
"timeout",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/mysql-binlog-lib/src/main/java/com/streamsets/pipeline/stage/origin/mysql/EventBuffer.java#L49-L57 | test | Poll for an EnrichedEvent. | Of course, here is the Java code you requested:
```java
public EnrichedEvent poll(long timeout, TimeUnit unit) throws StageException {
try {
return queue.poll(timeout, unit);
} catch (InterruptedException e) {
LOG.error(Errors.MYSQL_001.getMessage(), e.toString(), e);
Thread.currentThread().i... |
apache/parquet-mr | parquet-hadoop/src/main/java/org/apache/parquet/hadoop/codec/SnappyDecompressor.java | SnappyDecompressor.decompress | @Override
public synchronized int decompress(byte[] buffer, int off, int len) throws IOException {
SnappyUtil.validateBuffer(buffer, off, len);
if (inputBuffer.position() == 0 && !outputBuffer.hasRemaining()) {
return 0;
}
if (!outputBuffer.hasRemaining()) {
inputBuffer.rewind();
P... | java | @Override
public synchronized int decompress(byte[] buffer, int off, int len) throws IOException {
SnappyUtil.validateBuffer(buffer, off, len);
if (inputBuffer.position() == 0 && !outputBuffer.hasRemaining()) {
return 0;
}
if (!outputBuffer.hasRemaining()) {
inputBuffer.rewind();
P... | [
"@",
"Override",
"public",
"synchronized",
"int",
"decompress",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"SnappyUtil",
".",
"validateBuffer",
"(",
"buffer",
",",
"off",
",",
"len",
")",
";"... | Fills specified buffer with uncompressed data. Returns actual number
of bytes of uncompressed data. A return value of 0 indicates that
{@link #needsInput()} should be called in order to determine if more
input data is required.
@param buffer Buffer for the compressed data
@param off Start offset of the data
@param l... | [
"Fills",
"specified",
"buffer",
"with",
"uncompressed",
"data",
".",
"Returns",
"actual",
"number",
"of",
"bytes",
"of",
"uncompressed",
"data",
".",
"A",
"return",
"value",
"of",
"0",
"indicates",
"that",
"{",
"@link",
"#needsInput",
"()",
"}",
"should",
"b... | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/codec/SnappyDecompressor.java#L50-L83 | test | This method is called to decompress the input data from the specified buffer. | Of course, here is the Java code you requested:
```java
@Override
public synchronized int decompress(byte[] buffer, int off, int len) throws IOException {
SnappyUtil.validateBuffer(buffer, off, len);
if (inputBuffer.position() == 0 && !outputBuffer.hasRemaining()) {
return 0;
}
if (!outputBuf... |
lessthanoptimal/GeoRegression | main/src/georegression/geometry/UtilLine2D_F64.java | UtilLine2D_F64.convert | public static LinePolar2D_F64 convert( LineGeneral2D_F64 src , LinePolar2D_F64 ret )
{
if( ret == null )
ret = new LinePolar2D_F64();
double r = Math.sqrt(src.A*src.A + src.B*src.B);
double sign = src.C < 0 ? -1 : 1;
ret.angle = Math.atan2(-sign*src.B/r,-sign*src.A/r);
ret.distance = sign*src.C/r;
r... | java | public static LinePolar2D_F64 convert( LineGeneral2D_F64 src , LinePolar2D_F64 ret )
{
if( ret == null )
ret = new LinePolar2D_F64();
double r = Math.sqrt(src.A*src.A + src.B*src.B);
double sign = src.C < 0 ? -1 : 1;
ret.angle = Math.atan2(-sign*src.B/r,-sign*src.A/r);
ret.distance = sign*src.C/r;
r... | [
"public",
"static",
"LinePolar2D_F64",
"convert",
"(",
"LineGeneral2D_F64",
"src",
",",
"LinePolar2D_F64",
"ret",
")",
"{",
"if",
"(",
"ret",
"==",
"null",
")",
"ret",
"=",
"new",
"LinePolar2D_F64",
"(",
")",
";",
"double",
"r",
"=",
"Math",
".",
"sqrt",
... | Converts a line from general to polar.
@param src (input) line is general notation
@param ret (output) line in polar notation. If null a new instance will be created.
@return Converted line in polar notation | [
"Converts",
"a",
"line",
"from",
"general",
"to",
"polar",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilLine2D_F64.java#L122-L135 | test | Converts a line general into a line polar 2D image. | Of course, here is the Java code you requested:
```java
public static LinePolar2D_F64 convert( LineGeneral2D_F64 src , LinePolar2D_F64 ret )
{
if( ret == null )
ret = new LinePolar2D_F64();
double r = Math.sqrt(src.A*src.A + src.B*src.B);
double sign = src.C < 0 ? -1 : 1;
ret.angle = Math.atan2(-sign*sr... |
wildfly/wildfly | messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/TransportConfigOperationHandlers.java | TransportConfigOperationHandlers.processAcceptors | static void processAcceptors(final OperationContext context, final Configuration configuration, final ModelNode params, final Set<String> bindings) throws OperationFailedException {
final Map<String, TransportConfiguration> acceptors = new HashMap<>();
if (params.hasDefined(ACCEPTOR)) {
for ... | java | static void processAcceptors(final OperationContext context, final Configuration configuration, final ModelNode params, final Set<String> bindings) throws OperationFailedException {
final Map<String, TransportConfiguration> acceptors = new HashMap<>();
if (params.hasDefined(ACCEPTOR)) {
for ... | [
"static",
"void",
"processAcceptors",
"(",
"final",
"OperationContext",
"context",
",",
"final",
"Configuration",
"configuration",
",",
"final",
"ModelNode",
"params",
",",
"final",
"Set",
"<",
"String",
">",
"bindings",
")",
"throws",
"OperationFailedException",
"{... | Process the acceptor information.
@param context the operation context
@param configuration the ActiveMQ configuration
@param params the detyped operation parameters
@param bindings the referenced socket bindings
@throws OperationFailedException | [
"Process",
"the",
"acceptor",
"information",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/TransportConfigOperationHandlers.java#L254-L306 | test | Process acceptors. | Of course, here is the Java code you requested:
```java
static void processAcceptors(final OperationContext context, final Configuration configuration, final ModelNode params, final Set<String> bindings) throws OperationFailedException {
final Map<String, TransportConfiguration> acceptors = new HashMap<>();
... |
deeplearning4j/nd4j | nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java | ArrowSerde.addDataForArr | public static int addDataForArr(FlatBufferBuilder bufferBuilder, INDArray arr) {
int offset = DataBufferStruct.createDataBufferStruct(bufferBuilder,arr.data());
int ret = Buffer.createBuffer(bufferBuilder,offset,arr.data().length() * arr.data().getElementSize());
return ret;
} | java | public static int addDataForArr(FlatBufferBuilder bufferBuilder, INDArray arr) {
int offset = DataBufferStruct.createDataBufferStruct(bufferBuilder,arr.data());
int ret = Buffer.createBuffer(bufferBuilder,offset,arr.data().length() * arr.data().getElementSize());
return ret;
} | [
"public",
"static",
"int",
"addDataForArr",
"(",
"FlatBufferBuilder",
"bufferBuilder",
",",
"INDArray",
"arr",
")",
"{",
"int",
"offset",
"=",
"DataBufferStruct",
".",
"createDataBufferStruct",
"(",
"bufferBuilder",
",",
"arr",
".",
"data",
"(",
")",
")",
";",
... | Create a {@link Buffer}
representing the location metadata of the actual data
contents for the ndarrays' {@link DataBuffer}
@param bufferBuilder the buffer builder in use
@param arr the array to add the underlying data for
@return the offset added | [
"Create",
"a",
"{"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java#L87-L92 | test | Add data for an ndarray | Of course, here is the Java code you requested:
```java
public static int addDataForArr(FlatBufferBuilder bufferBuilder, INDArray arr) {
int offset = DataBufferStruct.createDataBufferStruct(bufferBuilder,arr.data());
int ret = Buffer.createBuffer(bufferBuilder,offset,arr.data().length() * arr.data().ge... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasZdscal | public static void cublasZdscal(int n, double alpha, Pointer x, int incx)
{
cublasZdscalNative(n, alpha, x, incx);
checkResultBLAS();
} | java | public static void cublasZdscal(int n, double alpha, Pointer x, int incx)
{
cublasZdscalNative(n, alpha, x, incx);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasZdscal",
"(",
"int",
"n",
",",
"double",
"alpha",
",",
"Pointer",
"x",
",",
"int",
"incx",
")",
"{",
"cublasZdscalNative",
"(",
"n",
",",
"alpha",
",",
"x",
",",
"incx",
")",
";",
"checkResultBLAS",
"(",
")",
";",
"... | <pre>
void
cublasZdscal (int n, double alpha, cuDoubleComplex *x, int incx)
replaces double-complex vector x with double-complex alpha * x. For i
= 0 to n - 1, it replaces x[ix + i * incx] with alpha * x[ix + i * incx],
where ix = 1 if incx >= 0, else ix = 1 + (1 - n) * incx.
Input
-----
n number of elements in ... | [
"<pre",
">",
"void",
"cublasZdscal",
"(",
"int",
"n",
"double",
"alpha",
"cuDoubleComplex",
"*",
"x",
"int",
"incx",
")"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L2554-L2558 | test | Cublas zdscal for a symmetric matrix. | Of course, here is the Java code you requested:
```java
public static void cublasZdscal(int n, double alpha, Pointer x, int incx)
{
cublasZdscalNative(n, alpha, x, incx);
checkResultBLAS();
}
```
Hope this helps! |
stanfy/enroscar | io/src/main/java/com/stanfy/enroscar/io/IoUtils.java | IoUtils.consumeStream | public static void consumeStream(final InputStream input, final BuffersPool buffersPool) throws IOException {
// do not use skip, just use a buffer and read it all
final byte[] buffer = buffersPool == null
? new byte[BUFFER_SIZE_8K]
: buffersPool.get(BUFFER_SIZE_8K);
try {
//noinspect... | java | public static void consumeStream(final InputStream input, final BuffersPool buffersPool) throws IOException {
// do not use skip, just use a buffer and read it all
final byte[] buffer = buffersPool == null
? new byte[BUFFER_SIZE_8K]
: buffersPool.get(BUFFER_SIZE_8K);
try {
//noinspect... | [
"public",
"static",
"void",
"consumeStream",
"(",
"final",
"InputStream",
"input",
",",
"final",
"BuffersPool",
"buffersPool",
")",
"throws",
"IOException",
"{",
"// do not use skip, just use a buffer and read it all",
"final",
"byte",
"[",
"]",
"buffer",
"=",
"buffersP... | Consume the stream and close it.
This implementation calls {@link InputStream#read(byte[])} method and ignores any read bytes.
@param input input stream
@throws IOException if I/O error happens | [
"Consume",
"the",
"stream",
"and",
"close",
"it",
".",
"This",
"implementation",
"calls",
"{",
"@link",
"InputStream#read",
"(",
"byte",
"[]",
")",
"}",
"method",
"and",
"ignores",
"any",
"read",
"bytes",
"."
] | 0e64f3c309d62e359b55ddcba10e3cc592f5e083 | https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/io/src/main/java/com/stanfy/enroscar/io/IoUtils.java#L133-L150 | test | Consumes the stream. | Of course, here is the Java code you requested:
```java
public static void consumeStream(final InputStream input, final BuffersPool buffersPool) throws IOException {
// do not use skip, just use a buffer and read it all
final byte[] buffer = buffersPool == null
? new byte[BUFFER_SIZE_8K]
: buff... |
walokra/markdown-page-generator-plugin | src/main/java/com/ruleoftech/markdown/page/generator/plugin/MdPageGeneratorMojo.java | MdPageGeneratorMojo.substituteVariables | private String substituteVariables(String template, String patternString, Map<String, String> variables) {
Pattern pattern = Pattern.compile(patternString);
Matcher matcher = pattern.matcher(template);
StringBuffer buffer = new StringBuffer();
while (matcher.find()) {
if (var... | java | private String substituteVariables(String template, String patternString, Map<String, String> variables) {
Pattern pattern = Pattern.compile(patternString);
Matcher matcher = pattern.matcher(template);
StringBuffer buffer = new StringBuffer();
while (matcher.find()) {
if (var... | [
"private",
"String",
"substituteVariables",
"(",
"String",
"template",
",",
"String",
"patternString",
",",
"Map",
"<",
"String",
",",
"String",
">",
"variables",
")",
"{",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"patternString",
")",
";",
... | Replace variables with given pattern.
@param template String to replace
@param patternString regexp pattern
@param variables variables to find
@return result | [
"Replace",
"variables",
"with",
"given",
"pattern",
"."
] | 2d5e0e6ca7a4509c9443d6d2fcf99dd9486bc5f7 | https://github.com/walokra/markdown-page-generator-plugin/blob/2d5e0e6ca7a4509c9443d6d2fcf99dd9486bc5f7/src/main/java/com/ruleoftech/markdown/page/generator/plugin/MdPageGeneratorMojo.java#L414-L427 | test | Substitute variables in the template. | Of course, here is the Java code you requested:
```java
private String substituteVariables(String template, String patternString, Map<String, String> variables) {
Pattern pattern = Pattern.compile(patternString);
Matcher matcher = pattern.matcher(template);
StringBuffer buffer = new StringBuffe... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/classic/net/server/ServerSocketReceiver.java | ServerSocketReceiver.shouldStart | protected boolean shouldStart() {
ServerSocket serverSocket = null;
try {
serverSocket = getServerSocketFactory().createServerSocket(
getPort(), getBacklog(), getInetAddress());
ServerListener<RemoteAppenderClient> listener =
createServerListener(serverSocket);
runner = c... | java | protected boolean shouldStart() {
ServerSocket serverSocket = null;
try {
serverSocket = getServerSocketFactory().createServerSocket(
getPort(), getBacklog(), getInetAddress());
ServerListener<RemoteAppenderClient> listener =
createServerListener(serverSocket);
runner = c... | [
"protected",
"boolean",
"shouldStart",
"(",
")",
"{",
"ServerSocket",
"serverSocket",
"=",
"null",
";",
"try",
"{",
"serverSocket",
"=",
"getServerSocketFactory",
"(",
")",
".",
"createServerSocket",
"(",
"getPort",
"(",
")",
",",
"getBacklog",
"(",
")",
",",
... | Starts the server. | [
"Starts",
"the",
"server",
"."
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/classic/net/server/ServerSocketReceiver.java#L53-L71 | test | This method is called to determine if the server should start. | Of course, here is the Java code you requested:
```java
protected boolean shouldStart() {
ServerSocket serverSocket = null;
try {
serverSocket = getServerSocketFactory().createServerSocket(
getPort(), getBacklog(), getInetAddress());
ServerListener<RemoteAppenderClient> listener =
... |
oblac/jodd | jodd-core/src/main/java/jodd/util/StringUtil.java | StringUtil.cropAll | public static void cropAll(final String... strings) {
for (int i = 0; i < strings.length; i++) {
String string = strings[i];
if (string != null) {
string = crop(strings[i]);
}
strings[i] = string;
}
} | java | public static void cropAll(final String... strings) {
for (int i = 0; i < strings.length; i++) {
String string = strings[i];
if (string != null) {
string = crop(strings[i]);
}
strings[i] = string;
}
} | [
"public",
"static",
"void",
"cropAll",
"(",
"final",
"String",
"...",
"strings",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"strings",
".",
"length",
";",
"i",
"++",
")",
"{",
"String",
"string",
"=",
"strings",
"[",
"i",
"]",
";"... | Crops all elements of string array. | [
"Crops",
"all",
"elements",
"of",
"string",
"array",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/StringUtil.java#L1994-L2002 | test | Crop all the strings in the array. | Of course, here is the Java code you requested:
```java
public static void cropAll(final String... strings) {
for (int i = 0; i < strings.length; i++) {
String string = strings[i];
if (string != null) {
string = crop(strings[i]);
}
strings[i] = string;
}
}
```
Hope this helps! |
lessthanoptimal/GeoRegression | main/src/georegression/struct/so/Rodrigues_F64.java | Rodrigues_F64.setParamVector | public void setParamVector( double x , double y , double z ) {
double ax = Math.abs(x);
double ay = Math.abs(y);
double az = Math.abs(z);
double max = Math.max(ax,ay);
max = Math.max(max,az);
if( max == 0 ) {
theta = 0;
unitAxisRotation.set(1,0,0);
} else {
x /= max;
y /= max;
z /= max... | java | public void setParamVector( double x , double y , double z ) {
double ax = Math.abs(x);
double ay = Math.abs(y);
double az = Math.abs(z);
double max = Math.max(ax,ay);
max = Math.max(max,az);
if( max == 0 ) {
theta = 0;
unitAxisRotation.set(1,0,0);
} else {
x /= max;
y /= max;
z /= max... | [
"public",
"void",
"setParamVector",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"double",
"ax",
"=",
"Math",
".",
"abs",
"(",
"x",
")",
";",
"double",
"ay",
"=",
"Math",
".",
"abs",
"(",
"y",
")",
";",
"double",
"az",
... | Assign the Rodrigues coordinates using a 3 element vector. Theta is the vector's
magnitude and the axis of rotation is the unit vector.
@param x x-component of 3 vector
@param y y-component of 3 vector
@param z z-component of 3 vector | [
"Assign",
"the",
"Rodrigues",
"coordinates",
"using",
"a",
"3",
"element",
"vector",
".",
"Theta",
"is",
"the",
"vector",
"s",
"magnitude",
"and",
"the",
"axis",
"of",
"rotation",
"is",
"the",
"unit",
"vector",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/struct/so/Rodrigues_F64.java#L97-L118 | test | Sets the parameter vector. | Of course, here is the Java code you requested:
```java
public void setParamVector( double x , double y , double z ) {
double ax = Math.abs(x);
double ay = Math.abs(y);
double az = Math.abs(z);
double max = Math.max(ax,ay);
max = Math.max(max,az);
if( max == 0 ) {
theta = 0;
unitAxisRotation.set... |
fabric8io/fabric8-maven-plugin | enricher/api/src/main/java/io/fabric8/maven/enricher/api/EnricherConfig.java | EnricherConfig.get | public String get(Configs.Key key, String defaultVal) {
String val = configuration.getProcessorConfig().orElse(ProcessorConfig.EMPTY).getConfig(name, key.name());
if (val == null) {
String fullKey = ENRICHER_PROP_PREFIX + "." + name + "." + key;
val = configuration.getPropertyWi... | java | public String get(Configs.Key key, String defaultVal) {
String val = configuration.getProcessorConfig().orElse(ProcessorConfig.EMPTY).getConfig(name, key.name());
if (val == null) {
String fullKey = ENRICHER_PROP_PREFIX + "." + name + "." + key;
val = configuration.getPropertyWi... | [
"public",
"String",
"get",
"(",
"Configs",
".",
"Key",
"key",
",",
"String",
"defaultVal",
")",
"{",
"String",
"val",
"=",
"configuration",
".",
"getProcessorConfig",
"(",
")",
".",
"orElse",
"(",
"ProcessorConfig",
".",
"EMPTY",
")",
".",
"getConfig",
"("... | Get a config value with a default. If no value is given, as a last resort, project properties are looked up.
@param key key part to lookup. The whole key is build up from <code>prefix + "." + key</code>. If key is null,
then only the prefix is used for the lookup (this is suitable for enrichers having only one config ... | [
"Get",
"a",
"config",
"value",
"with",
"a",
"default",
".",
"If",
"no",
"value",
"is",
"given",
"as",
"a",
"last",
"resort",
"project",
"properties",
"are",
"looked",
"up",
"."
] | b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3 | https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/enricher/api/src/main/java/io/fabric8/maven/enricher/api/EnricherConfig.java#L66-L74 | test | Get a value from the configuration. | Of course, here is the Java code you requested:
```java
public String get(Configs.Key key, String defaultVal) {
String val = configuration.getProcessorConfig().orElse(ProcessorConfig.EMPTY).getConfig(name, key.name());
if (val == null) {
String fullKey = ENRICHER_PROP_PREFIX + "." + name +... |
snakerflow/snakerflow | snaker-core/src/main/java/org/snaker/engine/access/jdbc/JdbcHelper.java | JdbcHelper.getDialect | public static Dialect getDialect(Connection conn) throws Exception {
DatabaseMetaData databaseMetaData = conn.getMetaData();
String databaseProductName = databaseMetaData.getDatabaseProductName();
String dbType = databaseTypeMappings.getProperty(databaseProductName);
if(StringHelper.isEmpty(db... | java | public static Dialect getDialect(Connection conn) throws Exception {
DatabaseMetaData databaseMetaData = conn.getMetaData();
String databaseProductName = databaseMetaData.getDatabaseProductName();
String dbType = databaseTypeMappings.getProperty(databaseProductName);
if(StringHelper.isEmpty(db... | [
"public",
"static",
"Dialect",
"getDialect",
"(",
"Connection",
"conn",
")",
"throws",
"Exception",
"{",
"DatabaseMetaData",
"databaseMetaData",
"=",
"conn",
".",
"getMetaData",
"(",
")",
";",
"String",
"databaseProductName",
"=",
"databaseMetaData",
".",
"getDataba... | 根据连接对象获取数据库方言
@param conn 数据库连接
@return Dialect 方言
@throws Exception | [
"根据连接对象获取数据库方言"
] | 9c8cb3148a76702f1eda22f1d113053cb44b1eff | https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/access/jdbc/JdbcHelper.java#L329-L341 | test | Get the Dialect for the current user | Of course, here is the Java code you requested:
```java
public static Dialect getDialect(Connection conn) throws Exception {
DatabaseMetaData databaseMetaData = conn.getMetaData();
String databaseProductName = databaseMetaData.getDatabaseProductName();
String dbType = databaseTypeMappings.getPr... |
oblac/jodd | jodd-core/src/main/java/jodd/util/ArraysUtil.java | ArraysUtil.indexOf | public static int indexOf(double[] array, double[] sub, int startIndex, int endIndex) {
int sublen = sub.length;
if (sublen == 0) {
return startIndex;
}
int total = endIndex - sublen + 1;
double c = sub[0];
mainloop:
for (int i = startIndex; i < total; i++) {
if (Double.compare(array[i], c) != 0) {
... | java | public static int indexOf(double[] array, double[] sub, int startIndex, int endIndex) {
int sublen = sub.length;
if (sublen == 0) {
return startIndex;
}
int total = endIndex - sublen + 1;
double c = sub[0];
mainloop:
for (int i = startIndex; i < total; i++) {
if (Double.compare(array[i], c) != 0) {
... | [
"public",
"static",
"int",
"indexOf",
"(",
"double",
"[",
"]",
"array",
",",
"double",
"[",
"]",
"sub",
",",
"int",
"startIndex",
",",
"int",
"endIndex",
")",
"{",
"int",
"sublen",
"=",
"sub",
".",
"length",
";",
"if",
"(",
"sublen",
"==",
"0",
")"... | Finds the first occurrence in an array from specified given position and upto given length. | [
"Finds",
"the",
"first",
"occurrence",
"in",
"an",
"array",
"from",
"specified",
"given",
"position",
"and",
"upto",
"given",
"length",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ArraysUtil.java#L2028-L2051 | test | Gets the index of the first occurrence of the specified sub array in the specified range of the specified array starting from the specified startIndex and ending at the specified endIndex. | Of course, here is the Java code you requested:
```java
public static int indexOf(double[] array, double[] sub, int startIndex, int endIndex) {
int sublen = sub.length;
if (sublen == 0) {
return startIndex;
}
int total = endIndex - sublen + 1;
double c = sub[0];
mainloop:
for (int i = startIndex; i < ... |
spring-projects/spring-security | taglibs/src/main/java/org/springframework/security/taglibs/authz/JspAuthorizeTag.java | JspAuthorizeTag.doStartTag | public int doStartTag() throws JspException {
try {
authorized = super.authorize();
if (!authorized && TagLibConfig.isUiSecurityDisabled()) {
pageContext.getOut().write(TagLibConfig.getSecuredUiPrefix());
}
if (var != null) {
pageContext.setAttribute(var, authorized, PageContext.PAGE_SCOPE);
... | java | public int doStartTag() throws JspException {
try {
authorized = super.authorize();
if (!authorized && TagLibConfig.isUiSecurityDisabled()) {
pageContext.getOut().write(TagLibConfig.getSecuredUiPrefix());
}
if (var != null) {
pageContext.setAttribute(var, authorized, PageContext.PAGE_SCOPE);
... | [
"public",
"int",
"doStartTag",
"(",
")",
"throws",
"JspException",
"{",
"try",
"{",
"authorized",
"=",
"super",
".",
"authorize",
"(",
")",
";",
"if",
"(",
"!",
"authorized",
"&&",
"TagLibConfig",
".",
"isUiSecurityDisabled",
"(",
")",
")",
"{",
"pageConte... | Invokes the base class {@link AbstractAuthorizeTag#authorize()} method to decide if
the body of the tag should be skipped or not.
@return {@link Tag#SKIP_BODY} or {@link Tag#EVAL_BODY_INCLUDE} | [
"Invokes",
"the",
"base",
"class",
"{",
"@link",
"AbstractAuthorizeTag#authorize",
"()",
"}",
"method",
"to",
"decide",
"if",
"the",
"body",
"of",
"the",
"tag",
"should",
"be",
"skipped",
"or",
"not",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/taglibs/src/main/java/org/springframework/security/taglibs/authz/JspAuthorizeTag.java#L67-L85 | test | Override this method to perform authorization. | Of course, here is the Java code you requested:
```java
public int doStartTag() throws JspException {
try {
authorized = super.authorize();
if (!authorized && TagLibConfig.isUiSecurityDisabled()) {
pageContext.getOut().write(TagLibConfig.getSecuredUiPrefix());
}
if (var != null) {
pageContext.s... |
oblac/jodd | jodd-props/src/main/java/jodd/props/Props.java | Props.getDoubleValue | public Double getDoubleValue(final String key) {
final String value = getValue(key);
if (value == null) {
return null;
}
return Double.valueOf(value);
} | java | public Double getDoubleValue(final String key) {
final String value = getValue(key);
if (value == null) {
return null;
}
return Double.valueOf(value);
} | [
"public",
"Double",
"getDoubleValue",
"(",
"final",
"String",
"key",
")",
"{",
"final",
"String",
"value",
"=",
"getValue",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"Double",
".",
"valueOf"... | Returns double value of given property or {@code null} if property not found. | [
"Returns",
"double",
"value",
"of",
"given",
"property",
"or",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-props/src/main/java/jodd/props/Props.java#L453-L459 | test | Gets a Double value. | Of course, here is the Java code you requested:
```java
public Double getDoubleValue(final String key) {
final String value = getValue(key);
if (value == null) {
return null;
}
return Double.valueOf(value);
}
```
Hope this helps! |
objectify/objectify | src/main/java/com/googlecode/objectify/util/Queries.java | Queries.addDistinctOn | public static void addDistinctOn(final ProjectionEntityQuery.Builder builder, final List<String> distinctOn) {
if (!distinctOn.isEmpty()) {
builder.addDistinctOn(distinctOn.get(0), distinctOn.subList(1, distinctOn.size()).toArray(new String[distinctOn.size() - 1]));
}
} | java | public static void addDistinctOn(final ProjectionEntityQuery.Builder builder, final List<String> distinctOn) {
if (!distinctOn.isEmpty()) {
builder.addDistinctOn(distinctOn.get(0), distinctOn.subList(1, distinctOn.size()).toArray(new String[distinctOn.size() - 1]));
}
} | [
"public",
"static",
"void",
"addDistinctOn",
"(",
"final",
"ProjectionEntityQuery",
".",
"Builder",
"builder",
",",
"final",
"List",
"<",
"String",
">",
"distinctOn",
")",
"{",
"if",
"(",
"!",
"distinctOn",
".",
"isEmpty",
"(",
")",
")",
"{",
"builder",
".... | The Builder api is programmer-hostile | [
"The",
"Builder",
"api",
"is",
"programmer",
"-",
"hostile"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/util/Queries.java#L58-L62 | test | Add distinct on. | Of course, here is the Java code you requested:
```java
public static void addDistinctOn(final ProjectionEntityQuery.Builder builder, final List<String> distinctOn) {
if (!distinctOn.isEmpty()) {
builder.addDistinctOn(distinctOn.get(0), distinctOn.subList(1, distinctOn.size()).toArray(new String[distinctOn.size()... |
js-lib-com/tiny-container | src/main/java/js/container/ManagedMethod.java | ManagedMethod.invoke | @SuppressWarnings("unchecked")
@Override
public <T> T invoke(Object object, Object... args) throws AuthorizationException, IllegalArgumentException, InvocationException {
if (remotelyAccessible && !isPublic() && !container.isAuthenticated()) {
log.info("Reject not authenticated access to |%s|.", method);
... | java | @SuppressWarnings("unchecked")
@Override
public <T> T invoke(Object object, Object... args) throws AuthorizationException, IllegalArgumentException, InvocationException {
if (remotelyAccessible && !isPublic() && !container.isAuthenticated()) {
log.info("Reject not authenticated access to |%s|.", method);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"invoke",
"(",
"Object",
"object",
",",
"Object",
"...",
"args",
")",
"throws",
"AuthorizationException",
",",
"IllegalArgumentException",
",",
"InvocationException"... | Invoke managed method and applies method level services. Delegates this managed method {@link #invoker}; accordingly
selected strategy invoker can be {@link DefaultInvoker} or {@link InterceptedInvoker}, if this managed method is
annotated with {@link Interceptor}. Also takes care to update {@link #meter}.
@param obje... | [
"Invoke",
"managed",
"method",
"and",
"applies",
"method",
"level",
"services",
".",
"Delegates",
"this",
"managed",
"method",
"{",
"@link",
"#invoker",
"}",
";",
"accordingly",
"selected",
"strategy",
"invoker",
"can",
"be",
"{",
"@link",
"DefaultInvoker",
"}",... | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/ManagedMethod.java#L271-L320 | test | Invoke the specified method on the specified object. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Override
public <T> T invoke(Object object, Object... args) throws AuthorizationException, IllegalArgumentException, InvocationException {
if (remotelyAccessible && !isPublic() && !container.isAuthenticated()) {
log.info... |
rupertlssmith/lojix | lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java | Functor.toStringArguments | protected String toStringArguments()
{
String result = "";
if (arity > 0)
{
result += "[ ";
for (int i = 0; i < arity; i++)
{
Term nextArg = arguments[i];
result += ((nextArg != null) ? nextArg.toString() : "<null>") + ((i... | java | protected String toStringArguments()
{
String result = "";
if (arity > 0)
{
result += "[ ";
for (int i = 0; i < arity; i++)
{
Term nextArg = arguments[i];
result += ((nextArg != null) ? nextArg.toString() : "<null>") + ((i... | [
"protected",
"String",
"toStringArguments",
"(",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"if",
"(",
"arity",
">",
"0",
")",
"{",
"result",
"+=",
"\"[ \"",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arity",
";",
"i",
"++",
")",... | Creates a string representation of this functors arguments, mostly used for debugging purposes.
@return A string reprenestation of this functors arguments. | [
"Creates",
"a",
"string",
"representation",
"of",
"this",
"functors",
"arguments",
"mostly",
"used",
"for",
"debugging",
"purposes",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L470-L488 | test | This method is used to get a string representation of the arguments. | Of course, here is the Java code you requested:
```java
protected String toStringArguments()
{
String result = "";
if (arity > 0)
{
result += "[ ";
for (int i = 0; i < arity; i++)
{
Term nextArg = arguments[i];
result += ... |
oblac/jodd | jodd-db/src/main/java/jodd/db/connection/DriverManagerConnectionProvider.java | DriverManagerConnectionProvider.init | @Override
public synchronized void init() {
try {
Class.forName(driverClass);
} catch (ClassNotFoundException cnfex) {
throw new DbSqlException("JDBC driver not found: " + driverClass, cnfex);
}
} | java | @Override
public synchronized void init() {
try {
Class.forName(driverClass);
} catch (ClassNotFoundException cnfex) {
throw new DbSqlException("JDBC driver not found: " + driverClass, cnfex);
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"init",
"(",
")",
"{",
"try",
"{",
"Class",
".",
"forName",
"(",
"driverClass",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"cnfex",
")",
"{",
"throw",
"new",
"DbSqlException",
"(",
"\"JDBC driver... | ---------------------------------------------------------------- provider | [
"----------------------------------------------------------------",
"provider"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/connection/DriverManagerConnectionProvider.java#L87-L94 | test | Initialize the connection. | Of course, here is the Java code you requested:
```java
@Override
public synchronized void init() {
try {
Class.forName(driverClass);
} catch (ClassNotFoundException cnfex) {
throw new DbSqlException("JDBC driver not found: " + driverClass, cnfex);
}
}
```
Hope this helps! |
rackerlabs/blueflood | blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/astyanax/ALocatorIO.java | ALocatorIO.getLocators | @Override
public Collection<Locator> getLocators(long shard) throws IOException {
Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME);
try {
RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace()
.prepareQuery(CassandraMod... | java | @Override
public Collection<Locator> getLocators(long shard) throws IOException {
Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME);
try {
RowQuery<Long, Locator> query = AstyanaxIO.getKeyspace()
.prepareQuery(CassandraMod... | [
"@",
"Override",
"public",
"Collection",
"<",
"Locator",
">",
"getLocators",
"(",
"long",
"shard",
")",
"throws",
"IOException",
"{",
"Timer",
".",
"Context",
"ctx",
"=",
"Instrumentation",
".",
"getReadTimerContext",
"(",
"CassandraModel",
".",
"CF_METRICS_LOCATO... | Returns the locators for a shard, i.e. those that should be rolled up, for a given shard.
'Should' means:
1) A locator is capable of rollup.
2) A locator has had new data in the past LOCATOR_TTL seconds.
@param shard Number of the shard you want the locators for. 0-127 inclusive.
@return Collection of locators
@throws... | [
"Returns",
"the",
"locators",
"for",
"a",
"shard",
"i",
".",
"e",
".",
"those",
"that",
"should",
"be",
"rolled",
"up",
"for",
"a",
"given",
"shard",
".",
"Should",
"means",
":",
"1",
")",
"A",
"locator",
"is",
"capable",
"of",
"rollup",
".",
"2",
... | 4722a3449b1a7f8e88889ea8c340c6f24396b5b0 | https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/astyanax/ALocatorIO.java#L71-L91 | test | Get all locators for a given shard. | Of course, here is the Java code you requested:
```java
@Override
public Collection<Locator> getLocators(long shard) throws IOException {
Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME);
try {
RowQuery<Long, Locator> query = AstyanaxIO.get... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/customio/HumbleIO.java | HumbleIO.mapIO | public IURLProtocolHandler mapIO(String url, IURLProtocolHandler handler,
boolean unmapUrlOnOpen)
{
{
if (url == null || url.length() <= 0)
throw new IllegalArgumentException("must pass in non-zero url");
if (handler == null)
{
throw new IllegalArgumentException("must pass ... | java | public IURLProtocolHandler mapIO(String url, IURLProtocolHandler handler,
boolean unmapUrlOnOpen)
{
{
if (url == null || url.length() <= 0)
throw new IllegalArgumentException("must pass in non-zero url");
if (handler == null)
{
throw new IllegalArgumentException("must pass ... | [
"public",
"IURLProtocolHandler",
"mapIO",
"(",
"String",
"url",
",",
"IURLProtocolHandler",
"handler",
",",
"boolean",
"unmapUrlOnOpen",
")",
"{",
"{",
"if",
"(",
"url",
"==",
"null",
"||",
"url",
".",
"length",
"(",
")",
"<=",
"0",
")",
"throw",
"new",
... | Maps the given url or file name to the given {@link IURLProtocolHandler} or
so that Humble calls to open the URL it will call back to the handler.
<p>
If you set unmapOnOpen to false, or you never actually open this mapping,
then you must ensure that you call {@link #unmapIO(String)} at some point
in time to remove t... | [
"Maps",
"the",
"given",
"url",
"or",
"file",
"name",
"to",
"the",
"given",
"{",
"@link",
"IURLProtocolHandler",
"}",
"or",
"so",
"that",
"Humble",
"calls",
"to",
"open",
"the",
"URL",
"it",
"will",
"call",
"back",
"to",
"the",
"handler",
"."
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/customio/HumbleIO.java#L579-L595 | test | Map a URL to a handler. | Of course, here is the Java code you requested:
```java
public IURLProtocolHandler mapIO(String url, IURLProtocolHandler handler,
boolean unmapUrlOnOpen)
{
{
if (url == null || url.length() <= 0)
throw new IllegalArgumentException("must pass in non-zero url");
if (handler == null)
... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/mcidas/McIDASLookup.java | McIDASLookup.getParameter | public final GridParameter getParameter(GridRecord gr) {
McIDASGridRecord mgr = (McIDASGridRecord) gr;
String name = mgr.getParameterName();
String desc = mgr.getGridDescription();
if (desc.trim().equals("")) {
desc = name;
}
String unit = visad.jmet.MetUnits.makeSymbol(mgr.getParamUnitNam... | java | public final GridParameter getParameter(GridRecord gr) {
McIDASGridRecord mgr = (McIDASGridRecord) gr;
String name = mgr.getParameterName();
String desc = mgr.getGridDescription();
if (desc.trim().equals("")) {
desc = name;
}
String unit = visad.jmet.MetUnits.makeSymbol(mgr.getParamUnitNam... | [
"public",
"final",
"GridParameter",
"getParameter",
"(",
"GridRecord",
"gr",
")",
"{",
"McIDASGridRecord",
"mgr",
"=",
"(",
"McIDASGridRecord",
")",
"gr",
";",
"String",
"name",
"=",
"mgr",
".",
"getParameterName",
"(",
")",
";",
"String",
"desc",
"=",
"mgr"... | gets parameter table, then grib1 parameter based on number.
@param gr GridRecord
@return Parameter | [
"gets",
"parameter",
"table",
"then",
"grib1",
"parameter",
"based",
"on",
"number",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/mcidas/McIDASLookup.java#L52-L61 | test | Get the parameter from a McIDAS grid record. | Of course, here is the Java code you requested:
```java
public final GridParameter getParameter(GridRecord gr) {
McIDASGridRecord mgr = (McIDASGridRecord) gr;
String name = mgr.getParameterName();
String desc = mgr.getGridDescription();
if (desc.trim().equals("")) {
desc = name;
}
String ... |
playframework/playframework | core/play/src/main/java/play/inject/BindingKey.java | BindingKey.to | public Binding<T> to(final BindingKey<? extends T> key) {
return underlying.to(key.asScala()).asJava();
} | java | public Binding<T> to(final BindingKey<? extends T> key) {
return underlying.to(key.asScala()).asJava();
} | [
"public",
"Binding",
"<",
"T",
">",
"to",
"(",
"final",
"BindingKey",
"<",
"?",
"extends",
"T",
">",
"key",
")",
"{",
"return",
"underlying",
".",
"to",
"(",
"key",
".",
"asScala",
"(",
")",
")",
".",
"asJava",
"(",
")",
";",
"}"
] | Bind this binding key to another binding key. | [
"Bind",
"this",
"binding",
"key",
"to",
"another",
"binding",
"key",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/inject/BindingKey.java#L145-L147 | test | Returns a binding that is equivalent to this one. | Of course, here is the Java code you requested:
```java
public Binding<T> to(final BindingKey<? extends T> key) {
return underlying.to(key.asScala()).asJava();
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/ParserUtility.java | ParserUtility.findPairBracketPosition | private static int findPairBracketPosition(final String str, final int startPos) {
int bracketNum = 0;
for (int i = startPos; i < str.length(); i++)
{
char current = str.charAt(i);
if (current == TieConstants.EL_START_BRACKET)
{
bracketNum++;
... | java | private static int findPairBracketPosition(final String str, final int startPos) {
int bracketNum = 0;
for (int i = startPos; i < str.length(); i++)
{
char current = str.charAt(i);
if (current == TieConstants.EL_START_BRACKET)
{
bracketNum++;
... | [
"private",
"static",
"int",
"findPairBracketPosition",
"(",
"final",
"String",
"str",
",",
"final",
"int",
"startPos",
")",
"{",
"int",
"bracketNum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"startPos",
";",
"i",
"<",
"str",
".",
"length",
"(",
")",... | Find pair bracket position.
@param str the str
@param startPos the start pos
@return the int | [
"Find",
"pair",
"bracket",
"position",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ParserUtility.java#L240-L259 | test | Find the position of the pair bracket in the string. | Of course, here is the Java code you requested:
```java
private static int findPairBracketPosition(final String str, final int startPos) {
int bracketNum = 0;
for (int i = startPos; i < str.length(); i++)
{
char current = str.charAt(i);
if (current == TieConstants.EL_START_B... |
tradier/dropwizard-raven | src/main/java/com/tradier/raven/logging/RavenBootstrap.java | RavenBootstrap.bootstrap | public static void bootstrap(final String dsn, Optional<String> tags,
Optional<String> environment, Optional<String> release, boolean cleanRootLogger) {
bootstrap(dsn, tags, environment, release, Optional.empty(), cleanRootLogger);
} | java | public static void bootstrap(final String dsn, Optional<String> tags,
Optional<String> environment, Optional<String> release, boolean cleanRootLogger) {
bootstrap(dsn, tags, environment, release, Optional.empty(), cleanRootLogger);
} | [
"public",
"static",
"void",
"bootstrap",
"(",
"final",
"String",
"dsn",
",",
"Optional",
"<",
"String",
">",
"tags",
",",
"Optional",
"<",
"String",
">",
"environment",
",",
"Optional",
"<",
"String",
">",
"release",
",",
"boolean",
"cleanRootLogger",
")",
... | Bootstrap the SLF4J root logger with a configured
{@link com.getsentry.raven.logback.SentryAppender}.
@param dsn The DSN (Data Source Name) for your project
@param tags Custom tags to send to Sentry along with errors
@param environment The environment name to pass to Sentry
@param release The release name to pass to S... | [
"Bootstrap",
"the",
"SLF4J",
"root",
"logger",
"with",
"a",
"configured",
"{",
"@link",
"com",
".",
"getsentry",
".",
"raven",
".",
"logback",
".",
"SentryAppender",
"}",
"."
] | 117c78b4879ba930d0187ae2874773646213d3d2 | https://github.com/tradier/dropwizard-raven/blob/117c78b4879ba930d0187ae2874773646213d3d2/src/main/java/com/tradier/raven/logging/RavenBootstrap.java#L65-L68 | test | Bootstrap a CDN. | Of course, here is the Java code you requested:
```java
public static void bootstrap(final String dsn, Optional<String> tags,
Optional<String> environment, Optional<String> release, boolean cleanRootLogger) {
bootstrap(dsn, tags, environment, release, Optional.empty(), cleanRootLogger);
}
```
Hope this he... |
Unidata/thredds | cdm/src/main/java/ucar/ma2/ArrayChar.java | ArrayChar.makeFromStringArray | public static ArrayChar makeFromStringArray(ArrayObject values, int strlen) {
// create shape for equivilent charArray
try {
Section section = new Section(values.getShape());
section.appendRange(strlen);
int[] shape = section.getShape();
long size = section.computeSize();
... | java | public static ArrayChar makeFromStringArray(ArrayObject values, int strlen) {
// create shape for equivilent charArray
try {
Section section = new Section(values.getShape());
section.appendRange(strlen);
int[] shape = section.getShape();
long size = section.computeSize();
... | [
"public",
"static",
"ArrayChar",
"makeFromStringArray",
"(",
"ArrayObject",
"values",
",",
"int",
"strlen",
")",
"{",
"// create shape for equivilent charArray\r",
"try",
"{",
"Section",
"section",
"=",
"new",
"Section",
"(",
"values",
".",
"getShape",
"(",
")",
"... | Create an ArrayChar from an ArrayObject of Strings.
Inverse of make1DStringArray. Copies the data.
@param values ArrayObject of String
@param strlen string length dimension size
@return equivilent ArrayChar. Unused are zero filled. | [
"Create",
"an",
"ArrayChar",
"from",
"an",
"ArrayObject",
"of",
"Strings",
".",
"Inverse",
"of",
"make1DStringArray",
".",
"Copies",
"the",
"data",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/ArrayChar.java#L878-L906 | test | Make a String array of char values from a String array of length strlen. | Of course, here is the Java code you requested:
```java
public static ArrayChar makeFromStringArray(ArrayObject values, int strlen) {
// create shape for equivilent charArray
try {
Section section = new Section(values.getShape());
section.appendRange(strlen);
int[] shape = section.ge... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.doOnDispose | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> doOnDispose(Action onDispose) {
return doOnLifecycle(Functions.emptyConsumer(), onDispose);
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> doOnDispose(Action onDispose) {
return doOnLifecycle(Functions.emptyConsumer(), onDispose);
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"doOnDispose",
"(",
"Action",
"onDispose",
")",
"{",
"return",
"doOnLifecycle",
"(",
"Functions",
".",
"emptyConsumer",
"... | Calls the dispose {@code Action} if the downstream disposes the sequence.
<p>
The action is shared between subscriptions and thus may be called concurrently from multiple
threads; the action must be thread safe.
<p>
If the action throws a runtime exception, that exception is rethrown by the {@code dispose()} call,
some... | [
"Calls",
"the",
"dispose",
"{",
"@code",
"Action",
"}",
"if",
"the",
"downstream",
"disposes",
"the",
"sequence",
".",
"<p",
">",
"The",
"action",
"is",
"shared",
"between",
"subscriptions",
"and",
"thus",
"may",
"be",
"called",
"concurrently",
"from",
"mult... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L8093-L8097 | test | Disposes the application. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> doOnDispose(Action onDispose) {
return doOnLifecycle(Functions.emptyConsumer(), onDispose);
}
```
Hope this helps! |
GojaFramework/goja | goja-core/src/main/java/goja/core/kits/lang/CharKit.java | CharKit.toSimpleByteArray | public static byte[] toSimpleByteArray(char[] carr) {
byte[] barr = new byte[carr.length];
for (int i = 0; i < carr.length; i++) {
barr[i] = (byte) carr[i];
}
return barr;
} | java | public static byte[] toSimpleByteArray(char[] carr) {
byte[] barr = new byte[carr.length];
for (int i = 0; i < carr.length; i++) {
barr[i] = (byte) carr[i];
}
return barr;
} | [
"public",
"static",
"byte",
"[",
"]",
"toSimpleByteArray",
"(",
"char",
"[",
"]",
"carr",
")",
"{",
"byte",
"[",
"]",
"barr",
"=",
"new",
"byte",
"[",
"carr",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"carr",
"."... | Converts char array into byte array by stripping the high byte of each character. | [
"Converts",
"char",
"array",
"into",
"byte",
"array",
"by",
"stripping",
"the",
"high",
"byte",
"of",
"each",
"character",
"."
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/lang/CharKit.java#L38-L44 | test | To simple byte array. | Of course, here is the Java code you requested:
```java
public static byte[] toSimpleByteArray(char[] carr) {
byte[] barr = new byte[carr.length];
for (int i = 0; i < carr.length; i++) {
barr[i] = (byte) carr[i];
}
return barr;
}
```
Hope this helps! |
firepick1/firerest-client | src/main/java/org/firepick/IPv4Scanner.java | IPv4Scanner.subnetAddress0 | public static InetAddress subnetAddress0(InetAddress addr, int subnetBits) {
if (subnetBits < 1 || 32 <= subnetBits) {
throw new FireRESTException("Expected subnetBits 1..31");
}
long mask = 1;
for (int i = 0; i < 32; i++) {
mask <<= 1;
mask |= i < subnetBits ? 1 : 0;
}
long ho... | java | public static InetAddress subnetAddress0(InetAddress addr, int subnetBits) {
if (subnetBits < 1 || 32 <= subnetBits) {
throw new FireRESTException("Expected subnetBits 1..31");
}
long mask = 1;
for (int i = 0; i < 32; i++) {
mask <<= 1;
mask |= i < subnetBits ? 1 : 0;
}
long ho... | [
"public",
"static",
"InetAddress",
"subnetAddress0",
"(",
"InetAddress",
"addr",
",",
"int",
"subnetBits",
")",
"{",
"if",
"(",
"subnetBits",
"<",
"1",
"||",
"32",
"<=",
"subnetBits",
")",
"{",
"throw",
"new",
"FireRESTException",
"(",
"\"Expected subnetBits 1..... | Return first address on subnet containing given address
@param addr any machine in subnet
@param subnetBits the number of bits in subnet mask. Many small networks use 24.
@return first address on subnet. E.g., subnetAddress(10.0.1.88, 25) -> 10.0.1.0 | [
"Return",
"first",
"address",
"on",
"subnet",
"containing",
"given",
"address"
] | f43c85ca093b1f9f62f0375f905adae9351de1e6 | https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/IPv4Scanner.java#L148-L163 | test | Get the subnet address 0 of the given address. | Of course, here is the Java code you requested:
```java
public static InetAddress subnetAddress0(InetAddress addr, int subnetBits) {
if (subnetBits < 1 || 32 <= subnetBits) {
throw new FireRESTException("Expected subnetBits 1..31");
}
long mask = 1;
for (int i = 0; i < 32; i++) {
mask <<= 1... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/sigmet/SigmetIOServiceProvider.java | SigmetIOServiceProvider.open | public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask) throws java.io.IOException {
super.open(raf, ncfile, cancelTask);
//java.util.Map<String, Number> recHdr=new java.util.HashMap<String, Number>();
java.util.Map<Strin... | java | public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask) throws java.io.IOException {
super.open(raf, ncfile, cancelTask);
//java.util.Map<String, Number> recHdr=new java.util.HashMap<String, Number>();
java.util.Map<Strin... | [
"public",
"void",
"open",
"(",
"ucar",
".",
"unidata",
".",
"io",
".",
"RandomAccessFile",
"raf",
",",
"ucar",
".",
"nc2",
".",
"NetcdfFile",
"ncfile",
",",
"ucar",
".",
"nc2",
".",
"util",
".",
"CancelTask",
"cancelTask",
")",
"throws",
"java",
".",
"... | Open existing file, and populate ncfile with it. | [
"Open",
"existing",
"file",
"and",
"populate",
"ncfile",
"with",
"it",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/sigmet/SigmetIOServiceProvider.java#L146-L157 | test | This method is called by the user to open the file and create the appropriate data structures. | Of course, here is the Java code you requested:
```java
public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask) throws java.io.IOException {
super.open(raf, ncfile, cancelTask);
//java.util.Map<String, Number> recHdr=new java... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Index.java | Index.getObjectsAsync | public Request getObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable CompletionHandler completionHandler) {
return getObjectsAsync(objectIDs, /* attributesToRetrieve: */ null, /* requestOptions: */ null, completionHandler);
} | java | public Request getObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable CompletionHandler completionHandler) {
return getObjectsAsync(objectIDs, /* attributesToRetrieve: */ null, /* requestOptions: */ null, completionHandler);
} | [
"public",
"Request",
"getObjectsAsync",
"(",
"final",
"@",
"NonNull",
"Collection",
"<",
"String",
">",
"objectIDs",
",",
"@",
"Nullable",
"CompletionHandler",
"completionHandler",
")",
"{",
"return",
"getObjectsAsync",
"(",
"objectIDs",
",",
"/* attributesToRetrieve:... | Gets several objects from this index (asynchronously).
@param objectIDs Identifiers of objects to retrieve.
@param completionHandler The listener that will be notified of the request's outcome.
@return A cancellable request. | [
"Gets",
"several",
"objects",
"from",
"this",
"index",
"(",
"asynchronously",
")",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L609-L611 | test | Asynchronously gets a list of objects from the server. | Of course, here is the Java code you requested:
```java
public Request getObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable CompletionHandler completionHandler) {
return getObjectsAsync(objectIDs, /* attributesToRetrieve: */ null, /* requestOptions: */ null, completionHandler);
}
```
Hop... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/ConfigurationUtility.java | ConfigurationUtility.findChildRowsMappingFromShiftMap | public static List<RowsMapping> findChildRowsMappingFromShiftMap(
final String fullName,
final NavigableMap<String, ConfigRangeAttrs> shiftMap) {
List<RowsMapping> rowsMappingList = new ArrayList<>();
NavigableMap<String, ConfigRangeAttrs> tailmap = shiftMap
.tailMap(fullName, false);
for (Map.E... | java | public static List<RowsMapping> findChildRowsMappingFromShiftMap(
final String fullName,
final NavigableMap<String, ConfigRangeAttrs> shiftMap) {
List<RowsMapping> rowsMappingList = new ArrayList<>();
NavigableMap<String, ConfigRangeAttrs> tailmap = shiftMap
.tailMap(fullName, false);
for (Map.E... | [
"public",
"static",
"List",
"<",
"RowsMapping",
">",
"findChildRowsMappingFromShiftMap",
"(",
"final",
"String",
"fullName",
",",
"final",
"NavigableMap",
"<",
"String",
",",
"ConfigRangeAttrs",
">",
"shiftMap",
")",
"{",
"List",
"<",
"RowsMapping",
">",
"rowsMapp... | Find child rows mapping from shift map.
@param fullName
the full name
@param shiftMap
the shift map
@return the list | [
"Find",
"child",
"rows",
"mapping",
"from",
"shift",
"map",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ConfigurationUtility.java#L473-L491 | test | Find child rows mapping from shift map. | Of course, here is the Java code you requested:
```java
public static List<RowsMapping> findChildRowsMappingFromShiftMap(
final String fullName,
final NavigableMap<String, ConfigRangeAttrs> shiftMap) {
List<RowsMapping> rowsMappingList = new ArrayList<>();
NavigableMap<String, ConfigRangeAttrs> tailmap... |
Unidata/thredds | tds/src/main/java/thredds/server/radarServer2/RadarServerController.java | RadarServerController.idvDatasetCatalog | private String idvDatasetCatalog(String xml)
{
String ret = xml.replace("variables", "Variables");
ret = ret.replace("timeCoverage", "TimeSpan");
StringBuilder sub = new StringBuilder(ret.substring(0,
ret.indexOf("<geospatialCoverage>")));
sub.append("<LatLonBox>\n\t<... | java | private String idvDatasetCatalog(String xml)
{
String ret = xml.replace("variables", "Variables");
ret = ret.replace("timeCoverage", "TimeSpan");
StringBuilder sub = new StringBuilder(ret.substring(0,
ret.indexOf("<geospatialCoverage>")));
sub.append("<LatLonBox>\n\t<... | [
"private",
"String",
"idvDatasetCatalog",
"(",
"String",
"xml",
")",
"{",
"String",
"ret",
"=",
"xml",
".",
"replace",
"(",
"\"variables\"",
",",
"\"Variables\"",
")",
";",
"ret",
"=",
"ret",
".",
"replace",
"(",
"\"timeCoverage\"",
",",
"\"TimeSpan\"",
")",... | This code tweaks our catalog output to match. | [
"This",
"code",
"tweaks",
"our",
"catalog",
"output",
"to",
"match",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/radarServer2/RadarServerController.java#L206-L217 | test | IDVDatasetCatalog method. | Of course, here is the Java code you requested:
```java
private String idvDatasetCatalog(String xml)
{
String ret = xml.replace("variables", "Variables");
ret = ret.replace("timeCoverage", "TimeSpan");
StringBuilder sub = new StringBuilder(ret.substring(0,
ret.indexOf("<geos... |
vdmeer/execs | src/main/java/de/vandermeer/execs/ExecS.java | ExecS.executeApplication | protected int executeApplication(Object svc, String[] args, String orig){
if(svc!=null && (svc instanceof ExecS_Application)){
if(svc instanceof Gen_RunScripts){
//hook for GenRunScripts to get current class map - registered applications
((Gen_RunScripts)svc).setClassMap(this.classmap);
}
if(svc inst... | java | protected int executeApplication(Object svc, String[] args, String orig){
if(svc!=null && (svc instanceof ExecS_Application)){
if(svc instanceof Gen_RunScripts){
//hook for GenRunScripts to get current class map - registered applications
((Gen_RunScripts)svc).setClassMap(this.classmap);
}
if(svc inst... | [
"protected",
"int",
"executeApplication",
"(",
"Object",
"svc",
",",
"String",
"[",
"]",
"args",
",",
"String",
"orig",
")",
"{",
"if",
"(",
"svc",
"!=",
"null",
"&&",
"(",
"svc",
"instanceof",
"ExecS_Application",
")",
")",
"{",
"if",
"(",
"svc",
"ins... | Executes an application.
@param svc the application, must not be null
@param args original command line arguments
@param orig the original name or class for the application for error messages
@return 0 on success, other than zero on failure (including failure of the executed application) | [
"Executes",
"an",
"application",
"."
] | ac73170bfd449de1f460248d56ece57ff3b0c761 | https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L219-L243 | test | Execute an application. | Of course, here is the Java code you requested:
```java
protected int executeApplication(Object svc, String[] args, String orig){
if(svc!=null && (svc instanceof ExecS_Application)){
if(svc instanceof Gen_RunScripts){
//hook for GenRunScripts to get current class map - registered applications
((Gen_RunScr... |
RestComm/jain-slee | container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitRepositoryImpl.java | DeployableUnitRepositoryImpl.getComponentByID | public ProfileSpecificationComponent getComponentByID(
ProfileSpecificationID id) {
// get from repository
ProfileSpecificationComponent component = componentRepository.getComponentByID(id);
if (component == null) {
// not found in repository, get it from deployable unit
component = deployableUnit.getPro... | java | public ProfileSpecificationComponent getComponentByID(
ProfileSpecificationID id) {
// get from repository
ProfileSpecificationComponent component = componentRepository.getComponentByID(id);
if (component == null) {
// not found in repository, get it from deployable unit
component = deployableUnit.getPro... | [
"public",
"ProfileSpecificationComponent",
"getComponentByID",
"(",
"ProfileSpecificationID",
"id",
")",
"{",
"// get from repository",
"ProfileSpecificationComponent",
"component",
"=",
"componentRepository",
".",
"getComponentByID",
"(",
"id",
")",
";",
"if",
"(",
"compon... | /*
(non-Javadoc)
@see org.mobicents.slee.core.component.ComponentRepository#getComponentByID(javax.slee.profile.ProfileSpecificationID) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitRepositoryImpl.java#L88-L97 | test | Get the profile specification component by ID. | Of course, here is the Java code you requested:
```java
public ProfileSpecificationComponent getComponentByID(
ProfileSpecificationID id) {
// get from repository
ProfileSpecificationComponent component = componentRepository.getComponentByID(id);
if (component == null) {
// not found in repository, get it ... |
basis-technology-corp/tcl-regex-java | src/main/java/com/basistech/tclre/CnfaBuilder.java | CnfaBuilder.carcsort | void carcsort(int first, int last) {
int p;
int q;
long tmp;
if (last - first <= 1) {
return;
}
for (p = first; p <= last; p++) {
for (q = p; q <= last; q++) {
short pco = Cnfa.carcColor(arcs[p]);
short qco = Cnfa.... | java | void carcsort(int first, int last) {
int p;
int q;
long tmp;
if (last - first <= 1) {
return;
}
for (p = first; p <= last; p++) {
for (q = p; q <= last; q++) {
short pco = Cnfa.carcColor(arcs[p]);
short qco = Cnfa.... | [
"void",
"carcsort",
"(",
"int",
"first",
",",
"int",
"last",
")",
"{",
"int",
"p",
";",
"int",
"q",
";",
"long",
"tmp",
";",
"if",
"(",
"last",
"-",
"first",
"<=",
"1",
")",
"{",
"return",
";",
"}",
"for",
"(",
"p",
"=",
"first",
";",
"p",
... | carcsort - sort compacted-NFA arcs by color
Really dumb algorithm, but if the list is long enough for that to matter,
you're in real trouble anyway. | [
"carcsort",
"-",
"sort",
"compacted",
"-",
"NFA",
"arcs",
"by",
"color",
"Really",
"dumb",
"algorithm",
"but",
"if",
"the",
"list",
"is",
"long",
"enough",
"for",
"that",
"to",
"matter",
"you",
"re",
"in",
"real",
"trouble",
"anyway",
"."
] | de0d5eaccf9a61b694cb8793f234cc229c395b43 | https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/CnfaBuilder.java#L76-L99 | test | Carcsort method. | Of course, here is the Java code you requested:
```java
void carcsort(int first, int last) {
int p;
int q;
long tmp;
if (last - first <= 1) {
return;
}
for (p = first; p <= last; p++) {
for (q = p; q <= last; q++) {
short pco = C... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.internalServerError | public static Result internalServerError(String content, String charset) {
return status(INTERNAL_SERVER_ERROR, content, charset);
} | java | public static Result internalServerError(String content, String charset) {
return status(INTERNAL_SERVER_ERROR, content, charset);
} | [
"public",
"static",
"Result",
"internalServerError",
"(",
"String",
"content",
",",
"String",
"charset",
")",
"{",
"return",
"status",
"(",
"INTERNAL_SERVER_ERROR",
",",
"content",
",",
"charset",
")",
";",
"}"
] | Generates a 500 Internal Server Error result.
@param content the HTTP response body
@param charset the charset into which the content should be encoded (e.g. "UTF-8")
@return the result | [
"Generates",
"a",
"500",
"Internal",
"Server",
"Error",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L3929-L3931 | test | HTTP 500 error | Of course, here is the Java code you requested:
```java
public static Result internalServerError(String content, String charset) {
return status(INTERNAL_SERVER_ERROR, content, charset);
}
```
Hope this helps! |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java | GlobalMethodSecurityConfiguration.methodSecurityMetadataSource | @Bean
public MethodSecurityMetadataSource methodSecurityMetadataSource() {
List<MethodSecurityMetadataSource> sources = new ArrayList<>();
ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
getExpressionHandler());
MethodSecurityMetadataSource customMe... | java | @Bean
public MethodSecurityMetadataSource methodSecurityMetadataSource() {
List<MethodSecurityMetadataSource> sources = new ArrayList<>();
ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
getExpressionHandler());
MethodSecurityMetadataSource customMe... | [
"@",
"Bean",
"public",
"MethodSecurityMetadataSource",
"methodSecurityMetadataSource",
"(",
")",
"{",
"List",
"<",
"MethodSecurityMetadataSource",
">",
"sources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"ExpressionBasedAnnotationAttributeFactory",
"attributeFactory",
... | Provides the default {@link MethodSecurityMetadataSource} that will be used. It
creates a {@link DelegatingMethodSecurityMetadataSource} based upon
{@link #customMethodSecurityMetadataSource()} and the attributes on
{@link EnableGlobalMethodSecurity}.
@return the {@link MethodSecurityMetadataSource} | [
"Provides",
"the",
"default",
"{",
"@link",
"MethodSecurityMetadataSource",
"}",
"that",
"will",
"be",
"used",
".",
"It",
"creates",
"a",
"{",
"@link",
"DelegatingMethodSecurityMetadataSource",
"}",
"based",
"upon",
"{",
"@link",
"#customMethodSecurityMetadataSource",
... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java#L358-L395 | test | Creates a method security metadata source. | Of course, here is the Java code you requested:
```java
@Bean
public MethodSecurityMetadataSource methodSecurityMetadataSource() {
List<MethodSecurityMetadataSource> sources = new ArrayList<>();
ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
getExpr... |
ozlerhakan/poiji | src/main/java/com/poiji/bind/Poiji.java | Poiji.fromExcel | public static synchronized <T> void fromExcel(final File file, final Class<T> type, final PoijiOptions options, final Consumer<? super T> consumer) {
final Unmarshaller unmarshaller = deserializer(file, options);
unmarshaller.unmarshal(type, consumer);
} | java | public static synchronized <T> void fromExcel(final File file, final Class<T> type, final PoijiOptions options, final Consumer<? super T> consumer) {
final Unmarshaller unmarshaller = deserializer(file, options);
unmarshaller.unmarshal(type, consumer);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"void",
"fromExcel",
"(",
"final",
"File",
"file",
",",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"PoijiOptions",
"options",
",",
"final",
"Consumer",
"<",
"?",
"super",
"T",
">",
"consumer"... | converts excel rows into a list of objects
@param file excel file ending with .xls or .xlsx.
@param type type of the root object.
@param <T> type of the root object.
@param options specifies to change the default behaviour of the poiji.
@param consumer represents an operation that accepts the type argument
@throws Poi... | [
"converts",
"excel",
"rows",
"into",
"a",
"list",
"of",
"objects"
] | 3d27d7ae586d8cdac46a5403a030198937c28fe6 | https://github.com/ozlerhakan/poiji/blob/3d27d7ae586d8cdac46a5403a030198937c28fe6/src/main/java/com/poiji/bind/Poiji.java#L166-L169 | test | Unmarshals an Excel document to a Java type. | Of course, here is the Java code you requested:
```java
public static synchronized <T> void fromExcel(final File file, final Class<T> type, final PoijiOptions options, final Consumer<? super T> consumer) {
final Unmarshaller unmarshaller = deserializer(file, options);
unmarshaller.unmarshal(type, consu... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.concatMapEager | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Observable<R> concatMapEager(Function<? super T, ? extends ObservableSource<? extends R>> mapper,
int maxConcurrency, int prefetch) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
ObjectHelper.verify... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Observable<R> concatMapEager(Function<? super T, ? extends ObservableSource<? extends R>> mapper,
int maxConcurrency, int prefetch) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
ObjectHelper.verify... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"R",
">",
"Observable",
"<",
"R",
">",
"concatMapEager",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"ObservableSource",
"<... | Maps a sequence of values into ObservableSources and concatenates these ObservableSources eagerly into a single
ObservableSource.
<p>
Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
source ObservableSources. The operator buffers the values emitted by these ObservableS... | [
"Maps",
"a",
"sequence",
"of",
"values",
"into",
"ObservableSources",
"and",
"concatenates",
"these",
"ObservableSources",
"eagerly",
"into",
"a",
"single",
"ObservableSource",
".",
"<p",
">",
"Eager",
"concatenation",
"means",
"that",
"once",
"a",
"subscriber",
"... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L6588-L6596 | test | Concatenates the source observable with the specified mapping function and returns an observable that contains the results of applying the specified mapping function to each element of the source observable. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Observable<R> concatMapEager(Function<? super T, ? extends ObservableSource<? extends R>> mapper,
int maxConcurrency, int prefetch) {
ObjectHelper.requireNonNu... |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/ImportJsonFunction.java | ImportJsonFunction.importRegion | private boolean importRegion(Region<Object, Object> region)
throws Exception
{
JsonNode node, keyNode, valueNode, keyClassName, valueClassName;
Object key, value;
if (PartitionRegionHelper.isPartitionedRegion(region))
{
region = PartitionRegionHelper.getLocalData(region);
}
// get firs... | java | private boolean importRegion(Region<Object, Object> region)
throws Exception
{
JsonNode node, keyNode, valueNode, keyClassName, valueClassName;
Object key, value;
if (PartitionRegionHelper.isPartitionedRegion(region))
{
region = PartitionRegionHelper.getLocalData(region);
}
// get firs... | [
"private",
"boolean",
"importRegion",
"(",
"Region",
"<",
"Object",
",",
"Object",
">",
"region",
")",
"throws",
"Exception",
"{",
"JsonNode",
"node",
",",
"keyNode",
",",
"valueNode",
",",
"keyClassName",
",",
"valueClassName",
";",
"Object",
"key",
",",
"v... | ------------------------------------------------ | [
"------------------------------------------------"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/ImportJsonFunction.java#L121-L204 | test | Imports the specified region. | Of course, here is the Java code you requested:
```java
private boolean importRegion(Region<Object, Object> region)
throws Exception
{
JsonNode node, keyNode, valueNode, keyClassName, valueClassName;
Object key, value;
if (PartitionRegionHelper.isPartitionedRegion(region))
{
region = Partitio... |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/GfStatsReader.java | GfStatsReader.update | public boolean update(boolean doReset) throws IOException
{
if (this.closed)
{
return false;
}
if (!this.updateOK)
{
throw new RuntimeException("Update of this type of file is not supported");
}
if (doReset)
{
this.dataIn.reset();
}
int updateTokenCount = 0;
while (this.readToken())
... | java | public boolean update(boolean doReset) throws IOException
{
if (this.closed)
{
return false;
}
if (!this.updateOK)
{
throw new RuntimeException("Update of this type of file is not supported");
}
if (doReset)
{
this.dataIn.reset();
}
int updateTokenCount = 0;
while (this.readToken())
... | [
"public",
"boolean",
"update",
"(",
"boolean",
"doReset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"closed",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"this",
".",
"updateOK",
")",
"{",
"throw",
"new",
"RuntimeException",
... | Checks to see if the archive has changed since the StatArchiverReader
instance was created or last updated. If the archive has additional
samples then those are read the resource instances maintained by the
reader are updated.
<p>
Once closed a reader can no longer be updated.
@param doReset update flag
@return true i... | [
"Checks",
"to",
"see",
"if",
"the",
"archive",
"has",
"changed",
"since",
"the",
"StatArchiverReader",
"instance",
"was",
"created",
"or",
"last",
"updated",
".",
"If",
"the",
"archive",
"has",
"additional",
"samples",
"then",
"those",
"are",
"read",
"the",
... | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/GfStatsReader.java#L270-L292 | test | Updates the contents of the file. | Of course, here is the Java code you requested:
```java
public boolean update(boolean doReset) throws IOException
{
if (this.closed)
{
return false;
}
if (!this.updateOK)
{
throw new RuntimeException("Update of this type of file is not supported");
}
if (doReset)
{
this.dataIn.reset();
}
... |
google/guice | core/src/com/google/inject/internal/Annotations.java | Annotations.annotationEquals | private static boolean annotationEquals(
Class<? extends Annotation> type, Map<String, Object> members, Object other)
throws Exception {
if (!type.isInstance(other)) {
return false;
}
for (Method method : type.getDeclaredMethods()) {
String name = method.getName();
if (!Arrays.... | java | private static boolean annotationEquals(
Class<? extends Annotation> type, Map<String, Object> members, Object other)
throws Exception {
if (!type.isInstance(other)) {
return false;
}
for (Method method : type.getDeclaredMethods()) {
String name = method.getName();
if (!Arrays.... | [
"private",
"static",
"boolean",
"annotationEquals",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"type",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"members",
",",
"Object",
"other",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"type",
"... | Implements {@link Annotation#equals}. | [
"Implements",
"{"
] | a0552a16d813ead98fe73737fb001db336650251 | https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/Annotations.java#L127-L141 | test | Check if two annotations are equal. | Of course, here is the Java code you requested:
```java
private static boolean annotationEquals(
Class<? extends Annotation> type, Map<String, Object> members, Object other)
throws Exception {
if (!type.isInstance(other)) {
return false;
}
for (Method method : type.getDeclaredMethods()) {... |
abmargb/jamppa | src/main/java/org/jivesoftware/smack/RosterEntry.java | RosterEntry.updateState | void updateState(String name, Subscription type, Ask status) {
this.name = name;
this.subscription = type;
this.ask = status;
} | java | void updateState(String name, Subscription type, Ask status) {
this.name = name;
this.subscription = type;
this.ask = status;
} | [
"void",
"updateState",
"(",
"String",
"name",
",",
"Subscription",
"type",
",",
"Ask",
"status",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"subscription",
"=",
"type",
";",
"this",
".",
"ask",
"=",
"status",
";",
"}"
] | Updates the state of the entry with the new values.
@param name
the nickname for the entry.
@param type
the subscription type.
@param status
the subscription status (related to subscriptions pending to
be approbed). | [
"Updates",
"the",
"state",
"of",
"the",
"entry",
"with",
"the",
"new",
"values",
"."
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/RosterEntry.java#L119-L123 | test | Update the state of the resource. | Of course, here is the Java code you requested:
```java
void updateState(String name, Subscription type, Ask status) {
this.name = name;
this.subscription = type;
this.ask = status;
}
```
Hope this helps! |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/subsystem/EJB3Extension.java | EJB3Extension.initializeParsers | @Override
public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, NAMESPACE_1_0, EJB3Subsystem10Parser::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, NAMESPACE_1_1, EJB3Subsystem11Parser::new);
context.setSubsystemXmlMapping(SUBS... | java | @Override
public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, NAMESPACE_1_0, EJB3Subsystem10Parser::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, NAMESPACE_1_1, EJB3Subsystem11Parser::new);
context.setSubsystemXmlMapping(SUBS... | [
"@",
"Override",
"public",
"void",
"initializeParsers",
"(",
"ExtensionParsingContext",
"context",
")",
"{",
"context",
".",
"setSubsystemXmlMapping",
"(",
"SUBSYSTEM_NAME",
",",
"NAMESPACE_1_0",
",",
"EJB3Subsystem10Parser",
"::",
"new",
")",
";",
"context",
".",
"... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/EJB3Extension.java#L104-L116 | test | Initialize the subsystem XML mappings. | Of course, here is the Java code you requested:
```java
@Override
public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, NAMESPACE_1_0, EJB3Subsystem10Parser::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, NAMESPACE_1_1, EJB3Subsystem11... |
dschulten/hydra-java | spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/SpringActionInputParameter.java | SpringActionInputParameter.isExcluded | @Override
public boolean isExcluded(String property) {
return inputAnnotation != null && arrayContains(inputAnnotation.exclude(), property);
} | java | @Override
public boolean isExcluded(String property) {
return inputAnnotation != null && arrayContains(inputAnnotation.exclude(), property);
} | [
"@",
"Override",
"public",
"boolean",
"isExcluded",
"(",
"String",
"property",
")",
"{",
"return",
"inputAnnotation",
"!=",
"null",
"&&",
"arrayContains",
"(",
"inputAnnotation",
".",
"exclude",
"(",
")",
",",
"property",
")",
";",
"}"
] | Determines if request body input parameter should be excluded, considering {@link Input#exclude}.
@param property name or property path
@return true if excluded, false if no include statement found or not excluded | [
"Determines",
"if",
"request",
"body",
"input",
"parameter",
"should",
"be",
"excluded",
"considering",
"{",
"@link",
"Input#exclude",
"}",
"."
] | 21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a | https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/SpringActionInputParameter.java#L257-L260 | test | Returns true if the property is excluded from the generated code. | Of course, here is the Java code you requested:
```java
@Override
public boolean isExcluded(String property) {
return inputAnnotation != null && arrayContains(inputAnnotation.exclude(), property);
}
```
Hope this helps! |
ieb/sparsemapcontent | core/src/main/java/org/sakaiproject/nakamura/lite/content/ContentManagerImpl.java | ContentManagerImpl.copy | public void copy(String from, String to, boolean withStreams) throws StorageClientException, AccessDeniedException, IOException {
long ts = System.currentTimeMillis();
try {
checkOpen();
// To Copy, get the to object out and copy everything over.
Content f = get(from)... | java | public void copy(String from, String to, boolean withStreams) throws StorageClientException, AccessDeniedException, IOException {
long ts = System.currentTimeMillis();
try {
checkOpen();
// To Copy, get the to object out and copy everything over.
Content f = get(from)... | [
"public",
"void",
"copy",
"(",
"String",
"from",
",",
"String",
"to",
",",
"boolean",
"withStreams",
")",
"throws",
"StorageClientException",
",",
"AccessDeniedException",
",",
"IOException",
"{",
"long",
"ts",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
... | {@inheritDoc}
@see org.sakaiproject.nakamura.api.lite.content.ContentManager#copy(java.lang.String,
java.lang.String, boolean) | [
"{",
"@inheritDoc",
"}"
] | 0570fdf868adbbf7734790cbc09fe66480e5f2dc | https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/core/src/main/java/org/sakaiproject/nakamura/lite/content/ContentManagerImpl.java#L631-L689 | test | Copy content from one object to another. | Of course, here is the Java code you requested:
```java
public void copy(String from, String to, boolean withStreams) throws StorageClientException, AccessDeniedException, IOException {
long ts = System.currentTimeMillis();
try {
checkOpen();
// To Copy, get the to object out an... |
jcodec/jcodec | src/main/java/org/jcodec/codecs/mpeg12/MPEGES.java | MPEGES.frame | public MPEGPacket frame(ByteBuffer buffer) throws IOException {
ByteBuffer dup = buffer.duplicate();
while (curMarker != 0x100 && curMarker != 0x1b3 && skipToMarker())
;
while (curMarker != 0x100 && readToNextMarker(dup))
;
readToNextMarker(dup);
whil... | java | public MPEGPacket frame(ByteBuffer buffer) throws IOException {
ByteBuffer dup = buffer.duplicate();
while (curMarker != 0x100 && curMarker != 0x1b3 && skipToMarker())
;
while (curMarker != 0x100 && readToNextMarker(dup))
;
readToNextMarker(dup);
whil... | [
"public",
"MPEGPacket",
"frame",
"(",
"ByteBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"dup",
"=",
"buffer",
".",
"duplicate",
"(",
")",
";",
"while",
"(",
"curMarker",
"!=",
"0x100",
"&&",
"curMarker",
"!=",
"0x1b3",
"&&",
"skipToMar... | Reads one MPEG1/2 video frame from MPEG1/2 elementary stream into a
provided buffer.
@param buffer
A buffer to use for the data.
@return A packet with a video frame or null at for end of the stream. The
data buffer inside the packet will be a sub-buffer of a 'buffer'
provided as an argument.
@throws IOException | [
"Reads",
"one",
"MPEG1",
"/",
"2",
"video",
"frame",
"from",
"MPEG1",
"/",
"2",
"elementary",
"stream",
"into",
"a",
"provided",
"buffer",
"."
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/mpeg12/MPEGES.java#L42-L63 | test | Read a MPEG frame from the given byte buffer. | Of course, here is the Java code you requested:
```java
public MPEGPacket frame(ByteBuffer buffer) throws IOException {
ByteBuffer dup = buffer.duplicate();
while (curMarker != 0x100 && curMarker != 0x1b3 && skipToMarker())
;
while (curMarker != 0x100 && readToNextMarker(dup))
... |
spring-projects/spring-security | ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java | SpringSecurityLdapTemplate.extractStringAttributeValues | private void extractStringAttributeValues(DirContextAdapter adapter,
Map<String, List<String>> record, String attributeName) {
Object[] values = adapter.getObjectAttributes(attributeName);
if (values == null || values.length == 0) {
if (logger.isDebugEnabled()) {
logger.debug("No attribute value found for... | java | private void extractStringAttributeValues(DirContextAdapter adapter,
Map<String, List<String>> record, String attributeName) {
Object[] values = adapter.getObjectAttributes(attributeName);
if (values == null || values.length == 0) {
if (logger.isDebugEnabled()) {
logger.debug("No attribute value found for... | [
"private",
"void",
"extractStringAttributeValues",
"(",
"DirContextAdapter",
"adapter",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"record",
",",
"String",
"attributeName",
")",
"{",
"Object",
"[",
"]",
"values",
"=",
"adapter",
".",
"g... | Extracts String values for a specified attribute name and places them in the map
representing the ldap record If a value is not of type String, it will derive it's
value from the {@link Object#toString()}
@param adapter - the adapter that contains the values
@param record - the map holding the attribute names and valu... | [
"Extracts",
"String",
"values",
"for",
"a",
"specified",
"attribute",
"name",
"and",
"places",
"them",
"in",
"the",
"map",
"representing",
"the",
"ldap",
"record",
"If",
"a",
"value",
"is",
"not",
"of",
"type",
"String",
"it",
"will",
"derive",
"it",
"s",
... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/ldap/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java#L268-L294 | test | Extract string values from the attribute value map. | Of course, here is the Java code you requested:
```java
private void extractStringAttributeValues(DirContextAdapter adapter,
Map<String, List<String>> record, String attributeName) {
Object[] values = adapter.getObjectAttributes(attributeName);
if (values == null || values.length == 0) {
if (logger.isDebugEn... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.putFunctionForId | public void putFunctionForId(String id, DifferentialFunction function) {
if (functionInstancesById.containsKey(id)) {
throw new ND4JIllegalStateException("Function by id already exists!");
} else if (function instanceof SDVariable) {
throw new ND4JIllegalStateException("Function ... | java | public void putFunctionForId(String id, DifferentialFunction function) {
if (functionInstancesById.containsKey(id)) {
throw new ND4JIllegalStateException("Function by id already exists!");
} else if (function instanceof SDVariable) {
throw new ND4JIllegalStateException("Function ... | [
"public",
"void",
"putFunctionForId",
"(",
"String",
"id",
",",
"DifferentialFunction",
"function",
")",
"{",
"if",
"(",
"functionInstancesById",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"throw",
"new",
"ND4JIllegalStateException",
"(",
"\"Function by id alread... | Put the function for id
@param id the id
@param function the function | [
"Put",
"the",
"function",
"for",
"id"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L452-L460 | test | Put a DifferentialFunction instance for a given id | Of course, here is the Java code you requested:
```java
public void putFunctionForId(String id, DifferentialFunction function) {
if (functionInstancesById.containsKey(id)) {
throw new ND4JIllegalStateException("Function by id already exists!");
} else if (function instanceof SDVariable) {
... |
Axway/iron | iron-core/src/main/java/io/axway/iron/core/spi/file/IronMigration.java | IronMigration.completeStoreSnapshotWithMissingInstanceSnapshots | private static void completeStoreSnapshotWithMissingInstanceSnapshots(Path targetStoresPath) {
String transactionIdRegexAlone = "\"transactionId\"\\s*:\\s*\\d+\\s*,";
String transactionIdRegexReplace = "(.*\"transactionId\"\\s*:\\s*)\\d+(\\s*,.*)";
Pattern transactionIdPattern = compile(transact... | java | private static void completeStoreSnapshotWithMissingInstanceSnapshots(Path targetStoresPath) {
String transactionIdRegexAlone = "\"transactionId\"\\s*:\\s*\\d+\\s*,";
String transactionIdRegexReplace = "(.*\"transactionId\"\\s*:\\s*)\\d+(\\s*,.*)";
Pattern transactionIdPattern = compile(transact... | [
"private",
"static",
"void",
"completeStoreSnapshotWithMissingInstanceSnapshots",
"(",
"Path",
"targetStoresPath",
")",
"{",
"String",
"transactionIdRegexAlone",
"=",
"\"\\\"transactionId\\\"\\\\s*:\\\\s*\\\\d+\\\\s*,\"",
";",
"String",
"transactionIdRegexReplace",
"=",
"\"(.*\\\"t... | Complete snapshot N with lacking instance snapshots from snapshot N - 1
@param targetStoresPath path to store target iron | [
"Complete",
"snapshot",
"N",
"with",
"lacking",
"instance",
"snapshots",
"from",
"snapshot",
"N",
"-",
"1"
] | 387ec6d43d2353f857d510dd29f93a06a8db9069 | https://github.com/Axway/iron/blob/387ec6d43d2353f857d510dd29f93a06a8db9069/iron-core/src/main/java/io/axway/iron/core/spi/file/IronMigration.java#L123-L152 | test | Completes the store snapshot with missing instance snapshots. | Of course, here is the Java code you requested:
```java
private static void completeStoreSnapshotWithMissingInstanceSnapshots(Path targetStoresPath) {
String transactionIdRegexAlone = "\"transactionId\"\\s*:\\s*\\d+\\s*,";
String transactionIdRegexReplace = "(.*\"transactionId\"\\s*:\\s*)\\d+(\\s*,.*)"... |
eiichiro/bootleg | src/main/java/org/eiichiro/bootleg/Pipeline.java | Pipeline.set | public Pipeline<T> set(int index, Function<T, T> function) {
return set(index, function.getClass().getName(), function);
} | java | public Pipeline<T> set(int index, Function<T, T> function) {
return set(index, function.getClass().getName(), function);
} | [
"public",
"Pipeline",
"<",
"T",
">",
"set",
"(",
"int",
"index",
",",
"Function",
"<",
"T",
",",
"T",
">",
"function",
")",
"{",
"return",
"set",
"(",
"index",
",",
"function",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"function",
... | Sets the specified {@code Function} to the next processing stage with the
specified index and the class name of the {@code Function} as the stage
name.
@param index The index the specified {@code Function} to be set.
@param function The {@code Function} set to the next processing stage.
@return This {@code Pipeline} i... | [
"Sets",
"the",
"specified",
"{",
"@code",
"Function",
"}",
"to",
"the",
"next",
"processing",
"stage",
"with",
"the",
"specified",
"index",
"and",
"the",
"class",
"name",
"of",
"the",
"{",
"@code",
"Function",
"}",
"as",
"the",
"stage",
"name",
"."
] | b98a108500597cb6185056be2eef7de5ba1963d2 | https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/Pipeline.java#L101-L103 | test | Set a function to the pipeline at the given index. | Of course, here is the Java code you requested:
```java
public Pipeline<T> set(int index, Function<T, T> function) {
return set(index, function.getClass().getName(), function);
}
```
Hope this helps! |
kocakosm/pitaya | src/org/kocakosm/pitaya/util/Parameters.java | Parameters.checkType | public static <T> T checkType(Object ref, Class<T> type, String msg,
Object... args)
{
if (type.isInstance(ref)) {
return type.cast(ref);
}
throw new ClassCastException(format(msg, args));
} | java | public static <T> T checkType(Object ref, Class<T> type, String msg,
Object... args)
{
if (type.isInstance(ref)) {
return type.cast(ref);
}
throw new ClassCastException(format(msg, args));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkType",
"(",
"Object",
"ref",
",",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"msg",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"type",
".",
"isInstance",
"(",
"ref",
")",
")",
"{",
"return... | Checks the type of the given reference and, in case of success, casts
and returns it.
@param <T> the expected type of the given reference.
@param ref the reference to test.
@param type the expected type of the given reference.
@param msg the error message format string.
@param args the error message arguments.
@retur... | [
"Checks",
"the",
"type",
"of",
"the",
"given",
"reference",
"and",
"in",
"case",
"of",
"success",
"casts",
"and",
"returns",
"it",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/Parameters.java#L135-L142 | test | Check if object is instance of type | Of course, here is the Java code you requested:
```java
public static <T> T checkType(Object ref, Class<T> type, String msg,
Object... args)
{
if (type.isInstance(ref)) {
return type.cast(ref);
}
throw new ClassCastException(format(msg, args));
}
```
Hope this helps! |
sialcasa/mvvmFX | mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/itemlist/SelectableItemList.java | SelectableItemList.createIndexEvents | private void createIndexEvents() {
selectionModel
.selectedIndexProperty()
.addListener((bean, oldVal, newVal) -> {
int index = newVal.intValue();
ListType item = index == -1 ? null : modelListProperty()
.get(index);
... | java | private void createIndexEvents() {
selectionModel
.selectedIndexProperty()
.addListener((bean, oldVal, newVal) -> {
int index = newVal.intValue();
ListType item = index == -1 ? null : modelListProperty()
.get(index);
... | [
"private",
"void",
"createIndexEvents",
"(",
")",
"{",
"selectionModel",
".",
"selectedIndexProperty",
"(",
")",
".",
"addListener",
"(",
"(",
"bean",
",",
"oldVal",
",",
"newVal",
")",
"->",
"{",
"int",
"index",
"=",
"newVal",
".",
"intValue",
"(",
")",
... | When the selected item changed we want to set the index property too | [
"When",
"the",
"selected",
"item",
"changed",
"we",
"want",
"to",
"set",
"the",
"index",
"property",
"too"
] | 240566a358a8e01c94c0bbb99228140a69690d02 | https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/itemlist/SelectableItemList.java#L88-L117 | test | Add events to the index of the items. | Of course, here is the Java code you requested:
```java
private void createIndexEvents() {
selectionModel
.selectedIndexProperty()
.addListener((bean, oldVal, newVal) -> {
int index = newVal.intValue();
ListType item = index == -1 ? null : modelListProperty... |
Unidata/thredds | tds/src/main/java/thredds/core/ConfigCatalogHtmlWriter.java | ConfigCatalogHtmlWriter.writeCatalog | public int writeCatalog(HttpServletRequest req, HttpServletResponse res, Catalog cat, boolean isLocalCatalog) throws IOException {
String catHtmlAsString = convertCatalogToHtml(cat, isLocalCatalog);
// Once this header is set, we know the encoding, and thus the actual
// number of *bytes*, not characters, ... | java | public int writeCatalog(HttpServletRequest req, HttpServletResponse res, Catalog cat, boolean isLocalCatalog) throws IOException {
String catHtmlAsString = convertCatalogToHtml(cat, isLocalCatalog);
// Once this header is set, we know the encoding, and thus the actual
// number of *bytes*, not characters, ... | [
"public",
"int",
"writeCatalog",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"Catalog",
"cat",
",",
"boolean",
"isLocalCatalog",
")",
"throws",
"IOException",
"{",
"String",
"catHtmlAsString",
"=",
"convertCatalogToHtml",
"(",
"cat",
",... | Write an Catalog to the HttpServletResponse, return the size in bytes of the catalog written to the response.
@param req the HttpServletRequest
@param res the HttpServletResponse.
@param cat the InvCatalogImpl to write to the HttpServletResponse.
@param isLocalCatalog indicates whether... | [
"Write",
"an",
"Catalog",
"to",
"the",
"HttpServletResponse",
"return",
"the",
"size",
"in",
"bytes",
"of",
"the",
"catalog",
"written",
"to",
"the",
"response",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/core/ConfigCatalogHtmlWriter.java#L76-L91 | test | Write a catalog to the HttpServletResponse | Of course, here is the Java code you requested:
```java
public int writeCatalog(HttpServletRequest req, HttpServletResponse res, Catalog cat, boolean isLocalCatalog) throws IOException {
String catHtmlAsString = convertCatalogToHtml(cat, isLocalCatalog);
// Once this header is set, we know the encoding, and t... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java | FeatureIndexManager.deleteIndex | public boolean deleteIndex(Collection<FeatureIndexType> types) {
boolean deleted = false;
for (FeatureIndexType type : types) {
if (deleteIndex(type)) {
deleted = true;
}
}
return deleted;
} | java | public boolean deleteIndex(Collection<FeatureIndexType> types) {
boolean deleted = false;
for (FeatureIndexType type : types) {
if (deleteIndex(type)) {
deleted = true;
}
}
return deleted;
} | [
"public",
"boolean",
"deleteIndex",
"(",
"Collection",
"<",
"FeatureIndexType",
">",
"types",
")",
"{",
"boolean",
"deleted",
"=",
"false",
";",
"for",
"(",
"FeatureIndexType",
"type",
":",
"types",
")",
"{",
"if",
"(",
"deleteIndex",
"(",
"type",
")",
")"... | Delete the feature index from the index types
@param types feature index types
@return true if deleted from any type
@since 2.0.0 | [
"Delete",
"the",
"feature",
"index",
"from",
"the",
"index",
"types"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java#L446-L454 | test | Delete the feature index from the feature index. | Of course, here is the Java code you requested:
```java
public boolean deleteIndex(Collection<FeatureIndexType> types) {
boolean deleted = false;
for (FeatureIndexType type : types) {
if (deleteIndex(type)) {
deleted = true;
}
}
return deleted;
... |
boonproject/boon | boon/src/main/java/org/boon/messages/MessageUtils.java | MessageUtils.getLabel | public static String getLabel( final String fieldName,
final ResourceBundle bundle ) {
String label;
/** Look for fieldName, e.g., firstName. */
try {
label = bundle.getString( fieldName );
} catch ( MissingResourceException mre ) {
... | java | public static String getLabel( final String fieldName,
final ResourceBundle bundle ) {
String label;
/** Look for fieldName, e.g., firstName. */
try {
label = bundle.getString( fieldName );
} catch ( MissingResourceException mre ) {
... | [
"public",
"static",
"String",
"getLabel",
"(",
"final",
"String",
"fieldName",
",",
"final",
"ResourceBundle",
"bundle",
")",
"{",
"String",
"label",
";",
"/** Look for fieldName, e.g., firstName. */",
"try",
"{",
"label",
"=",
"bundle",
".",
"getString",
"(",
"fi... | Get the field label.
@param fieldName fieldName
@param bundle ResourceBundle
@return Label from the Message Source. | [
"Get",
"the",
"field",
"label",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/messages/MessageUtils.java#L64-L77 | test | Gets the label of a single field. | Of course, here is the Java code you requested:
```java
public static String getLabel( final String fieldName,
final ResourceBundle bundle ) {
String label;
/** Look for fieldName, e.g., firstName. */
try {
label = bundle.getString( fieldName );
... |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/config/ObjectMapperConfig.java | ObjectMapperConfig.jackson1ObjectMapperFactory | public ObjectMapperConfig jackson1ObjectMapperFactory(Jackson1ObjectMapperFactory jackson1ObjectMapperFactory) {
return new ObjectMapperConfig(defaultObjectMapper, defaultObjectMapperType, gsonObjectMapperFactory,
jackson1ObjectMapperFactory, jackson2ObjectMapperFactory, jaxbObjectMapperFactory,... | java | public ObjectMapperConfig jackson1ObjectMapperFactory(Jackson1ObjectMapperFactory jackson1ObjectMapperFactory) {
return new ObjectMapperConfig(defaultObjectMapper, defaultObjectMapperType, gsonObjectMapperFactory,
jackson1ObjectMapperFactory, jackson2ObjectMapperFactory, jaxbObjectMapperFactory,... | [
"public",
"ObjectMapperConfig",
"jackson1ObjectMapperFactory",
"(",
"Jackson1ObjectMapperFactory",
"jackson1ObjectMapperFactory",
")",
"{",
"return",
"new",
"ObjectMapperConfig",
"(",
"defaultObjectMapper",
",",
"defaultObjectMapperType",
",",
"gsonObjectMapperFactory",
",",
"jac... | Specify a custom Jackson 1.0 object mapper factory.
@param jackson1ObjectMapperFactory The object mapper factory | [
"Specify",
"a",
"custom",
"Jackson",
"1",
".",
"0",
"object",
"mapper",
"factory",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/config/ObjectMapperConfig.java#L157-L161 | test | The Jackson1ObjectMapperFactory. | Of course, here is the Java code you requested:
```java
public ObjectMapperConfig jackson1ObjectMapperFactory(Jackson1ObjectMapperFactory jackson1ObjectMapperFactory) {
return new ObjectMapperConfig(defaultObjectMapper, defaultObjectMapperType, gsonObjectMapperFactory,
jackson1ObjectMapperFacto... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/core/joran/action/ShutdownHookAction.java | ShutdownHookAction.end | @Override
public void end(InterpretationContext ic, String name) throws ActionException {
if (inError) {
return;
}
Object o = ic.peekObject();
if (o != hook) {
addWarn("The object at the of the stack is not the hook pushed earlier.");
} else {
... | java | @Override
public void end(InterpretationContext ic, String name) throws ActionException {
if (inError) {
return;
}
Object o = ic.peekObject();
if (o != hook) {
addWarn("The object at the of the stack is not the hook pushed earlier.");
} else {
... | [
"@",
"Override",
"public",
"void",
"end",
"(",
"InterpretationContext",
"ic",
",",
"String",
"name",
")",
"throws",
"ActionException",
"{",
"if",
"(",
"inError",
")",
"{",
"return",
";",
"}",
"Object",
"o",
"=",
"ic",
".",
"peekObject",
"(",
")",
";",
... | Once the children elements are also parsed, now is the time to activate the
shutdown hook options. | [
"Once",
"the",
"children",
"elements",
"are",
"also",
"parsed",
"now",
"is",
"the",
"time",
"to",
"activate",
"the",
"shutdown",
"hook",
"options",
"."
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/joran/action/ShutdownHookAction.java#L73-L91 | test | End the block of code. | Of course, here is the Java code you requested:
```java
@Override
public void end(InterpretationContext ic, String name) throws ActionException {
if (inError) {
return;
}
Object o = ic.peekObject();
if (o != hook) {
addWarn("The object at the of the stack is... |
buschmais/jqa-commandline-tool | application/src/main/java/com/buschmais/jqassistant/commandline/Main.java | Main.gatherOptions | private Options gatherOptions(TaskFactory taskFactory) {
final Options options = new Options();
gatherTasksOptions(taskFactory, options);
gatherStandardOptions(options);
return options;
} | java | private Options gatherOptions(TaskFactory taskFactory) {
final Options options = new Options();
gatherTasksOptions(taskFactory, options);
gatherStandardOptions(options);
return options;
} | [
"private",
"Options",
"gatherOptions",
"(",
"TaskFactory",
"taskFactory",
")",
"{",
"final",
"Options",
"options",
"=",
"new",
"Options",
"(",
")",
";",
"gatherTasksOptions",
"(",
"taskFactory",
",",
"options",
")",
";",
"gatherStandardOptions",
"(",
"options",
... | Gather all options which are supported by the task (i.e. including standard and specific options).
@return The options. | [
"Gather",
"all",
"options",
"which",
"are",
"supported",
"by",
"the",
"task",
"(",
"i",
".",
"e",
".",
"including",
"standard",
"and",
"specific",
"options",
")",
"."
] | c24de584ef4414fca673a75c16f4a533a188481f | https://github.com/buschmais/jqa-commandline-tool/blob/c24de584ef4414fca673a75c16f4a533a188481f/application/src/main/java/com/buschmais/jqassistant/commandline/Main.java#L118-L123 | test | Gather the options for the current class. | Of course, here is the Java code you requested:
```java
private Options gatherOptions(TaskFactory taskFactory) {
final Options options = new Options();
gatherTasksOptions(taskFactory, options);
gatherStandardOptions(options);
return options;
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/unidata/io/BeLeDataInputStream.java | BeLeDataInputStream.readLELongs | public final void readLELongs(long lbuf[], int n) throws IOException {
int nLeft = n;
int lCount = 0;
int nToRead = kLongs;
while (nLeft > 0) {
if (nToRead > nLeft)
nToRead = nLeft;
readFully(byteWorkSpace, 0, 8 * nToRead);
int j = 0;
for (int i = 0; i < nToRead; i++) {
... | java | public final void readLELongs(long lbuf[], int n) throws IOException {
int nLeft = n;
int lCount = 0;
int nToRead = kLongs;
while (nLeft > 0) {
if (nToRead > nLeft)
nToRead = nLeft;
readFully(byteWorkSpace, 0, 8 * nToRead);
int j = 0;
for (int i = 0; i < nToRead; i++) {
... | [
"public",
"final",
"void",
"readLELongs",
"(",
"long",
"lbuf",
"[",
"]",
",",
"int",
"n",
")",
"throws",
"IOException",
"{",
"int",
"nLeft",
"=",
"n",
";",
"int",
"lCount",
"=",
"0",
";",
"int",
"nToRead",
"=",
"kLongs",
";",
"while",
"(",
"nLeft",
... | Reads <code>n</code> little-endian longs from a random access file.
<p/>
<p> This method is provided for speed when accessing a number
of consecutive values of the same type.
@param lbuf the buffer into which the longs are read
@param n the number of little-endian longs to read | [
"Reads",
"<code",
">",
"n<",
"/",
"code",
">",
"little",
"-",
"endian",
"longs",
"from",
"a",
"random",
"access",
"file",
".",
"<p",
"/",
">",
"<p",
">",
"This",
"method",
"is",
"provided",
"for",
"speed",
"when",
"accessing",
"a",
"number",
"of",
"c... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/BeLeDataInputStream.java#L134-L157 | test | Read n bytes of kLongs into lbuf. | Of course, here is the Java code you requested:
```java
public final void readLELongs(long lbuf[], int n) throws IOException {
int nLeft = n;
int lCount = 0;
int nToRead = kLongs;
while (nLeft > 0) {
if (nToRead > nLeft)
nToRead = nLeft;
readFully(byteWorkSpace, 0, 8 * nToRead);
... |
xmlet/XsdParser | src/main/java/org/xmlet/xsdparser/xsdelements/XsdAttribute.java | XsdAttribute.replaceUnsolvedElements | @Override
public void replaceUnsolvedElements(NamedConcreteElement elementWrapper) {
super.replaceUnsolvedElements(elementWrapper);
XsdAbstractElement element = elementWrapper.getElement();
if (element instanceof XsdSimpleType && simpleType != null && type.equals(elementWrapper.getName()))... | java | @Override
public void replaceUnsolvedElements(NamedConcreteElement elementWrapper) {
super.replaceUnsolvedElements(elementWrapper);
XsdAbstractElement element = elementWrapper.getElement();
if (element instanceof XsdSimpleType && simpleType != null && type.equals(elementWrapper.getName()))... | [
"@",
"Override",
"public",
"void",
"replaceUnsolvedElements",
"(",
"NamedConcreteElement",
"elementWrapper",
")",
"{",
"super",
".",
"replaceUnsolvedElements",
"(",
"elementWrapper",
")",
";",
"XsdAbstractElement",
"element",
"=",
"elementWrapper",
".",
"getElement",
"(... | Receives a {@link NamedConcreteElement} that should be the one requested earlier.
* In the {@link XsdAttribute} constructor:
this.simpleType = new UnsolvedReference(type, placeHolder);
XsdParser.getInstance().addUnsolvedReference((UnsolvedReference) this.simpleType);
This implies that the object being received is the o... | [
"Receives",
"a",
"{"
] | 0044681d77400e1568d1e7b1024a38ec76caa2cb | https://github.com/xmlet/XsdParser/blob/0044681d77400e1568d1e7b1024a38ec76caa2cb/src/main/java/org/xmlet/xsdparser/xsdelements/XsdAttribute.java#L184-L193 | test | Replace the elements that are not contained in the XSD XSD | Of course, here is the Java code you requested:
```java
@Override
public void replaceUnsolvedElements(NamedConcreteElement elementWrapper) {
super.replaceUnsolvedElements(elementWrapper);
XsdAbstractElement element = elementWrapper.getElement();
if (element instanceof XsdSimpleType && sim... |
oblac/jodd | jodd-core/src/main/java/jodd/exception/ExceptionUtil.java | ExceptionUtil.findCause | @SuppressWarnings({"unchecked"})
public static <T extends Throwable> T findCause(Throwable throwable, final Class<T> cause) {
while (throwable != null) {
if (throwable.getClass().equals(cause)) {
return (T) throwable;
}
throwable = throwable.getCause();
}
return null;
} | java | @SuppressWarnings({"unchecked"})
public static <T extends Throwable> T findCause(Throwable throwable, final Class<T> cause) {
while (throwable != null) {
if (throwable.getClass().equals(cause)) {
return (T) throwable;
}
throwable = throwable.getCause();
}
return null;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"T",
"findCause",
"(",
"Throwable",
"throwable",
",",
"final",
"Class",
"<",
"T",
">",
"cause",
")",
"{",
"while",
"(",
"throwable",
... | Finds throwing cause in exception stack. Returns throwable object if cause class is matched.
Otherwise, returns <code>null</code>. | [
"Finds",
"throwing",
"cause",
"in",
"exception",
"stack",
".",
"Returns",
"throwable",
"object",
"if",
"cause",
"class",
"is",
"matched",
".",
"Otherwise",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/exception/ExceptionUtil.java#L215-L224 | test | Find the cause of a throwable. | Of course, here is the Java code you requested:
```java
@SuppressWarnings({"unchecked"})
public static <T extends Throwable> T findCause(Throwable throwable, final Class<T> cause) {
while (throwable != null) {
if (throwable.getClass().equals(cause)) {
return (T) throwable;
}
throwable = throwable.getCa... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java | RandomAccessFile.read | public int read() throws IOException {
// If the file position is within the data, return the byte...
if (filePosition < dataEnd) {
int pos = (int) (filePosition - bufferStart);
filePosition++;
return (buffer[pos] & 0xff);
// ...or should we indicate EOF...
} else if (endO... | java | public int read() throws IOException {
// If the file position is within the data, return the byte...
if (filePosition < dataEnd) {
int pos = (int) (filePosition - bufferStart);
filePosition++;
return (buffer[pos] & 0xff);
// ...or should we indicate EOF...
} else if (endO... | [
"public",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"// If the file position is within the data, return the byte...\r",
"if",
"(",
"filePosition",
"<",
"dataEnd",
")",
"{",
"int",
"pos",
"=",
"(",
"int",
")",
"(",
"filePosition",
"-",
"bufferStart",
"... | Read a byte of data from the file, blocking until data is
available.
@return the next byte of data, or -1 if the end of the file is
reached.
@throws IOException if an I/O error occurrs. | [
"Read",
"a",
"byte",
"of",
"data",
"from",
"the",
"file",
"blocking",
"until",
"data",
"is",
"available",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java#L610-L627 | test | Reads a single SECTOR from the underlying stream. | Of course, here is the Java code you requested:
```java
public int read() throws IOException {
// If the file position is within the data, return the byte...
if (filePosition < dataEnd) {
int pos = (int) (filePosition - bufferStart);
filePosition++;
return (buffer[pos] & 0xff);
... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java | GridHorizCoordSys.makeProjection | private boolean makeProjection(NetcdfFile ncfile, int projType) {
switch (projType) {
case GridTableLookup.RotatedLatLon:
makeRotatedLatLon(ncfile);
break;
case GridTableLookup.PolarStereographic:
makePS();
break;
case GridTableLookup.LambertConformal:
ma... | java | private boolean makeProjection(NetcdfFile ncfile, int projType) {
switch (projType) {
case GridTableLookup.RotatedLatLon:
makeRotatedLatLon(ncfile);
break;
case GridTableLookup.PolarStereographic:
makePS();
break;
case GridTableLookup.LambertConformal:
ma... | [
"private",
"boolean",
"makeProjection",
"(",
"NetcdfFile",
"ncfile",
",",
"int",
"projType",
")",
"{",
"switch",
"(",
"projType",
")",
"{",
"case",
"GridTableLookup",
".",
"RotatedLatLon",
":",
"makeRotatedLatLon",
"(",
"ncfile",
")",
";",
"break",
";",
"case"... | Make a projection and add it to the netCDF file
@param ncfile netCDF file
@return true if projection was added and coordinates need to be added, false means do nothing | [
"Make",
"a",
"projection",
"and",
"add",
"it",
"to",
"the",
"netCDF",
"file"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java#L502-L576 | test | Make the projection for the given type of data | Of course, here is the Java code you requested:
```java
private boolean makeProjection(NetcdfFile ncfile, int projType) {
switch (projType) {
case GridTableLookup.RotatedLatLon:
makeRotatedLatLon(ncfile);
break;
case GridTableLookup.PolarStereographic:
makePS();
break;... |
TooTallNate/Java-WebSocket | src/main/java/org/java_websocket/WebSocketImpl.java | WebSocketImpl.closeConnectionDueToInternalServerError | private void closeConnectionDueToInternalServerError( RuntimeException exception ) {
write( generateHttpResponseDueToError( 500 ) );
flushAndClose( CloseFrame.NEVER_CONNECTED, exception.getMessage(), false );
} | java | private void closeConnectionDueToInternalServerError( RuntimeException exception ) {
write( generateHttpResponseDueToError( 500 ) );
flushAndClose( CloseFrame.NEVER_CONNECTED, exception.getMessage(), false );
} | [
"private",
"void",
"closeConnectionDueToInternalServerError",
"(",
"RuntimeException",
"exception",
")",
"{",
"write",
"(",
"generateHttpResponseDueToError",
"(",
"500",
")",
")",
";",
"flushAndClose",
"(",
"CloseFrame",
".",
"NEVER_CONNECTED",
",",
"exception",
".",
... | Close the connection if there was a server error by a RuntimeException
@param exception the RuntimeException causing this problem | [
"Close",
"the",
"connection",
"if",
"there",
"was",
"a",
"server",
"error",
"by",
"a",
"RuntimeException"
] | 73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9 | https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/WebSocketImpl.java#L411-L414 | test | Close connection due to server error. | Of course, here is the Java code you requested:
```java
private void closeConnectionDueToInternalServerError( RuntimeException exception ) {
write( generateHttpResponseDueToError( 500 ) );
flushAndClose( CloseFrame.NEVER_CONNECTED, exception.getMessage(), false );
}
```
Hope this helps! |
jboss/jboss-common-core | src/main/java/org/jboss/util/Semaphore.java | Semaphore.waitImpl | protected boolean waitImpl(Object lock) throws InterruptedException
{
// Wait (forever) until notified. To discover deadlocks,
// turn on debugging of this class
long start = System.currentTimeMillis();
lock.wait(DEADLOCK_TIMEOUT);
long end = System.currentTimeMillis();
if ((end ... | java | protected boolean waitImpl(Object lock) throws InterruptedException
{
// Wait (forever) until notified. To discover deadlocks,
// turn on debugging of this class
long start = System.currentTimeMillis();
lock.wait(DEADLOCK_TIMEOUT);
long end = System.currentTimeMillis();
if ((end ... | [
"protected",
"boolean",
"waitImpl",
"(",
"Object",
"lock",
")",
"throws",
"InterruptedException",
"{",
"// Wait (forever) until notified. To discover deadlocks,",
"// turn on debugging of this class",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
... | Protected ----------------------------------------------------- | [
"Protected",
"-----------------------------------------------------"
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/Semaphore.java#L115-L129 | test | Wait for the specified object to be notified. | Of course, here is the Java code you requested:
```java
protected boolean waitImpl(Object lock) throws InterruptedException
{
// Wait (forever) until notified. To discover deadlocks,
// turn on debugging of this class
long start = System.currentTimeMillis();
lock.wait(DEADLOCK_TIMEOUT);
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLDeleteVertex.java | OCommandExecutorSQLDeleteVertex.execute | public Object execute(final Map<Object, Object> iArgs) {
if (rid == null && query == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
if (!returning.equalsIgnoreCase("COUNT"))
allDeletedRecords = new ArrayList<ORecord>();
txAlreadyBeg... | java | public Object execute(final Map<Object, Object> iArgs) {
if (rid == null && query == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
if (!returning.equalsIgnoreCase("COUNT"))
allDeletedRecords = new ArrayList<ORecord>();
txAlreadyBeg... | [
"public",
"Object",
"execute",
"(",
"final",
"Map",
"<",
"Object",
",",
"Object",
">",
"iArgs",
")",
"{",
"if",
"(",
"rid",
"==",
"null",
"&&",
"query",
"==",
"null",
")",
"throw",
"new",
"OCommandExecutionException",
"(",
"\"Cannot execute the command because... | Execute the command and return the ODocument object created. | [
"Execute",
"the",
"command",
"and",
"return",
"the",
"ODocument",
"object",
"created",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLDeleteVertex.java#L166-L204 | test | Execute the CID SEGMENT. | Of course, here is the Java code you requested:
```java
public Object execute(final Map<Object, Object> iArgs) {
if (rid == null && query == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
if (!returning.equalsIgnoreCase("COUNT"))
allDel... |
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java | src/main/java/org/teachingextensions/approvals/lite/reporters/ImageWebReporter.java | ImageWebReporter.isWorkingInThisEnvironment | @Override
public boolean isWorkingInThisEnvironment(String forFile) {
return !GraphicsEnvironment.isHeadless()
&& GenericDiffReporter.isFileExtensionValid(forFile, GenericDiffReporter.IMAGE_FILE_EXTENSIONS);
} | java | @Override
public boolean isWorkingInThisEnvironment(String forFile) {
return !GraphicsEnvironment.isHeadless()
&& GenericDiffReporter.isFileExtensionValid(forFile, GenericDiffReporter.IMAGE_FILE_EXTENSIONS);
} | [
"@",
"Override",
"public",
"boolean",
"isWorkingInThisEnvironment",
"(",
"String",
"forFile",
")",
"{",
"return",
"!",
"GraphicsEnvironment",
".",
"isHeadless",
"(",
")",
"&&",
"GenericDiffReporter",
".",
"isFileExtensionValid",
"(",
"forFile",
",",
"GenericDiffReport... | We assume any environment that is not headless will have a web browser to display the image in a web page. | [
"We",
"assume",
"any",
"environment",
"that",
"is",
"not",
"headless",
"will",
"have",
"a",
"web",
"browser",
"to",
"display",
"the",
"image",
"in",
"a",
"web",
"page",
"."
] | 516fee15e537ecdb3f4dcbe3695c5cfde7e930da | https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/approvals/lite/reporters/ImageWebReporter.java#L21-L25 | test | Check if the file is working in this environment. | Of course, here is the Java code you requested:
```java
@Override
public boolean isWorkingInThisEnvironment(String forFile) {
return !GraphicsEnvironment.isHeadless()
&& GenericDiffReporter.isFileExtensionValid(forFile, GenericDiffReporter.IMAGE_FILE_EXTENSIONS);
}
```
Hope this helps! |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/ferry/JNIMemoryManager.java | JNIMemoryManager.getNumPinnedObjects | public long getNumPinnedObjects()
{
long numPinnedObjects = 0;
blockingLock();
try {
int numItems = mNextAvailableReferenceSlot;
for(int i = 0; i < numItems; i++)
{
JNIReference ref = mValidReferences[i];
if (ref != null && !ref.isDeleted())
++numPinnedObjects;
... | java | public long getNumPinnedObjects()
{
long numPinnedObjects = 0;
blockingLock();
try {
int numItems = mNextAvailableReferenceSlot;
for(int i = 0; i < numItems; i++)
{
JNIReference ref = mValidReferences[i];
if (ref != null && !ref.isDeleted())
++numPinnedObjects;
... | [
"public",
"long",
"getNumPinnedObjects",
"(",
")",
"{",
"long",
"numPinnedObjects",
"=",
"0",
";",
"blockingLock",
"(",
")",
";",
"try",
"{",
"int",
"numItems",
"=",
"mNextAvailableReferenceSlot",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nu... | Get the number of Ferry objects we believe are still in use.
<p>
This may be different than what you think because the Java garbage
collector may not have collected all objects yet.
</p>
<p>
Also, this method needs to walk the entire ferry reference heap, so it
can be expensive and not accurate (as the value may change... | [
"Get",
"the",
"number",
"of",
"Ferry",
"objects",
"we",
"believe",
"are",
"still",
"in",
"use",
".",
"<p",
">",
"This",
"may",
"be",
"different",
"than",
"what",
"you",
"think",
"because",
"the",
"Java",
"garbage",
"collector",
"may",
"not",
"have",
"col... | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/JNIMemoryManager.java#L1150-L1166 | test | Get the number of pinned objects in the sequence. | Of course, here is the Java code you requested:
```java
public long getNumPinnedObjects()
{
long numPinnedObjects = 0;
blockingLock();
try {
int numItems = mNextAvailableReferenceSlot;
for(int i = 0; i < numItems; i++)
{
JNIReference ref = mValidReferences[i];
if (ref !=... |
HalBuilder/halbuilder-core | src/main/java/com/theoryinpractise/halbuilder5/ResourceRepresentation.java | ResourceRepresentation.withRel | public ResourceRepresentation<V> withRel(Rel rel) {
if (rels.containsKey(rel.rel())) {
throw new IllegalStateException(String.format("Rel %s is already declared.", rel.rel()));
}
final TreeMap<String, Rel> updatedRels = rels.put(rel.rel(), rel);
return new ResourceRepresentation<>(
content... | java | public ResourceRepresentation<V> withRel(Rel rel) {
if (rels.containsKey(rel.rel())) {
throw new IllegalStateException(String.format("Rel %s is already declared.", rel.rel()));
}
final TreeMap<String, Rel> updatedRels = rels.put(rel.rel(), rel);
return new ResourceRepresentation<>(
content... | [
"public",
"ResourceRepresentation",
"<",
"V",
">",
"withRel",
"(",
"Rel",
"rel",
")",
"{",
"if",
"(",
"rels",
".",
"containsKey",
"(",
"rel",
".",
"rel",
"(",
")",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
"format",
"(... | Define rel semantics for this representation.
@param rel A defined relationship type | [
"Define",
"rel",
"semantics",
"for",
"this",
"representation",
"."
] | 73a277d844ec9616722f655dc34f8174b06b1327 | https://github.com/HalBuilder/halbuilder-core/blob/73a277d844ec9616722f655dc34f8174b06b1327/src/main/java/com/theoryinpractise/halbuilder5/ResourceRepresentation.java#L170-L177 | test | Add a new resource reference to this representation. | Of course, here is the Java code you requested:
```java
public ResourceRepresentation<V> withRel(Rel rel) {
if (rels.containsKey(rel.rel())) {
throw new IllegalStateException(String.format("Rel %s is already declared.", rel.rel()));
}
final TreeMap<String, Rel> updatedRels = rels.put(rel.rel(), rel);... |
abmargb/jamppa | src/main/java/org/jivesoftware/whack/SocketReadThread.java | SocketReadThread.run | public void run() {
try {
readStream();
} catch (EOFException eof) {
// Normal disconnect
} catch (SocketException se) {
// Do nothing if the exception occured while shutting down the
// component otherwise
// log the error and try to e... | java | public void run() {
try {
readStream();
} catch (EOFException eof) {
// Normal disconnect
} catch (SocketException se) {
// Do nothing if the exception occured while shutting down the
// component otherwise
// log the error and try to e... | [
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"readStream",
"(",
")",
";",
"}",
"catch",
"(",
"EOFException",
"eof",
")",
"{",
"// Normal disconnect",
"}",
"catch",
"(",
"SocketException",
"se",
")",
"{",
"// Do nothing if the exception occured while shutt... | A dedicated thread loop for reading the stream and sending incoming
packets to the appropriate router. | [
"A",
"dedicated",
"thread",
"loop",
"for",
"reading",
"the",
"stream",
"and",
"sending",
"incoming",
"packets",
"to",
"the",
"appropriate",
"router",
"."
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/SocketReadThread.java#L62-L80 | test | This method is called by the application to read the content of the file. | Of course, here is the Java code you requested:
```java
public void run() {
try {
readStream();
} catch (EOFException eof) {
// Normal disconnect
} catch (SocketException se) {
// Do nothing if the exception occured while shutting down the
// comp... |
Enterprise-Content-Management/infoarchive-sip-sdk | yaml/src/main/java/com/opentext/ia/yaml/configuration/zip/ZipBuilder.java | ZipBuilder.build | public File build() throws IOException {
if (entries.isEmpty()) {
throw new EmptyZipException();
}
String fileName = "import_configuration" + System.currentTimeMillis() + ".zip";
File result = new File(TEMP_DIR.toFile(), fileName);
try (ZipOutputStream zip = new ZipOutputStream(
Files... | java | public File build() throws IOException {
if (entries.isEmpty()) {
throw new EmptyZipException();
}
String fileName = "import_configuration" + System.currentTimeMillis() + ".zip";
File result = new File(TEMP_DIR.toFile(), fileName);
try (ZipOutputStream zip = new ZipOutputStream(
Files... | [
"public",
"File",
"build",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"entries",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"EmptyZipException",
"(",
")",
";",
"}",
"String",
"fileName",
"=",
"\"import_configuration\"",
"+",
"System",
".",... | Build a ZIP file containing the added entries.
@return A ZIP file containing the added entries
@throws IOException In case an I/O error occurs | [
"Build",
"a",
"ZIP",
"file",
"containing",
"the",
"added",
"entries",
"."
] | 3c84a4d9ce569139e9a442034526944d3e63436e | https://github.com/Enterprise-Content-Management/infoarchive-sip-sdk/blob/3c84a4d9ce569139e9a442034526944d3e63436e/yaml/src/main/java/com/opentext/ia/yaml/configuration/zip/ZipBuilder.java#L129-L150 | test | Build the XML configuration file. | Of course, here is the Java code you requested:
```java
public File build() throws IOException {
if (entries.isEmpty()) {
throw new EmptyZipException();
}
String fileName = "import_configuration" + System.currentTimeMillis() + ".zip";
File result = new File(TEMP_DIR.toFile(), fileName);
try ... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/WroModel.java | WroModel.merge | public void merge(final WroModel importedModel) {
Validate.notNull(importedModel, "imported model cannot be null!");
LOG.debug("merging importedModel: {}", importedModel);
for (final String groupName : new WroModelInspector(importedModel).getGroupNames()) {
if (new WroModelInspector(this).getGroupName... | java | public void merge(final WroModel importedModel) {
Validate.notNull(importedModel, "imported model cannot be null!");
LOG.debug("merging importedModel: {}", importedModel);
for (final String groupName : new WroModelInspector(importedModel).getGroupNames()) {
if (new WroModelInspector(this).getGroupName... | [
"public",
"void",
"merge",
"(",
"final",
"WroModel",
"importedModel",
")",
"{",
"Validate",
".",
"notNull",
"(",
"importedModel",
",",
"\"imported model cannot be null!\"",
")",
";",
"LOG",
".",
"debug",
"(",
"\"merging importedModel: {}\"",
",",
"importedModel",
")... | Merge this model with another model. This is useful for supporting model imports.
@param importedModel model to import. | [
"Merge",
"this",
"model",
"with",
"another",
"model",
".",
"This",
"is",
"useful",
"for",
"supporting",
"model",
"imports",
"."
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/WroModel.java#L79-L89 | test | Merge the given WroModel into this one. | Of course, here is the Java code you requested:
```java
public void merge(final WroModel importedModel) {
Validate.notNull(importedModel, "imported model cannot be null!");
LOG.debug("merging importedModel: {}", importedModel);
for (final String groupName : new WroModelInspector(importedModel).getGroupName... |
oblac/jodd | jodd-core/src/main/java/jodd/io/StreamUtil.java | StreamUtil.close | public static void close(final Closeable closeable) {
if (closeable != null) {
if (closeable instanceof Flushable) {
try {
((Flushable) closeable).flush();
} catch (IOException ignored) {
}
}
try {
closeable.close();
} catch (IOException ignored) {
}
}
} | java | public static void close(final Closeable closeable) {
if (closeable != null) {
if (closeable instanceof Flushable) {
try {
((Flushable) closeable).flush();
} catch (IOException ignored) {
}
}
try {
closeable.close();
} catch (IOException ignored) {
}
}
} | [
"public",
"static",
"void",
"close",
"(",
"final",
"Closeable",
"closeable",
")",
"{",
"if",
"(",
"closeable",
"!=",
"null",
")",
"{",
"if",
"(",
"closeable",
"instanceof",
"Flushable",
")",
"{",
"try",
"{",
"(",
"(",
"Flushable",
")",
"closeable",
")",
... | Closes silently the closable object. If it is {@link Flushable}, it
will be flushed first. No exception will be thrown if an I/O error occurs. | [
"Closes",
"silently",
"the",
"closable",
"object",
".",
"If",
"it",
"is",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/StreamUtil.java#L59-L73 | test | Close the given Closeable. | Of course, here is the Java code you requested:
```java
public static void close(final Closeable closeable) {
if (closeable != null) {
if (closeable instanceof Flushable) {
try {
((Flushable) closeable).flush();
} catch (IOException ignored) {
}
}
try {
closeable.close();
} catch (I... |
oaqa/baseqa | src/main/java/edu/cmu/lti/oaqa/type/kb/ConceptType.java | ConceptType.getName | public String getName() {
if (ConceptType_Type.featOkTst && ((ConceptType_Type)jcasType).casFeat_name == null)
jcasType.jcas.throwFeatMissing("name", "edu.cmu.lti.oaqa.type.kb.ConceptType");
return jcasType.ll_cas.ll_getStringValue(addr, ((ConceptType_Type)jcasType).casFeatCode_name);} | java | public String getName() {
if (ConceptType_Type.featOkTst && ((ConceptType_Type)jcasType).casFeat_name == null)
jcasType.jcas.throwFeatMissing("name", "edu.cmu.lti.oaqa.type.kb.ConceptType");
return jcasType.ll_cas.ll_getStringValue(addr, ((ConceptType_Type)jcasType).casFeatCode_name);} | [
"public",
"String",
"getName",
"(",
")",
"{",
"if",
"(",
"ConceptType_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"ConceptType_Type",
")",
"jcasType",
")",
".",
"casFeat_name",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"name\""... | getter for name - gets A human readable concept label.
@generated
@return value of the feature | [
"getter",
"for",
"name",
"-",
"gets",
"A",
"human",
"readable",
"concept",
"label",
"."
] | 6ea632d8e51e3e617d4876fc1185c49be0ad7eb8 | https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/kb/ConceptType.java#L96-L99 | test | getter for name - gets | Of course, here is the Java code you requested:
```java
public String getName() {
if (ConceptType_Type.featOkTst && ((ConceptType_Type)jcasType).casFeat_name == null)
jcasType.jcas.throwFeatMissing("name", "edu.cmu.lti.oaqa.type.kb.ConceptType");
return jcasType.ll_cas.ll_getStringValue(addr, ((ConceptTy... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/common/serialization/types/OIntegerSerializer.java | OIntegerSerializer.serializeInByteBufferObject | @Override
public void serializeInByteBufferObject(Integer object, ByteBuffer buffer, Object... hints) {
buffer.putInt(object);
} | java | @Override
public void serializeInByteBufferObject(Integer object, ByteBuffer buffer, Object... hints) {
buffer.putInt(object);
} | [
"@",
"Override",
"public",
"void",
"serializeInByteBufferObject",
"(",
"Integer",
"object",
",",
"ByteBuffer",
"buffer",
",",
"Object",
"...",
"hints",
")",
"{",
"buffer",
".",
"putInt",
"(",
"object",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/serialization/types/OIntegerSerializer.java#L115-L118 | test | Serialize in ByteBufferObject. | Of course, here is the Java code you requested:
```java
@Override
public void serializeInByteBufferObject(Integer object, ByteBuffer buffer, Object... hints) {
buffer.putInt(object);
}
```
Hope this helps! |
playframework/playframework | persistence/play-jdbc-evolutions/src/main/java/play/db/evolutions/Evolutions.java | Evolutions.applyEvolutions | public static void applyEvolutions(
Database database,
play.api.db.evolutions.EvolutionsReader reader,
boolean autocommit,
String schema) {
DatabaseEvolutions evolutions = new DatabaseEvolutions(database.asScala(), schema);
evolutions.evolve(evolutions.scripts(reader), autocommit);
} | java | public static void applyEvolutions(
Database database,
play.api.db.evolutions.EvolutionsReader reader,
boolean autocommit,
String schema) {
DatabaseEvolutions evolutions = new DatabaseEvolutions(database.asScala(), schema);
evolutions.evolve(evolutions.scripts(reader), autocommit);
} | [
"public",
"static",
"void",
"applyEvolutions",
"(",
"Database",
"database",
",",
"play",
".",
"api",
".",
"db",
".",
"evolutions",
".",
"EvolutionsReader",
"reader",
",",
"boolean",
"autocommit",
",",
"String",
"schema",
")",
"{",
"DatabaseEvolutions",
"evolutio... | Apply evolutions for the given database.
@param database The database to apply the evolutions to.
@param reader The reader to read the evolutions.
@param autocommit Whether autocommit should be used.
@param schema The schema where all the play evolution tables are saved in | [
"Apply",
"evolutions",
"for",
"the",
"given",
"database",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/persistence/play-jdbc-evolutions/src/main/java/play/db/evolutions/Evolutions.java#L81-L88 | test | Apply Evolutions to a database. | Of course, here is the Java code you requested:
```java
public static void applyEvolutions(
Database database,
play.api.db.evolutions.EvolutionsReader reader,
boolean autocommit,
String schema) {
DatabaseEvolutions evolutions = new DatabaseEvolutions(database.asScala(), schema);
evoluti... |
oblac/jodd | jodd-http/src/main/java/jodd/http/HttpRequest.java | HttpRequest.head | public static HttpRequest head(final String destination) {
return new HttpRequest()
.method(HttpMethod.HEAD)
.set(destination);
} | java | public static HttpRequest head(final String destination) {
return new HttpRequest()
.method(HttpMethod.HEAD)
.set(destination);
} | [
"public",
"static",
"HttpRequest",
"head",
"(",
"final",
"String",
"destination",
")",
"{",
"return",
"new",
"HttpRequest",
"(",
")",
".",
"method",
"(",
"HttpMethod",
".",
"HEAD",
")",
".",
"set",
"(",
"destination",
")",
";",
"}"
] | Builds a HEAD request. | [
"Builds",
"a",
"HEAD",
"request",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpRequest.java#L267-L271 | test | Create a head request. | Of course, here is the Java code you requested:
```java
public static HttpRequest head(final String destination) {
return new HttpRequest()
.method(HttpMethod.HEAD)
.set(destination);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java | CatalogBuilder.readService | protected Service readService(Element s) {
String name = s.getAttributeValue("name");
String typeS = s.getAttributeValue("serviceType");
String serviceBase = s.getAttributeValue("base");
String suffix = s.getAttributeValue("suffix");
String desc = s.getAttributeValue("desc");
String accessType =... | java | protected Service readService(Element s) {
String name = s.getAttributeValue("name");
String typeS = s.getAttributeValue("serviceType");
String serviceBase = s.getAttributeValue("base");
String suffix = s.getAttributeValue("suffix");
String desc = s.getAttributeValue("desc");
String accessType =... | [
"protected",
"Service",
"readService",
"(",
"Element",
"s",
")",
"{",
"String",
"name",
"=",
"s",
".",
"getAttributeValue",
"(",
"\"name\"",
")",
";",
"String",
"typeS",
"=",
"s",
".",
"getAttributeValue",
"(",
"\"serviceType\"",
")",
";",
"String",
"service... | /* <xsd:element name="service">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="property" minOccurs="0" maxOccurs="unbounded" />
<xsd:element ref="service" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="base" type="xsd:strin... | [
"/",
"*",
"<xsd",
":",
"element",
"name",
"=",
"service",
">",
"<xsd",
":",
"complexType",
">",
"<xsd",
":",
"sequence",
">",
"<xsd",
":",
"element",
"ref",
"=",
"property",
"minOccurs",
"=",
"0",
"maxOccurs",
"=",
"unbounded",
"/",
">",
"<xsd",
":",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java#L487-L531 | test | Read a service element. | Of course, here is the Java code you requested:
```java
protected Service readService(Element s) {
String name = s.getAttributeValue("name");
String typeS = s.getAttributeValue("serviceType");
String serviceBase = s.getAttributeValue("base");
String suffix = s.getAttributeValue("suffix");
String de... |
wildfly/wildfly | jdr/jboss-as-jdr/src/main/java/org/jboss/as/jdr/util/Utils.java | Utils.skip | public static void skip(InputStream is, long amount) throws IOException {
long leftToSkip = amount;
long amountSkipped = 0;
while(leftToSkip > 0 && amountSkipped >= 0){
amountSkipped = is.skip(leftToSkip);
leftToSkip -= amountSkipped;
}
} | java | public static void skip(InputStream is, long amount) throws IOException {
long leftToSkip = amount;
long amountSkipped = 0;
while(leftToSkip > 0 && amountSkipped >= 0){
amountSkipped = is.skip(leftToSkip);
leftToSkip -= amountSkipped;
}
} | [
"public",
"static",
"void",
"skip",
"(",
"InputStream",
"is",
",",
"long",
"amount",
")",
"throws",
"IOException",
"{",
"long",
"leftToSkip",
"=",
"amount",
";",
"long",
"amountSkipped",
"=",
"0",
";",
"while",
"(",
"leftToSkip",
">",
"0",
"&&",
"amountSki... | Ensure InputStream actually skips ahead the required number of bytes
@param is
@param amount
@throws IOException | [
"Ensure",
"InputStream",
"actually",
"skips",
"ahead",
"the",
"required",
"number",
"of",
"bytes"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jdr/jboss-as-jdr/src/main/java/org/jboss/as/jdr/util/Utils.java#L80-L87 | test | Skip the specified number of bytes from the specified input stream. | Of course, here is the Java code you requested:
```java
public static void skip(InputStream is, long amount) throws IOException {
long leftToSkip = amount;
long amountSkipped = 0;
while(leftToSkip > 0 && amountSkipped >= 0){
amountSkipped = is.skip(leftToSkip);
leftToSki... |
FitLayout/api | src/main/java/org/fit/layout/model/Rectangular.java | Rectangular.vsplit | public Rectangular vsplit(Rectangular other)
{
if (this.intersects(other))
{
Rectangular a = new Rectangular(this);
Rectangular b = new Rectangular(this);
if (a.y2 > other.y1 - 1) a.y2 = other.y1 - 1;
if (b.y1 < other.y2 + 1) b.y1 = other.y2 + 1;
... | java | public Rectangular vsplit(Rectangular other)
{
if (this.intersects(other))
{
Rectangular a = new Rectangular(this);
Rectangular b = new Rectangular(this);
if (a.y2 > other.y1 - 1) a.y2 = other.y1 - 1;
if (b.y1 < other.y2 + 1) b.y1 = other.y2 + 1;
... | [
"public",
"Rectangular",
"vsplit",
"(",
"Rectangular",
"other",
")",
"{",
"if",
"(",
"this",
".",
"intersects",
"(",
"other",
")",
")",
"{",
"Rectangular",
"a",
"=",
"new",
"Rectangular",
"(",
"this",
")",
";",
"Rectangular",
"b",
"=",
"new",
"Rectangula... | If this rectangle intersets with the other one, splits this rectangle horizontally so that it does not intersect with the other one anymore.
@param other the rectangle used to split this one
@return if this rectangle had to be split in two parts, the second one is returned. Otherwise, null is returned. | [
"If",
"this",
"rectangle",
"intersets",
"with",
"the",
"other",
"one",
"splits",
"this",
"rectangle",
"horizontally",
"so",
"that",
"it",
"does",
"not",
"intersect",
"with",
"the",
"other",
"one",
"anymore",
"."
] | fcfa67ce2a7485fbd722576413191fff5d68bae8 | https://github.com/FitLayout/api/blob/fcfa67ce2a7485fbd722576413191fff5d68bae8/src/main/java/org/fit/layout/model/Rectangular.java#L371-L395 | test | vsplit returns the two rectangles in a single page. | Of course, here is the Java code you requested:
```java
public Rectangular vsplit(Rectangular other)
{
if (this.intersects(other))
{
Rectangular a = new Rectangular(this);
Rectangular b = new Rectangular(this);
if (a.y2 > other.y1 - 1) a.y2 = other.y1 - 1;
... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/service/WebSheetLoader.java | WebSheetLoader.setUnsavedStatus | public void setUnsavedStatus(final RequestContext requestContext, final Boolean statusFlag) {
// in client js should have setUnsavedState method
if (requestContext != null) {
LOG.log(Level.FINE, "run setUnsavedState( {} )", statusFlag.toString());
requestContext.execute("setUnsavedState(" + statusFlag.t... | java | public void setUnsavedStatus(final RequestContext requestContext, final Boolean statusFlag) {
// in client js should have setUnsavedState method
if (requestContext != null) {
LOG.log(Level.FINE, "run setUnsavedState( {} )", statusFlag.toString());
requestContext.execute("setUnsavedState(" + statusFlag.t... | [
"public",
"void",
"setUnsavedStatus",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"Boolean",
"statusFlag",
")",
"{",
"// in client js should have setUnsavedState method\r",
"if",
"(",
"requestContext",
"!=",
"null",
")",
"{",
"LOG",
".",
"log",
"("... | Sets the unsaved status.
@param requestContext
the request context
@param statusFlag
the status flag | [
"Sets",
"the",
"unsaved",
"status",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/service/WebSheetLoader.java#L934-L942 | test | Sets the status flag for the
operation. | Of course, here is the Java code you requested:
```java
public void setUnsavedStatus(final RequestContext requestContext, final Boolean statusFlag) {
// in client js should have setUnsavedState method
if (requestContext != null) {
LOG.log(Level.FINE, "run setUnsavedState( {} )", statusFlag.toString());
... |
rockagen/commons-lib | src/main/java/com/rockagen/commons/util/Arith.java | Arith.mul | public static double mul(final double v1,final double v2){
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.multiply(b2).doubleValue();
} | java | public static double mul(final double v1,final double v2){
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.multiply(b2).doubleValue();
} | [
"public",
"static",
"double",
"mul",
"(",
"final",
"double",
"v1",
",",
"final",
"double",
"v2",
")",
"{",
"BigDecimal",
"b1",
"=",
"new",
"BigDecimal",
"(",
"Double",
".",
"toString",
"(",
"v1",
")",
")",
";",
"BigDecimal",
"b2",
"=",
"new",
"BigDecim... | mul
@param v1 left value
@param v2 right value
@return v1*v2 | [
"mul"
] | f37141cf40be79d130db804c39ce61690541d5f1 | https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/util/Arith.java#L100-L104 | test | Multiply two numbers. | Of course, here is the Java code you requested:
```java
public static double mul(final double v1,final double v2){
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.multiply(b2).doubleValue();
}
```
Hope this helps! |
boonproject/boon | boon/src/main/java/org/boon/primitive/Lng.java | Lng.calculateIndex | private static int calculateIndex( long[] array, int originalIndex ) {
final int length = array.length;
Exceptions.requireNonNull( array, "array cannot be null" );
int index = originalIndex;
/* Adjust for reading from the right as in
-1 reads the 4th element if the length is ... | java | private static int calculateIndex( long[] array, int originalIndex ) {
final int length = array.length;
Exceptions.requireNonNull( array, "array cannot be null" );
int index = originalIndex;
/* Adjust for reading from the right as in
-1 reads the 4th element if the length is ... | [
"private",
"static",
"int",
"calculateIndex",
"(",
"long",
"[",
"]",
"array",
",",
"int",
"originalIndex",
")",
"{",
"final",
"int",
"length",
"=",
"array",
".",
"length",
";",
"Exceptions",
".",
"requireNonNull",
"(",
"array",
",",
"\"array cannot be null\"",... | /* End universal methods. | [
"/",
"*",
"End",
"universal",
"methods",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/primitive/Lng.java#L409-L439 | test | Calculate the index of the n - th entry in the array. | Of course, here is the Java code you requested:
```java
private static int calculateIndex( long[] array, int originalIndex ) {
final int length = array.length;
Exceptions.requireNonNull( array, "array cannot be null" );
int index = originalIndex;
/* Adjust for reading from the right... |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java | DateHelper.dateToStrLong | public static String dateToStrLong(Date dateDate) {
String dateString = FORMATTER_LONG.format(dateDate);
return dateString;
} | java | public static String dateToStrLong(Date dateDate) {
String dateString = FORMATTER_LONG.format(dateDate);
return dateString;
} | [
"public",
"static",
"String",
"dateToStrLong",
"(",
"Date",
"dateDate",
")",
"{",
"String",
"dateString",
"=",
"FORMATTER_LONG",
".",
"format",
"(",
"dateDate",
")",
";",
"return",
"dateString",
";",
"}"
] | 将长时间格式时间转换为字符串 yyyy-MM-dd HH:mm:ss
@param dateDate
@return | [
"将长时间格式时间转换为字符串",
"yyyy",
"-",
"MM",
"-",
"dd",
"HH",
":",
"mm",
":",
"ss"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java#L158-L161 | test | dateToStrLong This method converts a date to a string. | Of course, here is the Java code you requested:
```java
public static String dateToStrLong(Date dateDate) {
String dateString = FORMATTER_LONG.format(dateDate);
return dateString;
}
```
Hope this helps! |
real-logic/aeron | aeron-driver/src/main/java/io/aeron/driver/Configuration.java | Configuration.congestionControlSupplier | public static CongestionControlSupplier congestionControlSupplier()
{
CongestionControlSupplier supplier = null;
try
{
final String className = getProperty(CONGESTION_CONTROL_STRATEGY_SUPPLIER_PROP_NAME);
if (null == className)
{
return new... | java | public static CongestionControlSupplier congestionControlSupplier()
{
CongestionControlSupplier supplier = null;
try
{
final String className = getProperty(CONGESTION_CONTROL_STRATEGY_SUPPLIER_PROP_NAME);
if (null == className)
{
return new... | [
"public",
"static",
"CongestionControlSupplier",
"congestionControlSupplier",
"(",
")",
"{",
"CongestionControlSupplier",
"supplier",
"=",
"null",
";",
"try",
"{",
"final",
"String",
"className",
"=",
"getProperty",
"(",
"CONGESTION_CONTROL_STRATEGY_SUPPLIER_PROP_NAME",
")"... | Get the supplier of {@link CongestionControl} implementations which can be used for receivers.
@return the {@link CongestionControlSupplier} | [
"Get",
"the",
"supplier",
"of",
"{",
"@link",
"CongestionControl",
"}",
"implementations",
"which",
"can",
"be",
"used",
"for",
"receivers",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-driver/src/main/java/io/aeron/driver/Configuration.java#L1065-L1084 | test | Get the CongestionControlSupplier object. | Of course, here is the Java code you requested:
```java
public static CongestionControlSupplier congestionControlSupplier()
{
CongestionControlSupplier supplier = null;
try
{
final String className = getProperty(CONGESTION_CONTROL_STRATEGY_SUPPLIER_PROP_NAME);
if (nu... |
workplacesystems/utilsj | src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java | TransactionalBidiTreeMap.getCeilNode | private Node<K,V> getCeilNode(Object lookup, int type) {
Node<K,V> p = TransactionalBidiTreeMap.this.rootNode[type];
Object compareval;
if (p==null)
return null;
while (true) {
compareval = type == KEY ? p.getKey() : p.getValue();
int cmp = Tra... | java | private Node<K,V> getCeilNode(Object lookup, int type) {
Node<K,V> p = TransactionalBidiTreeMap.this.rootNode[type];
Object compareval;
if (p==null)
return null;
while (true) {
compareval = type == KEY ? p.getKey() : p.getValue();
int cmp = Tra... | [
"private",
"Node",
"<",
"K",
",",
"V",
">",
"getCeilNode",
"(",
"Object",
"lookup",
",",
"int",
"type",
")",
"{",
"Node",
"<",
"K",
",",
"V",
">",
"p",
"=",
"TransactionalBidiTreeMap",
".",
"this",
".",
"rootNode",
"[",
"type",
"]",
";",
"Object",
... | Gets the entry corresponding to the specified key; if no such entry
exists, returns the entry for the least key greater than the specified
key; if no such entry exists (i.e., the greatest key in the Tree is less
than the specified key), returns <tt>null</tt>. | [
"Gets",
"the",
"entry",
"corresponding",
"to",
"the",
"specified",
"key",
";",
"if",
"no",
"such",
"entry",
"exists",
"returns",
"the",
"entry",
"for",
"the",
"least",
"key",
"greater",
"than",
"the",
"specified",
"key",
";",
"if",
"no",
"such",
"entry",
... | 1b638be51997eafac4d368c14f62a16624a08d3e | https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2657-L2686 | test | Gets the first node of the specified type in the tree that matches the lookup object. | Of course, here is the Java code you requested:
```java
private Node<K,V> getCeilNode(Object lookup, int type) {
Node<K,V> p = TransactionalBidiTreeMap.this.rootNode[type];
Object compareval;
if (p==null)
return null;
while (true) {
compareval = type == KEY... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/component/ScopeResolver.java | ScopeResolver.forScope | public void forScope(final Class<? extends MadvocScope> scopeType, final Consumer<MadvocScope> madvocScopeConsumer) {
final MadvocScope scope = getOrInitScope(scopeType);
madvocScopeConsumer.accept(scope);
} | java | public void forScope(final Class<? extends MadvocScope> scopeType, final Consumer<MadvocScope> madvocScopeConsumer) {
final MadvocScope scope = getOrInitScope(scopeType);
madvocScopeConsumer.accept(scope);
} | [
"public",
"void",
"forScope",
"(",
"final",
"Class",
"<",
"?",
"extends",
"MadvocScope",
">",
"scopeType",
",",
"final",
"Consumer",
"<",
"MadvocScope",
">",
"madvocScopeConsumer",
")",
"{",
"final",
"MadvocScope",
"scope",
"=",
"getOrInitScope",
"(",
"scopeType... | Finds a given scope and consumes it. | [
"Finds",
"a",
"given",
"scope",
"and",
"consumes",
"it",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/ScopeResolver.java#L96-L99 | test | For scope. | Of course, here is the Java code you requested:
```java
public void forScope(final Class<? extends MadvocScope> scopeType, final Consumer<MadvocScope> madvocScopeConsumer) {
final MadvocScope scope = getOrInitScope(scopeType);
madvocScopeConsumer.accept(scope);
}
```
Hope this helps! |
RestComm/jain-slee | api/jar/src/main/java/javax/slee/management/AlarmNotification.java | AlarmNotification.writeObject | private void writeObject(ObjectOutputStream out) throws IOException {
VendorExtensionUtils.writeObject(out, vendorDataSerializationEnabled ? vendorData : null);
if (cause != null) {
out.writeBoolean(true);
// serialize the cause inside a marshalled object to isolate
... | java | private void writeObject(ObjectOutputStream out) throws IOException {
VendorExtensionUtils.writeObject(out, vendorDataSerializationEnabled ? vendorData : null);
if (cause != null) {
out.writeBoolean(true);
// serialize the cause inside a marshalled object to isolate
... | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"VendorExtensionUtils",
".",
"writeObject",
"(",
"out",
",",
"vendorDataSerializationEnabled",
"?",
"vendorData",
":",
"null",
")",
";",
"if",
"(",
"cause",
"!="... | special handling of serialization | [
"special",
"handling",
"of",
"serialization"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/management/AlarmNotification.java#L413-L432 | test | Serialize the exception in the stream. | Of course, here is the Java code you requested:
```java
private void writeObject(ObjectOutputStream out) throws IOException {
VendorExtensionUtils.writeObject(out, vendorDataSerializationEnabled ? vendorData : null);
if (cause != null) {
out.writeBoolean(true);
// serialize the... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/OpenImmoUtils.java | OpenImmoUtils.createUserDefinedSimplefield | @SuppressWarnings("Duplicates")
public static Element createUserDefinedSimplefield(Document doc, String name, String value) {
Element root = XmlUtils.getRootElement(doc);
Element node = doc.createElementNS(root.getNamespaceURI(), "user_defined_simplefield");
node.setAttribute("feldname", nam... | java | @SuppressWarnings("Duplicates")
public static Element createUserDefinedSimplefield(Document doc, String name, String value) {
Element root = XmlUtils.getRootElement(doc);
Element node = doc.createElementNS(root.getNamespaceURI(), "user_defined_simplefield");
node.setAttribute("feldname", nam... | [
"@",
"SuppressWarnings",
"(",
"\"Duplicates\"",
")",
"public",
"static",
"Element",
"createUserDefinedSimplefield",
"(",
"Document",
"doc",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Element",
"root",
"=",
"XmlUtils",
".",
"getRootElement",
"(",
"... | Helper method to create a <user_defined_simplefield> element with a
"feldname" attribute and a string value.
@param doc document, for which the element is created
@param name value of the "feldname" attribute in the created element
@param value text value of the created element
@return created element | [
"Helper",
"method",
"to",
"create",
"a",
"<",
";",
"user_defined_simplefield>",
";",
"element",
"with",
"a",
"feldname",
"attribute",
"and",
"a",
"string",
"value",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/OpenImmoUtils.java#L194-L201 | test | Create a user defined simplefield. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("Duplicates")
public static Element createUserDefinedSimplefield(Document doc, String name, String value) {
Element root = XmlUtils.getRootElement(doc);
Element node = doc.createElementNS(root.getNamespaceURI(), "user_defined... |
jcodec/jcodec | src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java | BlockInterpolator.getLuma02UnsafeNoRound | static void getLuma02UnsafeNoRound(byte[] pic, int picW, int picH, int[] blk, int blkOff, int blkStride, int x,
int y, int blkW, int blkH) {
int maxH = picH - 1;
int maxW = picW - 1;
for (int j = 0; j < blkH; j++) {
int offP0 = clip(y + j - 2, 0, maxH) * picW;
... | java | static void getLuma02UnsafeNoRound(byte[] pic, int picW, int picH, int[] blk, int blkOff, int blkStride, int x,
int y, int blkW, int blkH) {
int maxH = picH - 1;
int maxW = picW - 1;
for (int j = 0; j < blkH; j++) {
int offP0 = clip(y + j - 2, 0, maxH) * picW;
... | [
"static",
"void",
"getLuma02UnsafeNoRound",
"(",
"byte",
"[",
"]",
"pic",
",",
"int",
"picW",
",",
"int",
"picH",
",",
"int",
"[",
"]",
"blk",
",",
"int",
"blkOff",
",",
"int",
"blkStride",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"blkW",
",",... | Hpel (0, 2) vertical unsafe | [
"Hpel",
"(",
"0",
"2",
")",
"vertical",
"unsafe"
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java#L277-L301 | test | Get Luma02 unsafe no round. | Of course, here is the Java code you requested:
```java
static void getLuma02UnsafeNoRound(byte[] pic, int picW, int picH, int[] blk, int blkOff, int blkStride, int x,
int y, int blkW, int blkH) {
int maxH = picH - 1;
int maxW = picW - 1;
for (int j = 0; j < blkH; j++) {
... |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java | ObjectFactory.createGrundstueckEmpfohleneNutzungParkhaus | @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Parkhaus", scope = GrundstueckEmpfohleneNutzung.class)
public JAXBElement<Object> createGrundstueckEmpfohleneNutzungParkhaus(Object value) {
return new JAXBElement<Object>(_GrundstueckEmpfohleneNutzungParkhaus_QNAME, O... | java | @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Parkhaus", scope = GrundstueckEmpfohleneNutzung.class)
public JAXBElement<Object> createGrundstueckEmpfohleneNutzungParkhaus(Object value) {
return new JAXBElement<Object>(_GrundstueckEmpfohleneNutzungParkhaus_QNAME, O... | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immobilienscout24.de/immobilientransfer\"",
",",
"name",
"=",
"\"Parkhaus\"",
",",
"scope",
"=",
"GrundstueckEmpfohleneNutzung",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"Object",
">",
"createGrundstueckE... | Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"Object",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java#L1125-L1128 | test | Create an instance of a GrundstueckEmpfohleneNutzung pukhaus. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Parkhaus", scope = GrundstueckEmpfohleneNutzung.class)
public JAXBElement<Object> createGrundstueckEmpfohleneNutzungParkhaus(Object value) {
return new JAXBEleme... |
wildfly/wildfly | messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/QueueService.java | QueueService.stop | @Override
public synchronized void stop(StopContext context) {
try {
final ActiveMQServer server = this.activeMQServerSupplier.get();
server.destroyQueue(new SimpleString(queueConfiguration.getName()), null, false);
MessagingLogger.ROOT_LOGGER.debugf("Destroying queue fro... | java | @Override
public synchronized void stop(StopContext context) {
try {
final ActiveMQServer server = this.activeMQServerSupplier.get();
server.destroyQueue(new SimpleString(queueConfiguration.getName()), null, false);
MessagingLogger.ROOT_LOGGER.debugf("Destroying queue fro... | [
"@",
"Override",
"public",
"synchronized",
"void",
"stop",
"(",
"StopContext",
"context",
")",
"{",
"try",
"{",
"final",
"ActiveMQServer",
"server",
"=",
"this",
".",
"activeMQServerSupplier",
".",
"get",
"(",
")",
";",
"server",
".",
"destroyQueue",
"(",
"n... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/QueueService.java#L82-L91 | test | Destroy a queue. | Of course, here is the Java code you requested:
```java
@Override
public synchronized void stop(StopContext context) {
try {
final ActiveMQServer server = this.activeMQServerSupplier.get();
server.destroyQueue(new SimpleString(queueConfiguration.getName()), null, false);
... |
ReactiveX/RxJava | src/main/java/io/reactivex/Completable.java | Completable.toNpe | private static NullPointerException toNpe(Throwable ex) {
NullPointerException npe = new NullPointerException("Actually not, but can't pass out an exception otherwise...");
npe.initCause(ex);
return npe;
} | java | private static NullPointerException toNpe(Throwable ex) {
NullPointerException npe = new NullPointerException("Actually not, but can't pass out an exception otherwise...");
npe.initCause(ex);
return npe;
} | [
"private",
"static",
"NullPointerException",
"toNpe",
"(",
"Throwable",
"ex",
")",
"{",
"NullPointerException",
"npe",
"=",
"new",
"NullPointerException",
"(",
"\"Actually not, but can't pass out an exception otherwise...\"",
")",
";",
"npe",
".",
"initCause",
"(",
"ex",
... | Creates a NullPointerException instance and sets the given Throwable as its initial cause.
@param ex the Throwable instance to use as cause, not null (not verified)
@return the created NullPointerException | [
"Creates",
"a",
"NullPointerException",
"instance",
"and",
"sets",
"the",
"given",
"Throwable",
"as",
"its",
"initial",
"cause",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L949-L953 | test | Converts a Throwable to a NullPointerException. | Of course, here is the Java code you requested:
```java
private static NullPointerException toNpe(Throwable ex) {
NullPointerException npe = new NullPointerException("Actually not, but can't pass out an exception otherwise...");
npe.initCause(ex);
return npe;
}
```
Hope this helps! |
GojaFramework/goja | goja-core/src/main/java/goja/core/kits/lang/RuntimeKit.java | RuntimeKit.currentMethod | public static String currentMethod() {
StackTraceElement[] ste = new Exception().getStackTrace();
int ndx = (ste.length > 1) ? 1 : 0;
return new Exception().getStackTrace()[ndx].toString();
} | java | public static String currentMethod() {
StackTraceElement[] ste = new Exception().getStackTrace();
int ndx = (ste.length > 1) ? 1 : 0;
return new Exception().getStackTrace()[ndx].toString();
} | [
"public",
"static",
"String",
"currentMethod",
"(",
")",
"{",
"StackTraceElement",
"[",
"]",
"ste",
"=",
"new",
"Exception",
"(",
")",
".",
"getStackTrace",
"(",
")",
";",
"int",
"ndx",
"=",
"(",
"ste",
".",
"length",
">",
"1",
")",
"?",
"1",
":",
... | Returns current method signature. | [
"Returns",
"current",
"method",
"signature",
"."
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/lang/RuntimeKit.java#L21-L25 | test | Get the current method name. | Of course, here is the Java code you requested:
```java
public static String currentMethod() {
StackTraceElement[] ste = new Exception().getStackTrace();
int ndx = (ste.length > 1) ? 1 : 0;
return new Exception().getStackTrace()[ndx].toString();
}
```
Hope this helps! |
jbundle/util | jbackup/src/main/java/org/jbundle/jbackup/source/BaseSource.java | BaseSource.hasNext | public boolean hasNext() {
if (m_nextPend != null)
return true;
m_nextPend = this.next();
if (m_nextPend == null)
return false;
else
return true;
} | java | public boolean hasNext() {
if (m_nextPend != null)
return true;
m_nextPend = this.next();
if (m_nextPend == null)
return false;
else
return true;
} | [
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"if",
"(",
"m_nextPend",
"!=",
"null",
")",
"return",
"true",
";",
"m_nextPend",
"=",
"this",
".",
"next",
"(",
")",
";",
"if",
"(",
"m_nextPend",
"==",
"null",
")",
"return",
"false",
";",
"else",
"retu... | Returns <tt>true</tt> if the iteration has more elements. (In other
words, returns <tt>true</tt> if <tt>next</tt> would return an element
rather than throwing an exception.)
@return <tt>true</tt> if the iterator has more elements. | [
"Returns",
"<tt",
">",
"true<",
"/",
"tt",
">",
"if",
"the",
"iteration",
"has",
"more",
"elements",
".",
"(",
"In",
"other",
"words",
"returns",
"<tt",
">",
"true<",
"/",
"tt",
">",
"if",
"<tt",
">",
"next<",
"/",
"tt",
">",
"would",
"return",
"an... | 5af0f2292f56f29f70cbc26d0bfa72f89ae31be0 | https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/source/BaseSource.java#L99-L107 | test | Returns true if there is more elements in the iterator. | Of course, here is the Java code you requested:
```java
public boolean hasNext() {
if (m_nextPend != null)
return true;
m_nextPend = this.next();
if (m_nextPend == null)
return false;
else
return true;
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.