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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Unidata/thredds | netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4wrapper.java | Nc4wrapper.nc_inq_libvers | @Override
public synchronized
String nc_inq_libvers() {
String ret;
try {ce();
ret = nc4.nc_inq_libvers();
if(TRACE) trace(ret,"nc_inq_libvers","-");
} finally {cx();}
return ret;
} | java | @Override
public synchronized
String nc_inq_libvers() {
String ret;
try {ce();
ret = nc4.nc_inq_libvers();
if(TRACE) trace(ret,"nc_inq_libvers","-");
} finally {cx();}
return ret;
} | [
"@",
"Override",
"public",
"synchronized",
"String",
"nc_inq_libvers",
"(",
")",
"{",
"String",
"ret",
";",
"try",
"{",
"ce",
"(",
")",
";",
"ret",
"=",
"nc4",
".",
"nc_inq_libvers",
"(",
")",
";",
"if",
"(",
"TRACE",
")",
"trace",
"(",
"ret",
",",
... | Begin API Override | [
"Begin",
"API",
"Override"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4wrapper.java#L63-L72 | test | This method is used to get the inq_libvers value of a C - GeoPackage. | Of course, here is the Java code you requested:
```java
@Override
public synchronized
String nc_inq_libvers() {
String ret;
try {ce();
ret = nc4.nc_inq_libvers();
if(TRACE) trace(ret,"nc_inq_libvers","-");
} finally {cx();}
return ret;
}
```
Hope this helps! |
streamsets/datacollector | kudu-protolib/src/main/java/com/streamsets/pipeline/stage/processor/kudulookup/KuduLookupProcessor.java | KuduLookupProcessor.generateLookupKey | private KuduLookupKey generateLookupKey(final Record record, final String tableName) throws OnRecordErrorException{
Map<String, Field> keyList = new HashMap<>();
for (Map.Entry<String, String> key : columnToField.entrySet()){
String fieldName = key.getValue();
if (!record.has(fieldName)) {
t... | java | private KuduLookupKey generateLookupKey(final Record record, final String tableName) throws OnRecordErrorException{
Map<String, Field> keyList = new HashMap<>();
for (Map.Entry<String, String> key : columnToField.entrySet()){
String fieldName = key.getValue();
if (!record.has(fieldName)) {
t... | [
"private",
"KuduLookupKey",
"generateLookupKey",
"(",
"final",
"Record",
"record",
",",
"final",
"String",
"tableName",
")",
"throws",
"OnRecordErrorException",
"{",
"Map",
"<",
"String",
",",
"Field",
">",
"keyList",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";"... | Create a map of keyColumn - value to lookup in cache.
@param record
@return Map of keyColumn - value
@throws OnRecordErrorException | [
"Create",
"a",
"map",
"of",
"keyColumn",
"-",
"value",
"to",
"lookup",
"in",
"cache",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/kudu-protolib/src/main/java/com/streamsets/pipeline/stage/processor/kudulookup/KuduLookupProcessor.java#L315-L325 | test | Generate a lookup key. | Of course, here is the Java code you requested:
```java
private KuduLookupKey generateLookupKey(final Record record, final String tableName) throws OnRecordErrorException{
Map<String, Field> keyList = new HashMap<>();
for (Map.Entry<String, String> key : columnToField.entrySet()){
String fieldName = key.... |
real-logic/aeron | aeron-client/src/main/java/io/aeron/CommonContext.java | CommonContext.saveErrorLog | public int saveErrorLog(final PrintStream out)
{
final MappedByteBuffer cncByteBuffer = mapExistingCncFile(null);
try
{
return saveErrorLog(out, cncByteBuffer);
}
finally
{
IoUtil.unmap(cncByteBuffer);
}
} | java | public int saveErrorLog(final PrintStream out)
{
final MappedByteBuffer cncByteBuffer = mapExistingCncFile(null);
try
{
return saveErrorLog(out, cncByteBuffer);
}
finally
{
IoUtil.unmap(cncByteBuffer);
}
} | [
"public",
"int",
"saveErrorLog",
"(",
"final",
"PrintStream",
"out",
")",
"{",
"final",
"MappedByteBuffer",
"cncByteBuffer",
"=",
"mapExistingCncFile",
"(",
"null",
")",
";",
"try",
"{",
"return",
"saveErrorLog",
"(",
"out",
",",
"cncByteBuffer",
")",
";",
"}"... | Read the error log to a given {@link PrintStream}
@param out to write the error log contents to.
@return the number of observations from the error log. | [
"Read",
"the",
"error",
"log",
"to",
"a",
"given",
"{",
"@link",
"PrintStream",
"}"
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/CommonContext.java#L622-L633 | test | Save the error log to a PrintStream. | Of course, here is the Java code you requested:
```java
public int saveErrorLog(final PrintStream out)
{
final MappedByteBuffer cncByteBuffer = mapExistingCncFile(null);
try
{
return saveErrorLog(out, cncByteBuffer);
}
finally
{
IoUtil.unmap(c... |
eclipse/packagedrone | bundles/org.tukani.xz/src/org/tukaani/xz/lzma/LZMAEncoder.java | LZMAEncoder.getDistSlot | public static int getDistSlot(int dist) {
if (dist <= DIST_MODEL_START && dist >= 0)
return dist;
int n = dist;
int i = 31;
if ((n & 0xFFFF0000) == 0) {
n <<= 16;
i = 15;
}
if ((n & 0xFF000000) == 0) {
n <<= 8;
... | java | public static int getDistSlot(int dist) {
if (dist <= DIST_MODEL_START && dist >= 0)
return dist;
int n = dist;
int i = 31;
if ((n & 0xFFFF0000) == 0) {
n <<= 16;
i = 15;
}
if ((n & 0xFF000000) == 0) {
n <<= 8;
... | [
"public",
"static",
"int",
"getDistSlot",
"(",
"int",
"dist",
")",
"{",
"if",
"(",
"dist",
"<=",
"DIST_MODEL_START",
"&&",
"dist",
">=",
"0",
")",
"return",
"dist",
";",
"int",
"n",
"=",
"dist",
";",
"int",
"i",
"=",
"31",
";",
"if",
"(",
"(",
"n... | Gets an integer [0, 63] matching the highest two bits of an integer.
This is like bit scan reverse (BSR) on x86 except that this also
cares about the second highest bit. | [
"Gets",
"an",
"integer",
"[",
"0",
"63",
"]",
"matching",
"the",
"highest",
"two",
"bits",
"of",
"an",
"integer",
".",
"This",
"is",
"like",
"bit",
"scan",
"reverse",
"(",
"BSR",
")",
"on",
"x86",
"except",
"that",
"this",
"also",
"cares",
"about",
"... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.tukani.xz/src/org/tukaani/xz/lzma/LZMAEncoder.java#L123-L154 | test | Get the dist slot. | Of course, here is the Java code you requested:
```java
public static int getDistSlot(int dist) {
if (dist <= DIST_MODEL_START && dist >= 0)
return dist;
int n = dist;
int i = 31;
if ((n & 0xFFFF0000) == 0) {
n <<= 16;
i = 15;
}
if ... |
ibm-bluemix-mobile-services/bms-clientsdk-android-analytics | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/analytics/internal/inappfeedback/SendAppFeedback.java | SendAppFeedback.sendLogsToServer | protected static void sendLogsToServer(boolean setSentTime){
long timeSent = new Date().getTime();
String appFeedBackSummary = Utility.convertFileToString("AppFeedBackSummary.json");
if ( "".equals(appFeedBackSummary) || "{}".equals(appFeedBackSummary) ) {
return;
}else{
... | java | protected static void sendLogsToServer(boolean setSentTime){
long timeSent = new Date().getTime();
String appFeedBackSummary = Utility.convertFileToString("AppFeedBackSummary.json");
if ( "".equals(appFeedBackSummary) || "{}".equals(appFeedBackSummary) ) {
return;
}else{
... | [
"protected",
"static",
"void",
"sendLogsToServer",
"(",
"boolean",
"setSentTime",
")",
"{",
"long",
"timeSent",
"=",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
";",
"String",
"appFeedBackSummary",
"=",
"Utility",
".",
"convertFileToString",
"(",
"\"App... | Send Logs to Server | [
"Send",
"Logs",
"to",
"Server"
] | 40f1256e3c970fd008dd69c316493f609b89ec24 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-analytics/blob/40f1256e3c970fd008dd69c316493f609b89ec24/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/analytics/internal/inappfeedback/SendAppFeedback.java#L24-L63 | test | Send logs to server. | Of course, here is the Java code you requested:
```java
protected static void sendLogsToServer(boolean setSentTime){
long timeSent = new Date().getTime();
String appFeedBackSummary = Utility.convertFileToString("AppFeedBackSummary.json");
if ( "".equals(appFeedBackSummary) || "{}".equals(appFee... |
ReactiveX/RxJava | src/main/java/io/reactivex/Single.java | Single.delaySubscription | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Single<T> delaySubscription(long time, TimeUnit unit) {
return delaySubscription(time, unit, Schedulers.computation());
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Single<T> delaySubscription(long time, TimeUnit unit) {
return delaySubscription(time, unit, Schedulers.computation());
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"COMPUTATION",
")",
"public",
"final",
"Single",
"<",
"T",
">",
"delaySubscription",
"(",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"{",
"return",
"delaySubscription",
"(",
"time... | Delays the actual subscription to the current Single until the given time delay elapsed.
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code delaySubscription} does by default subscribe to the current Single
on the {@code computation} {@link Scheduler} after the delay.</dd>
</dl>
@param time the time amount to wait with the sub... | [
"Delays",
"the",
"actual",
"subscription",
"to",
"the",
"current",
"Single",
"until",
"the",
"given",
"time",
"delay",
"elapsed",
".",
"<dl",
">",
"<dt",
">",
"<b",
">",
"Scheduler",
":",
"<",
"/",
"b",
">",
"<",
"/",
"dt",
">",
"<dd",
">",
"{"
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L2333-L2337 | test | Delay the subscription of the result set to a single element. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Single<T> delaySubscription(long time, TimeUnit unit) {
return delaySubscription(time, unit, Schedulers.computation());
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Bewertung.java | Bewertung.getFeld | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Bewertung.Feld> getFeld() {
if (feld == null) {
feld = new ArrayList<Bewertung.Feld>();
}
return this.feld;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Bewertung.Feld> getFeld() {
if (feld == null) {
feld = new ArrayList<Bewertung.Feld>();
}
return this.feld;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:54:50+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"List",
"<",
"Bewertung",
".",
"Feld",
">",
"getFeld",
"(",
")",
"{",
"if",
"(",
... | Gets the value of the feld property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the feld property.
<p>
For example, to add a new i... | [
"Gets",
"the",
"value",
"of",
"the",
"feld",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Bewertung.java#L66-L72 | test | Gets the value of the feld property. | Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Bewertung.Feld> getFeld() {
if (feld == null) {
feld = new ArrayList<Bewertung.Feld>();
}
return t... |
wildfly/wildfly | webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java | AbstractSecurityMetaDataAccessorEJB.getEjbSecurityMetaData | private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) {
final String ejbName = endpoint.getShortName();
final Deployment dep = endpoint.getService().getDeployment();
final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class);
... | java | private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) {
final String ejbName = endpoint.getShortName();
final Deployment dep = endpoint.getService().getDeployment();
final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class);
... | [
"private",
"EJBSecurityMetaData",
"getEjbSecurityMetaData",
"(",
"final",
"Endpoint",
"endpoint",
")",
"{",
"final",
"String",
"ejbName",
"=",
"endpoint",
".",
"getShortName",
"(",
")",
";",
"final",
"Deployment",
"dep",
"=",
"endpoint",
".",
"getService",
"(",
... | Gets EJB security meta data if associated with EJB endpoint.
@param endpoint EJB webservice endpoint
@return EJB security meta data or null | [
"Gets",
"EJB",
"security",
"meta",
"data",
"if",
"associated",
"with",
"EJB",
"endpoint",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java#L153-L160 | test | Gets the EJBSecurityMetaData for the given endpoint. | Of course, here is the Java code you requested:
```java
private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) {
final String ejbName = endpoint.getShortName();
final Deployment dep = endpoint.getService().getDeployment();
final EJBArchiveMetaData ejbArchiveMD = WSHelper.ge... |
ReactiveX/RxJava | src/main/java/io/reactivex/Single.java | Single.fromFuture | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Single<T> fromFuture(Future<? extends T> future, long timeout, TimeUnit unit) {
return toSingle(Flowable.<T>fromFuture(future, timeout, unit));
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Single<T> fromFuture(Future<? extends T> future, long timeout, TimeUnit unit) {
return toSingle(Flowable.<T>fromFuture(future, timeout, unit));
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
">",
"Single",
"<",
"T",
">",
"fromFuture",
"(",
"Future",
"<",
"?",
"extends",
"T",
">",
"future",
",",
"long",
"timeout",
",",
"T... | Converts a {@link Future} into a {@code Single}, with a timeout on the Future.
<p>
<img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.from.Future.png" alt="">
<p>
You can convert any object that supports the {@link Future} interface into a {@code Single} that emit... | [
"Converts",
"a",
"{",
"@link",
"Future",
"}",
"into",
"a",
"{",
"@code",
"Single",
"}",
"with",
"a",
"timeout",
"on",
"the",
"Future",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"315",
"src",
"=",
"https",
":",
"//",
"raw",
".",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L681-L685 | test | Create a new instance of a CID from a future. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Single<T> fromFuture(Future<? extends T> future, long timeout, TimeUnit unit) {
return toSingle(Flowable.<T>fromFuture(future, timeout, unit));
}
```
Hope this helps... |
jsevellec/cassandra-unit | cassandra-unit/src/main/java/org/cassandraunit/utils/EmbeddedCassandraServerHelper.java | EmbeddedCassandraServerHelper.startEmbeddedCassandra | public static void startEmbeddedCassandra(File file, String tmpDir, long timeout) throws IOException, ConfigurationException {
if (cassandraDaemon != null) {
/* nothing to do Cassandra is already started */
return;
}
checkConfigNameForRestart(file.getAbsolutePath());
... | java | public static void startEmbeddedCassandra(File file, String tmpDir, long timeout) throws IOException, ConfigurationException {
if (cassandraDaemon != null) {
/* nothing to do Cassandra is already started */
return;
}
checkConfigNameForRestart(file.getAbsolutePath());
... | [
"public",
"static",
"void",
"startEmbeddedCassandra",
"(",
"File",
"file",
",",
"String",
"tmpDir",
",",
"long",
"timeout",
")",
"throws",
"IOException",
",",
"ConfigurationException",
"{",
"if",
"(",
"cassandraDaemon",
"!=",
"null",
")",
"{",
"/* nothing to do Ca... | Set embedded cassandra up and spawn it in a new thread.
@throws TTransportException
@throws IOException
@throws ConfigurationException | [
"Set",
"embedded",
"cassandra",
"up",
"and",
"spawn",
"it",
"in",
"a",
"new",
"thread",
"."
] | 546ef0da4510835b77cb18770209fb0f4568dc14 | https://github.com/jsevellec/cassandra-unit/blob/546ef0da4510835b77cb18770209fb0f4568dc14/cassandra-unit/src/main/java/org/cassandraunit/utils/EmbeddedCassandraServerHelper.java#L121-L168 | test | Start the embedded Cassandra daemon. | Of course, here is the Java code you requested:
```java
public static void startEmbeddedCassandra(File file, String tmpDir, long timeout) throws IOException, ConfigurationException {
if (cassandraDaemon != null) {
/* nothing to do Cassandra is already started */
return;
}
... |
rupertlssmith/lojix | base/base/src/main/com/thesett/util/log4j/SilentFailSocketAppender.java | SilentFailSocketAppender.cleanUp | public void cleanUp()
{
if (oos != null)
{
try
{
oos.close();
}
catch (IOException e)
{
LogLog.error("Could not close oos.", e);
}
oos = null;
}
if (connector != null... | java | public void cleanUp()
{
if (oos != null)
{
try
{
oos.close();
}
catch (IOException e)
{
LogLog.error("Could not close oos.", e);
}
oos = null;
}
if (connector != null... | [
"public",
"void",
"cleanUp",
"(",
")",
"{",
"if",
"(",
"oos",
"!=",
"null",
")",
"{",
"try",
"{",
"oos",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"LogLog",
".",
"error",
"(",
"\"Could not close oos.\"",
",",
"e"... | Drop the connection to the remote host and release the underlying connector thread if it has been created. | [
"Drop",
"the",
"connection",
"to",
"the",
"remote",
"host",
"and",
"release",
"the",
"underlying",
"connector",
"thread",
"if",
"it",
"has",
"been",
"created",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/base/src/main/com/thesett/util/log4j/SilentFailSocketAppender.java#L140-L162 | test | Clean up the base code. | Of course, here is the Java code you requested:
```java
public void cleanUp()
{
if (oos != null)
{
try
{
oos.close();
}
catch (IOException e)
{
LogLog.error("Could not close oos.", e);
}
... |
ReactiveX/RxJava | src/main/java/io/reactivex/Completable.java | Completable.doOnComplete | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnComplete(Action onComplete) {
return doOnLifecycle(Functions.emptyConsumer(), Functions.emptyConsumer(),
onComplete, Functions.EMPTY_ACTION,
Functions.EMPTY_ACTION, Functions.EMPTY_ACT... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnComplete(Action onComplete) {
return doOnLifecycle(Functions.emptyConsumer(), Functions.emptyConsumer(),
onComplete, Functions.EMPTY_ACTION,
Functions.EMPTY_ACTION, Functions.EMPTY_ACT... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Completable",
"doOnComplete",
"(",
"Action",
"onComplete",
")",
"{",
"return",
"doOnLifecycle",
"(",
"Functions",
".",
"emptyConsumer",
"(",
")",
",",
... | Returns a Completable which calls the given onComplete callback if this Completable completes.
<p>
<img width="640" height="304" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.doOnComplete.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code doOnComplete} does not operate by defaul... | [
"Returns",
"a",
"Completable",
"which",
"calls",
"the",
"given",
"onComplete",
"callback",
"if",
"this",
"Completable",
"completes",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"304",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L1496-L1502 | test | A convenience method for doing a single action on the generated code. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnComplete(Action onComplete) {
return doOnLifecycle(Functions.emptyConsumer(), Functions.emptyConsumer(),
onComplete, Functions.EMPTY_ACTION,
... |
oaqa/baseqa | src/main/java/edu/cmu/lti/oaqa/type/retrieval/Search.java | Search.setSearchId | public void setSearchId(String v) {
if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_searchId == null)
jcasType.jcas.throwFeatMissing("searchId", "edu.cmu.lti.oaqa.type.retrieval.Search");
jcasType.ll_cas.ll_setStringValue(addr, ((Search_Type)jcasType).casFeatCode_searchId, v);} | java | public void setSearchId(String v) {
if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_searchId == null)
jcasType.jcas.throwFeatMissing("searchId", "edu.cmu.lti.oaqa.type.retrieval.Search");
jcasType.ll_cas.ll_setStringValue(addr, ((Search_Type)jcasType).casFeatCode_searchId, v);} | [
"public",
"void",
"setSearchId",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"Search_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Search_Type",
")",
"jcasType",
")",
".",
"casFeat_searchId",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(... | setter for searchId - sets An identifier for this search result. Used to collect hit-list objects that belong to this search result after they've been split out for parallel processing then gathered up again.
@generated
@param v value to set into the feature | [
"setter",
"for",
"searchId",
"-",
"sets",
"An",
"identifier",
"for",
"this",
"search",
"result",
".",
"Used",
"to",
"collect",
"hit",
"-",
"list",
"objects",
"that",
"belong",
"to",
"this",
"search",
"result",
"after",
"they",
"ve",
"been",
"split",
"out",... | 6ea632d8e51e3e617d4876fc1185c49be0ad7eb8 | https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/retrieval/Search.java#L172-L175 | test | setter for searchId - sets | Of course, here is the Java code you requested:
```java
public void setSearchId(String v) {
if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_searchId == null)
jcasType.jcas.throwFeatMissing("searchId", "edu.cmu.lti.oaqa.type.retrieval.Search");
jcasType.ll_cas.ll_setStringValue(addr, ((Search... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java | SwitchUserFilter.getSourceAuthentication | private Authentication getSourceAuthentication(Authentication current) {
Authentication original = null;
// iterate over granted authorities and find the 'switch user' authority
Collection<? extends GrantedAuthority> authorities = current.getAuthorities();
for (GrantedAuthority auth : authorities) {
// che... | java | private Authentication getSourceAuthentication(Authentication current) {
Authentication original = null;
// iterate over granted authorities and find the 'switch user' authority
Collection<? extends GrantedAuthority> authorities = current.getAuthorities();
for (GrantedAuthority auth : authorities) {
// che... | [
"private",
"Authentication",
"getSourceAuthentication",
"(",
"Authentication",
"current",
")",
"{",
"Authentication",
"original",
"=",
"null",
";",
"// iterate over granted authorities and find the 'switch user' authority",
"Collection",
"<",
"?",
"extends",
"GrantedAuthority",
... | Find the original <code>Authentication</code> object from the current user's
granted authorities. A successfully switched user should have a
<code>SwitchUserGrantedAuthority</code> that contains the original source user
<code>Authentication</code> object.
@param current The current <code>Authentication</code> object
... | [
"Find",
"the",
"original",
"<code",
">",
"Authentication<",
"/",
"code",
">",
"object",
"from",
"the",
"current",
"user",
"s",
"granted",
"authorities",
".",
"A",
"successfully",
"switched",
"user",
"should",
"have",
"a",
"<code",
">",
"SwitchUserGrantedAuthorit... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java#L366-L382 | test | Get the original Authentication for the current Authentication | Of course, here is the Java code you requested:
```java
private Authentication getSourceAuthentication(Authentication current) {
Authentication original = null;
// iterate over granted authorities and find the 'switch user' authority
Collection<? extends GrantedAuthority> authorities = current.getAuthorities();... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java | DSLTree.printTree | public void printTree() {
System.out.println("ROOT");
for (Node n : rootCond.getChildren()) {
printNode(n);
}
} | java | public void printTree() {
System.out.println("ROOT");
for (Node n : rootCond.getChildren()) {
printNode(n);
}
} | [
"public",
"void",
"printTree",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"ROOT\"",
")",
";",
"for",
"(",
"Node",
"n",
":",
"rootCond",
".",
"getChildren",
"(",
")",
")",
"{",
"printNode",
"(",
"n",
")",
";",
"}",
"}"
] | The method will print the DSLTree to System.out in text format. | [
"The",
"method",
"will",
"print",
"the",
"DSLTree",
"to",
"System",
".",
"out",
"in",
"text",
"format",
"."
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java#L491-L496 | test | Prints the tree of the root condition. | Of course, here is the Java code you requested:
```java
public void printTree() {
System.out.println("ROOT");
for (Node n : rootCond.getChildren()) {
printNode(n);
}
}
```
Hope this helps! |
kiegroup/droolsjbpm-tools | drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/server/ServerProxy.java | ServerProxy.restart | @Override
public void restart(String launchMode, IProgressMonitor monitor) {
// TODO Auto-generated method stub
server.restart(launchMode, monitor);
} | java | @Override
public void restart(String launchMode, IProgressMonitor monitor) {
// TODO Auto-generated method stub
server.restart(launchMode, monitor);
} | [
"@",
"Override",
"public",
"void",
"restart",
"(",
"String",
"launchMode",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"// TODO Auto-generated method stub",
"server",
".",
"restart",
"(",
"launchMode",
",",
"monitor",
")",
";",
"}"
] | /* (non-Javadoc)
@see org.eclipse.wst.server.core.IServer#restart(java.lang.String, org.eclipse.core.runtime.IProgressMonitor) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/server/ServerProxy.java#L424-L428 | test | Restart the service. | Of course, here is the Java code you requested:
```java
@Override
public void restart(String launchMode, IProgressMonitor monitor) {
// TODO Auto-generated method stub
server.restart(launchMode, monitor);
}
```
Hope this helps! |
wro4j/wro4j | wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/coffeescript/CoffeeScript.java | CoffeeScript.compile | public String compile(final String data) {
final RhinoScriptBuilder builder = initScriptBuilder();
final String compileScript = String.format("CoffeeScript.compile(%s, %s);", WroUtil.toJSMultiLineString(data),
buildOptions());
return (String) builder.evaluate(compileScript, "CoffeeScript.compile... | java | public String compile(final String data) {
final RhinoScriptBuilder builder = initScriptBuilder();
final String compileScript = String.format("CoffeeScript.compile(%s, %s);", WroUtil.toJSMultiLineString(data),
buildOptions());
return (String) builder.evaluate(compileScript, "CoffeeScript.compile... | [
"public",
"String",
"compile",
"(",
"final",
"String",
"data",
")",
"{",
"final",
"RhinoScriptBuilder",
"builder",
"=",
"initScriptBuilder",
"(",
")",
";",
"final",
"String",
"compileScript",
"=",
"String",
".",
"format",
"(",
"\"CoffeeScript.compile(%s, %s);\"",
... | Validates a js using jsHint and throws {@link LinterException} if the js is invalid. If no exception is thrown, the
js is valid.
@param data
js content to process. | [
"Validates",
"a",
"js",
"using",
"jsHint",
"and",
"throws",
"{",
"@link",
"LinterException",
"}",
"if",
"the",
"js",
"is",
"invalid",
".",
"If",
"no",
"exception",
"is",
"thrown",
"the",
"js",
"is",
"valid",
"."
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/coffeescript/CoffeeScript.java#L83-L88 | test | Compiles a single SEQ string. | Of course, here is the Java code you requested:
```java
public String compile(final String data) {
final RhinoScriptBuilder builder = initScriptBuilder();
final String compileScript = String.format("CoffeeScript.compile(%s, %s);", WroUtil.toJSMultiLineString(data),
buildOptions());
return (Stri... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/proxetta/ProxyTargetReplacement.java | ProxyTargetReplacement.info | public static void info(final MethodVisitor mv, final MethodInfo methodInfo, final int argsOff) {
mv.visitTypeInsn(Opcodes.NEW, PROXY_TARGET_INFO);
mv.visitInsn(DUP);
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, PROXY_TARGET_INFO, "<init>", "()V", false);
// int argsOff = methodInfo.getAllArgumentsSize();
// args... | java | public static void info(final MethodVisitor mv, final MethodInfo methodInfo, final int argsOff) {
mv.visitTypeInsn(Opcodes.NEW, PROXY_TARGET_INFO);
mv.visitInsn(DUP);
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, PROXY_TARGET_INFO, "<init>", "()V", false);
// int argsOff = methodInfo.getAllArgumentsSize();
// args... | [
"public",
"static",
"void",
"info",
"(",
"final",
"MethodVisitor",
"mv",
",",
"final",
"MethodInfo",
"methodInfo",
",",
"final",
"int",
"argsOff",
")",
"{",
"mv",
".",
"visitTypeInsn",
"(",
"Opcodes",
".",
"NEW",
",",
"PROXY_TARGET_INFO",
")",
";",
"mv",
"... | Visits replacement code for {@link ProxyTarget#info()}. | [
"Visits",
"replacement",
"code",
"for",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/ProxyTargetReplacement.java#L149-L201 | test | Generates the instruction for the creation of the proxy. | Of course, here is the Java code you requested:
```java
public static void info(final MethodVisitor mv, final MethodInfo methodInfo, final int argsOff) {
mv.visitTypeInsn(Opcodes.NEW, PROXY_TARGET_INFO);
mv.visitInsn(DUP);
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, PROXY_TARGET_INFO, "<init>", "()V", false);
// ... |
oblac/jodd | jodd-db/src/main/java/jodd/db/oom/DbOomQuery.java | DbOomQuery.prepareQuery | @Override
protected void prepareQuery() {
super.prepareQuery();
if (sqlgen == null) {
return;
}
if (hints == null) {
String[] joinHints = sqlgen.getJoinHints();
if (joinHints != null) {
withHints(joinHints);
}
}
// insert parameters
Map<String, ParameterValue> parameters = sqlgen.getQuery... | java | @Override
protected void prepareQuery() {
super.prepareQuery();
if (sqlgen == null) {
return;
}
if (hints == null) {
String[] joinHints = sqlgen.getJoinHints();
if (joinHints != null) {
withHints(joinHints);
}
}
// insert parameters
Map<String, ParameterValue> parameters = sqlgen.getQuery... | [
"@",
"Override",
"protected",
"void",
"prepareQuery",
"(",
")",
"{",
"super",
".",
"prepareQuery",
"(",
")",
";",
"if",
"(",
"sqlgen",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"hints",
"==",
"null",
")",
"{",
"String",
"[",
"]",
"join... | Prepares the query after initialization. Besides default work, it checks if sql generator
is used, and if so, generator hints and query parameters will be used for this query.
Note regarding hints: since hints can be added manually, generators hints will be ignored
if there exists some manually set hints. | [
"Prepares",
"the",
"query",
"after",
"initialization",
".",
"Besides",
"default",
"work",
"it",
"checks",
"if",
"sql",
"generator",
"is",
"used",
"and",
"if",
"so",
"generator",
"hints",
"and",
"query",
"parameters",
"will",
"be",
"used",
"for",
"this",
"que... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/DbOomQuery.java#L144-L172 | test | Override prepareQuery to insert the SQL gen query parameters. | Of course, here is the Java code you requested:
```java
@Override
protected void prepareQuery() {
super.prepareQuery();
if (sqlgen == null) {
return;
}
if (hints == null) {
String[] joinHints = sqlgen.getJoinHints();
if (joinHints != null) {
withHints(joinHints);
}
}
// insert parameters
... |
Enterprise-Content-Management/infoarchive-sip-sdk | configuration/src/main/java/com/opentext/ia/configuration/ConfigurationObject.java | ConfigurationObject.setProperty | public void setProperty(String name, Object value) {
properties.put(name, toJsonValue(value));
} | java | public void setProperty(String name, Object value) {
properties.put(name, toJsonValue(value));
} | [
"public",
"void",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"properties",
".",
"put",
"(",
"name",
",",
"toJsonValue",
"(",
"value",
")",
")",
";",
"}"
] | Set the value of a property.
@param name The name of the property to set
@param value The value to set the property to | [
"Set",
"the",
"value",
"of",
"a",
"property",
"."
] | 3c84a4d9ce569139e9a442034526944d3e63436e | https://github.com/Enterprise-Content-Management/infoarchive-sip-sdk/blob/3c84a4d9ce569139e9a442034526944d3e63436e/configuration/src/main/java/com/opentext/ia/configuration/ConfigurationObject.java#L59-L61 | test | Sets a property. | Of course, here is the Java code you requested:
```java
public void setProperty(String name, Object value) {
properties.put(name, toJsonValue(value));
}
```
Hope this helps! |
1gravity/Android-RTEditor | RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/HTMLWriter.java | HTMLWriter.forceNSDecls | private void forceNSDecls() {
Enumeration<String> prefixes = forcedDeclTable.keys();
while (prefixes.hasMoreElements()) {
String prefix = (String) prefixes.nextElement();
doPrefix(prefix, null, true);
}
} | java | private void forceNSDecls() {
Enumeration<String> prefixes = forcedDeclTable.keys();
while (prefixes.hasMoreElements()) {
String prefix = (String) prefixes.nextElement();
doPrefix(prefix, null, true);
}
} | [
"private",
"void",
"forceNSDecls",
"(",
")",
"{",
"Enumeration",
"<",
"String",
">",
"prefixes",
"=",
"forcedDeclTable",
".",
"keys",
"(",
")",
";",
"while",
"(",
"prefixes",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"String",
"prefix",
"=",
"(",
"Stri... | Force all Namespaces to be declared.
<p>
This method is used on the root element to ensure that the predeclared
Namespaces all appear. | [
"Force",
"all",
"Namespaces",
"to",
"be",
"declared",
".",
"<p",
">",
"This",
"method",
"is",
"used",
"on",
"the",
"root",
"element",
"to",
"ensure",
"that",
"the",
"predeclared",
"Namespaces",
"all",
"appear",
"."
] | 9d8fb4bb865b3b3d011e7633afedcdfb8d21754f | https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/HTMLWriter.java#L779-L785 | test | Force namespace declarations. | Of course, here is the Java code you requested:
```java
private void forceNSDecls() {
Enumeration<String> prefixes = forcedDeclTable.keys();
while (prefixes.hasMoreElements()) {
String prefix = (String) prefixes.nextElement();
doPrefix(prefix, null, true);
}
}
```
H... |
RestComm/jain-slee | container/components/components/src/main/java/org/mobicents/slee/container/component/security/PolicyFileImpl.java | PolicyFileImpl.getCodeSources | public String getCodeSources() {
List<String> css = new ArrayList<String>();
for (PolicyHolderEntry phe : this.currentPolicy.get().policyHolderEntries) {
css.add(phe.getCodeSource().getLocation() == null ? "default" : phe.getCodeSource().getLocation().toString());
}
return Arrays.toString(css.toArray());
... | java | public String getCodeSources() {
List<String> css = new ArrayList<String>();
for (PolicyHolderEntry phe : this.currentPolicy.get().policyHolderEntries) {
css.add(phe.getCodeSource().getLocation() == null ? "default" : phe.getCodeSource().getLocation().toString());
}
return Arrays.toString(css.toArray());
... | [
"public",
"String",
"getCodeSources",
"(",
")",
"{",
"List",
"<",
"String",
">",
"css",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"PolicyHolderEntry",
"phe",
":",
"this",
".",
"currentPolicy",
".",
"get",
"(",
")",
".",
... | Some methods to expose info about what is goign on. | [
"Some",
"methods",
"to",
"expose",
"info",
"about",
"what",
"is",
"goign",
"on",
"."
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/security/PolicyFileImpl.java#L883-L891 | test | Get the code sources for the current policy. | Of course, here is the Java code you requested:
```java
public String getCodeSources() {
List<String> css = new ArrayList<String>();
for (PolicyHolderEntry phe : this.currentPolicy.get().policyHolderEntries) {
css.add(phe.getCodeSource().getLocation() == null ? "default" : phe.getCodeSource().getLocation().toS... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/NetcdfFile.java | NetcdfFile.empty | public void empty() {
if (immutable) throw new IllegalStateException("Cant modify");
variables = new ArrayList<>();
gattributes = new ArrayList<>();
dimensions = new ArrayList<>();
rootGroup = makeRootGroup();
// addedRecordStructure = false;
} | java | public void empty() {
if (immutable) throw new IllegalStateException("Cant modify");
variables = new ArrayList<>();
gattributes = new ArrayList<>();
dimensions = new ArrayList<>();
rootGroup = makeRootGroup();
// addedRecordStructure = false;
} | [
"public",
"void",
"empty",
"(",
")",
"{",
"if",
"(",
"immutable",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cant modify\"",
")",
";",
"variables",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"gattributes",
"=",
"new",
"ArrayList",
"<>",
"(",
... | Completely empty the objects in the netcdf file.
Used for rereading the file on a sync(). | [
"Completely",
"empty",
"the",
"objects",
"in",
"the",
"netcdf",
"file",
".",
"Used",
"for",
"rereading",
"the",
"file",
"on",
"a",
"sync",
"()",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L1994-L2001 | test | Empty the structure. | Of course, here is the Java code you requested:
```java
public void empty() {
if (immutable) throw new IllegalStateException("Cant modify");
variables = new ArrayList<>();
gattributes = new ArrayList<>();
dimensions = new ArrayList<>();
rootGroup = makeRootGroup();
// addedRecordStructure = fal... |
wildfly/wildfly | naming/src/main/java/org/jboss/as/naming/deployment/JndiName.java | JndiName.of | public static JndiName of(final String name) {
if(name == null || name.isEmpty()) throw NamingLogger.ROOT_LOGGER.invalidJndiName(name);
final String[] parts = name.split(ENTRY_SEPARATOR);
JndiName current = null;
for(String part : parts) {
current = new JndiName(current, part... | java | public static JndiName of(final String name) {
if(name == null || name.isEmpty()) throw NamingLogger.ROOT_LOGGER.invalidJndiName(name);
final String[] parts = name.split(ENTRY_SEPARATOR);
JndiName current = null;
for(String part : parts) {
current = new JndiName(current, part... | [
"public",
"static",
"JndiName",
"of",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"isEmpty",
"(",
")",
")",
"throw",
"NamingLogger",
".",
"ROOT_LOGGER",
".",
"invalidJndiName",
"(",
"name",
")",
";",
"f... | Create a new instance of the JndiName by breaking the provided string format into a JndiName parts.
@param name The string representation of a JNDI name.
@return The JndiName representation | [
"Create",
"a",
"new",
"instance",
"of",
"the",
"JndiName",
"by",
"breaking",
"the",
"provided",
"string",
"format",
"into",
"a",
"JndiName",
"parts",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/deployment/JndiName.java#L94-L102 | test | Create a new instance from a string. | Of course, here is the Java code you requested:
```java
public static JndiName of(final String name) {
if(name == null || name.isEmpty()) throw NamingLogger.ROOT_LOGGER.invalidJndiName(name);
final String[] parts = name.split(ENTRY_SEPARATOR);
JndiName current = null;
for(String part : ... |
kocakosm/pitaya | src/org/kocakosm/pitaya/util/Classes.java | Classes.getCommonSuperTypes | public static Set<Class<?>> getCommonSuperTypes(Iterable<Class<?>> classes)
{
Iterator<Class<?>> i = classes.iterator();
Parameters.checkCondition(i.hasNext());
Set<Class<?>> common = new HashSet<Class<?>>(getSuperTypes(i.next()));
while (i.hasNext()) {
common.retainAll(getSuperTypes(i.next()));
}
retur... | java | public static Set<Class<?>> getCommonSuperTypes(Iterable<Class<?>> classes)
{
Iterator<Class<?>> i = classes.iterator();
Parameters.checkCondition(i.hasNext());
Set<Class<?>> common = new HashSet<Class<?>>(getSuperTypes(i.next()));
while (i.hasNext()) {
common.retainAll(getSuperTypes(i.next()));
}
retur... | [
"public",
"static",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"getCommonSuperTypes",
"(",
"Iterable",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
")",
"{",
"Iterator",
"<",
"Class",
"<",
"?",
">",
">",
"i",
"=",
"classes",
".",
"iterator",
"(",
")"... | Returns the {@code Set} of common super types of the given classes,
that is, all the classes in which any instance of the given classes
can be cast into.
@param classes the classes.
@return the common super types of the given classes.
@throws NullPointerException if {@code classes} is {@code null}, or
if it contains... | [
"Returns",
"the",
"{",
"@code",
"Set",
"}",
"of",
"common",
"super",
"types",
"of",
"the",
"given",
"classes",
"that",
"is",
"all",
"the",
"classes",
"in",
"which",
"any",
"instance",
"of",
"the",
"given",
"classes",
"can",
"be",
"cast",
"into",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/Classes.java#L151-L160 | test | Get the common super types of the given classes. | Of course, here is the Java code you requested:
```java
public static Set<Class<?>> getCommonSuperTypes(Iterable<Class<?>> classes)
{
Iterator<Class<?>> i = classes.iterator();
Parameters.checkCondition(i.hasNext());
Set<Class<?>> common = new HashSet<Class<?>>(getSuperTypes(i.next()));
while (i.hasNext()) {
... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.depthWiseConv2d | public SDVariable depthWiseConv2d(SDVariable[] inputs, Conv2DConfig depthConv2DConfig) {
return depthWiseConv2d(null, inputs, depthConv2DConfig);
} | java | public SDVariable depthWiseConv2d(SDVariable[] inputs, Conv2DConfig depthConv2DConfig) {
return depthWiseConv2d(null, inputs, depthConv2DConfig);
} | [
"public",
"SDVariable",
"depthWiseConv2d",
"(",
"SDVariable",
"[",
"]",
"inputs",
",",
"Conv2DConfig",
"depthConv2DConfig",
")",
"{",
"return",
"depthWiseConv2d",
"(",
"null",
",",
"inputs",
",",
"depthConv2DConfig",
")",
";",
"}"
] | Depth-wise Conv2d operation.
@param inputs the inputs to conv2d
@param depthConv2DConfig the configuration
@return | [
"Depth",
"-",
"wise",
"Conv2d",
"operation",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L1851-L1853 | test | Depth - Wise Conv2D operation. | Of course, here is the Java code you requested:
```java
public SDVariable depthWiseConv2d(SDVariable[] inputs, Conv2DConfig depthConv2DConfig) {
return depthWiseConv2d(null, inputs, depthConv2DConfig);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/time/CalendarPeriod.java | CalendarPeriod.subtract | public int subtract(CalendarDate start, CalendarDate end) {
long diff = end.getDifferenceInMsecs(start);
int thislen = millisecs();
if ((diff % thislen != 0))
log.warn("roundoff error");
return (int) (diff / thislen);
} | java | public int subtract(CalendarDate start, CalendarDate end) {
long diff = end.getDifferenceInMsecs(start);
int thislen = millisecs();
if ((diff % thislen != 0))
log.warn("roundoff error");
return (int) (diff / thislen);
} | [
"public",
"int",
"subtract",
"(",
"CalendarDate",
"start",
",",
"CalendarDate",
"end",
")",
"{",
"long",
"diff",
"=",
"end",
".",
"getDifferenceInMsecs",
"(",
"start",
")",
";",
"int",
"thislen",
"=",
"millisecs",
"(",
")",
";",
"if",
"(",
"(",
"diff",
... | Subtract two dates, return difference in units of this period.
If not even, will round down and log a warning
@param start start date
@param end end date
@return difference in units of this period | [
"Subtract",
"two",
"dates",
"return",
"difference",
"in",
"units",
"of",
"this",
"period",
".",
"If",
"not",
"even",
"will",
"round",
"down",
"and",
"log",
"a",
"warning"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/time/CalendarPeriod.java#L169-L175 | test | Subtracts the specified calendar date from this calendar date. | Of course, here is the Java code you requested:
```java
public int subtract(CalendarDate start, CalendarDate end) {
long diff = end.getDifferenceInMsecs(start);
int thislen = millisecs();
if ((diff % thislen != 0))
log.warn("roundoff error");
return (int) (diff / thislen);
}
```
Hope thi... |
phax/ph-math | ph-math/src/main/java/com/helger/numbercruncher/matrix/LinearSystem.java | LinearSystem.solve | public ColumnVector solve (final ColumnVector b, final boolean improve) throws MatrixException
{
// Validate b's size.
if (b.m_nRows != m_nRows)
{
throw new MatrixException (MatrixException.INVALID_DIMENSIONS);
}
decompose ();
// Solve Ly = b for y by forward substitution.
// Solve... | java | public ColumnVector solve (final ColumnVector b, final boolean improve) throws MatrixException
{
// Validate b's size.
if (b.m_nRows != m_nRows)
{
throw new MatrixException (MatrixException.INVALID_DIMENSIONS);
}
decompose ();
// Solve Ly = b for y by forward substitution.
// Solve... | [
"public",
"ColumnVector",
"solve",
"(",
"final",
"ColumnVector",
"b",
",",
"final",
"boolean",
"improve",
")",
"throws",
"MatrixException",
"{",
"// Validate b's size.",
"if",
"(",
"b",
".",
"m_nRows",
"!=",
"m_nRows",
")",
"{",
"throw",
"new",
"MatrixException"... | Solve Ax = b for x using the Gaussian elimination algorithm.
@param b
the right-hand-side column vector
@param improve
true to improve the solution
@return the solution column vector
@throws MatrixException
if an error occurred | [
"Solve",
"Ax",
"=",
"b",
"for",
"x",
"using",
"the",
"Gaussian",
"elimination",
"algorithm",
"."
] | 9f998870c7e05226e032b1f38c23e7d45ec0169d | https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/matrix/LinearSystem.java#L165-L184 | test | Solve b using the C - Solve algorithm. | Of course, here is the Java code you requested:
```java
public ColumnVector solve (final ColumnVector b, final boolean improve) throws MatrixException
{
// Validate b's size.
if (b.m_nRows != m_nRows)
{
throw new MatrixException (MatrixException.INVALID_DIMENSIONS);
}
decompose ();
//... |
PeterisP/morphology | src/main/java/lv/semti/morphology/corpus/Statistics.java | Statistics.addLexeme | public void addLexeme(int lexemeId) {
int count = 1;
if (lexemeFrequency.get(lexemeId) != null)
count = lexemeFrequency.get(lexemeId) + 1;
lexemeFrequency.put(lexemeId, count);
} | java | public void addLexeme(int lexemeId) {
int count = 1;
if (lexemeFrequency.get(lexemeId) != null)
count = lexemeFrequency.get(lexemeId) + 1;
lexemeFrequency.put(lexemeId, count);
} | [
"public",
"void",
"addLexeme",
"(",
"int",
"lexemeId",
")",
"{",
"int",
"count",
"=",
"1",
";",
"if",
"(",
"lexemeFrequency",
".",
"get",
"(",
"lexemeId",
")",
"!=",
"null",
")",
"count",
"=",
"lexemeFrequency",
".",
"get",
"(",
"lexemeId",
")",
"+",
... | Add one occurrence of one lexeme.
@param lexemeId lexeme identifier. | [
"Add",
"one",
"occurrence",
"of",
"one",
"lexeme",
"."
] | a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783 | https://github.com/PeterisP/morphology/blob/a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783/src/main/java/lv/semti/morphology/corpus/Statistics.java#L64-L69 | test | Add a lexeme to the list of lexeme ids. | Of course, here is the Java code you requested:
```java
public void addLexeme(int lexemeId) {
int count = 1;
if (lexemeFrequency.get(lexemeId) != null)
count = lexemeFrequency.get(lexemeId) + 1;
lexemeFrequency.put(lexemeId, count);
}
```
Hope this helps! |
real-logic/aeron | aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java | ChannelUriStringBuilder.media | public ChannelUriStringBuilder media(final String media)
{
switch (media)
{
case CommonContext.UDP_MEDIA:
case CommonContext.IPC_MEDIA:
break;
default:
throw new IllegalArgumentException("invalid media: " + media);
}
... | java | public ChannelUriStringBuilder media(final String media)
{
switch (media)
{
case CommonContext.UDP_MEDIA:
case CommonContext.IPC_MEDIA:
break;
default:
throw new IllegalArgumentException("invalid media: " + media);
}
... | [
"public",
"ChannelUriStringBuilder",
"media",
"(",
"final",
"String",
"media",
")",
"{",
"switch",
"(",
"media",
")",
"{",
"case",
"CommonContext",
".",
"UDP_MEDIA",
":",
"case",
"CommonContext",
".",
"IPC_MEDIA",
":",
"break",
";",
"default",
":",
"throw",
... | Set the media for this channel. Valid values are "udp" and "ipc".
@param media for this channel.
@return this for a fluent API. | [
"Set",
"the",
"media",
"for",
"this",
"channel",
".",
"Valid",
"values",
"are",
"udp",
"and",
"ipc",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java#L171-L185 | test | Sets the media attribute. | Of course, here is the Java code you requested:
```java
public ChannelUriStringBuilder media(final String media)
{
switch (media)
{
case CommonContext.UDP_MEDIA:
case CommonContext.IPC_MEDIA:
break;
default:
throw new IllegalArgum... |
markhobson/microbrowser | tck/src/main/java/org/hobsoft/microbrowser/tck/MicrodataItemTck.java | MicrodataItemTck.getIdReturnsId | @Test
public void getIdReturnsId() throws MalformedURLException
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://y' itemid='http://x'/>"
+ "</body></html>"));
URL actual = newBrowser().get(url(server()))
.getItem("http://y")
.getId();
... | java | @Test
public void getIdReturnsId() throws MalformedURLException
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://y' itemid='http://x'/>"
+ "</body></html>"));
URL actual = newBrowser().get(url(server()))
.getItem("http://y")
.getId();
... | [
"@",
"Test",
"public",
"void",
"getIdReturnsId",
"(",
")",
"throws",
"MalformedURLException",
"{",
"server",
"(",
")",
".",
"enqueue",
"(",
"new",
"MockResponse",
"(",
")",
".",
"setBody",
"(",
"\"<html><body>\"",
"+",
"\"<div itemscope='itemscope' itemtype='http://... | ---------------------------------------------------------------------------------------------------------------- | [
"----------------------------------------------------------------------------------------------------------------"
] | 732d2dadc1c3eaad688de31dc09f360df580faf1 | https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/tck/src/main/java/org/hobsoft/microbrowser/tck/MicrodataItemTck.java#L48-L60 | test | Test if a URL returns an id. | Of course, here is the Java code you requested:
```java
@Test
public void getIdReturnsId() throws MalformedURLException
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<div itemscope='itemscope' itemtype='http://y' itemid='http://x'/>"
+ "</body></html>"));
URL actual = newBrowser().get(... |
deeplearning4j/nd4j | nd4j-parameter-server-parent/nd4j-parameter-server-status/src/main/java/org/nd4j/parameterserver/status/play/StatusServer.java | StatusServer.startServer | public static Server startServer(StatusStorage statusStorage, int statusServerPort) {
log.info("Starting server on port " + statusServerPort);
RoutingDsl dsl = new RoutingDsl();
dsl.GET("/ids/").routeTo(new F.Function0<Result>() {
@Override
public Result apply() throws T... | java | public static Server startServer(StatusStorage statusStorage, int statusServerPort) {
log.info("Starting server on port " + statusServerPort);
RoutingDsl dsl = new RoutingDsl();
dsl.GET("/ids/").routeTo(new F.Function0<Result>() {
@Override
public Result apply() throws T... | [
"public",
"static",
"Server",
"startServer",
"(",
"StatusStorage",
"statusStorage",
",",
"int",
"statusServerPort",
")",
"{",
"log",
".",
"info",
"(",
"\"Starting server on port \"",
"+",
"statusServerPort",
")",
";",
"RoutingDsl",
"dsl",
"=",
"new",
"RoutingDsl",
... | Start a server based on the given subscriber.
Note that for the port to start the server on, you should
set the statusServerPortField on the subscriber
either manually or via command line. The
server defaults to port 9000.
The end points are:
/opType: returns the opType information (master/slave)
/started: if it's a m... | [
"Start",
"a",
"server",
"based",
"on",
"the",
"given",
"subscriber",
".",
"Note",
"that",
"for",
"the",
"port",
"to",
"start",
"the",
"server",
"on",
"you",
"should",
"set",
"the",
"statusServerPortField",
"on",
"the",
"subscriber",
"either",
"manually",
"or... | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-parameter-server-parent/nd4j-parameter-server-status/src/main/java/org/nd4j/parameterserver/status/play/StatusServer.java#L55-L124 | test | Start a server on the given port. | Of course, here is the Java code you requested:
```java
public static Server startServer(StatusStorage statusStorage, int statusServerPort) {
log.info("Starting server on port " + statusServerPort);
RoutingDsl dsl = new RoutingDsl();
dsl.GET("/ids/").routeTo(new F.Function0<Result>() {
... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/util/WroUtil.java | WroUtil.toPackageAsFolder | public static String toPackageAsFolder(final Class<?> clazz) {
Validate.notNull(clazz, "Class cannot be null!");
return clazz.getPackage().getName().replace('.', '/');
} | java | public static String toPackageAsFolder(final Class<?> clazz) {
Validate.notNull(clazz, "Class cannot be null!");
return clazz.getPackage().getName().replace('.', '/');
} | [
"public",
"static",
"String",
"toPackageAsFolder",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Validate",
".",
"notNull",
"(",
"clazz",
",",
"\"Class cannot be null!\"",
")",
";",
"return",
"clazz",
".",
"getPackage",
"(",
")",
".",
"getName",
... | Creates a folder like implementation for a class. Ex: com.mycompany.MyClass -> com/mycompany/
@param clazz
used as a base location for determining the package path.
@return a string representation of the path where the class resides. | [
"Creates",
"a",
"folder",
"like",
"implementation",
"for",
"a",
"class",
".",
"Ex",
":",
"com",
".",
"mycompany",
".",
"MyClass",
"-",
">",
"com",
"/",
"mycompany",
"/"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/util/WroUtil.java#L162-L165 | test | Converts a class to a folder name. | Of course, here is the Java code you requested:
```java
public static String toPackageAsFolder(final Class<?> clazz) {
Validate.notNull(clazz, "Class cannot be null!");
return clazz.getPackage().getName().replace('.', '/');
}
```
Hope this helps! |
turbomanage/storm-gen | storm-apt/api/src/main/java/com/turbomanage/storm/csv/CsvUtils.java | CsvUtils.getValues | public static List<String> getValues(String csvRow) {
List<String> values = new ArrayList<String>();
StringReader in = new StringReader(csvRow);
String value;
try {
value = nextValue(in);
while (true) {
values.add(value);
value = nextValue(in);
}
} catch (IOException e) {
// TODO handle ca... | java | public static List<String> getValues(String csvRow) {
List<String> values = new ArrayList<String>();
StringReader in = new StringReader(csvRow);
String value;
try {
value = nextValue(in);
while (true) {
values.add(value);
value = nextValue(in);
}
} catch (IOException e) {
// TODO handle ca... | [
"public",
"static",
"List",
"<",
"String",
">",
"getValues",
"(",
"String",
"csvRow",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"StringReader",
"in",
"=",
"new",
"StringReader",
"(",
"cs... | Returns values from a CSV String.
@param csvRow
@return | [
"Returns",
"values",
"from",
"a",
"CSV",
"String",
"."
] | 22caa69439548a074d035745215bce5aff55853d | https://github.com/turbomanage/storm-gen/blob/22caa69439548a074d035745215bce5aff55853d/storm-apt/api/src/main/java/com/turbomanage/storm/csv/CsvUtils.java#L102-L118 | test | Get the values from a CSV row. | Of course, here is the Java code you requested:
```java
public static List<String> getValues(String csvRow) {
List<String> values = new ArrayList<String>();
StringReader in = new StringReader(csvRow);
String value;
try {
value = nextValue(in);
while (true) {
values.add(value);
value = nextValue(i... |
kocakosm/pitaya | src/org/kocakosm/pitaya/util/Strings.java | Strings.countOccurrences | public static int countOccurrences(String str, String sub)
{
Parameters.checkNotNull(str);
int n = 0;
if (!sub.isEmpty()) {
int start = 0;
while (true) {
start = str.indexOf(sub, start);
if (start == -1) {
break;
}
start += sub.length();
n++;
}
}
return n;
} | java | public static int countOccurrences(String str, String sub)
{
Parameters.checkNotNull(str);
int n = 0;
if (!sub.isEmpty()) {
int start = 0;
while (true) {
start = str.indexOf(sub, start);
if (start == -1) {
break;
}
start += sub.length();
n++;
}
}
return n;
} | [
"public",
"static",
"int",
"countOccurrences",
"(",
"String",
"str",
",",
"String",
"sub",
")",
"{",
"Parameters",
".",
"checkNotNull",
"(",
"str",
")",
";",
"int",
"n",
"=",
"0",
";",
"if",
"(",
"!",
"sub",
".",
"isEmpty",
"(",
")",
")",
"{",
"int... | Counts the occurrences of the substring {@code sub} in {@code str}.
@param str {@code String} to search in.
@param sub {@code String} to search for.
@return the number of occurrences of {@code sub} in {@code str}.
@throws NullPointerException if one of the arguments is {@code null}. | [
"Counts",
"the",
"occurrences",
"of",
"the",
"substring",
"{",
"@code",
"sub",
"}",
"in",
"{",
"@code",
"str",
"}",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/Strings.java#L580-L596 | test | Count the number of occurrences of the specified string. | Of course, here is the Java code you requested:
```java
public static int countOccurrences(String str, String sub)
{
Parameters.checkNotNull(str);
int n = 0;
if (!sub.isEmpty()) {
int start = 0;
while (true) {
start = str.indexOf(sub, start);
if (start == -1) {
break;
}
start += sub.l... |
GlenKPeterson/Paguro | src/main/java/org/organicdesign/fp/collections/PersistentTreeSet.java | PersistentTreeSet.ofComp | public static <T> PersistentTreeSet<T> ofComp(Comparator<? super T> comp,
Iterable<T> elements) {
PersistentTreeSet<T> ret = new PersistentTreeSet<>(PersistentTreeMap.empty(comp));
if (elements == null) { return ret; }
for (T element : elements) ... | java | public static <T> PersistentTreeSet<T> ofComp(Comparator<? super T> comp,
Iterable<T> elements) {
PersistentTreeSet<T> ret = new PersistentTreeSet<>(PersistentTreeMap.empty(comp));
if (elements == null) { return ret; }
for (T element : elements) ... | [
"public",
"static",
"<",
"T",
">",
"PersistentTreeSet",
"<",
"T",
">",
"ofComp",
"(",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comp",
",",
"Iterable",
"<",
"T",
">",
"elements",
")",
"{",
"PersistentTreeSet",
"<",
"T",
">",
"ret",
"=",
"new",
"Per... | Returns a new PersistentTreeSet of the given comparator and items.
@param comp A comparator that defines the sort order of elements in the new set. This
becomes part of the set (it's not for pre-sorting).
@param elements items to go into the set. In the case of a duplicate element, later
values in the input list ove... | [
"Returns",
"a",
"new",
"PersistentTreeSet",
"of",
"the",
"given",
"comparator",
"and",
"items",
"."
] | eac0d64b2eb9496967334f635cdb270cffb2197b | https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/PersistentTreeSet.java#L72-L80 | test | Create a PersistentTreeSet from the given elements using the given comparator. | Of course, here is the Java code you requested:
```java
public static <T> PersistentTreeSet<T> ofComp(Comparator<? super T> comp,
Iterable<T> elements) {
PersistentTreeSet<T> ret = new PersistentTreeSet<>(PersistentTreeMap.empty(comp));
if (elements == ... |
oblac/jodd | jodd-mail/src/main/java/jodd/mail/ReceivedEmail.java | ReceivedEmail.parseInline | protected static boolean parseInline(final Part part) throws MessagingException {
if (part instanceof MimePart) {
final String dispositionId = part.getDisposition();
return dispositionId != null && dispositionId.equalsIgnoreCase("inline");
}
return false;
} | java | protected static boolean parseInline(final Part part) throws MessagingException {
if (part instanceof MimePart) {
final String dispositionId = part.getDisposition();
return dispositionId != null && dispositionId.equalsIgnoreCase("inline");
}
return false;
} | [
"protected",
"static",
"boolean",
"parseInline",
"(",
"final",
"Part",
"part",
")",
"throws",
"MessagingException",
"{",
"if",
"(",
"part",
"instanceof",
"MimePart",
")",
"{",
"final",
"String",
"dispositionId",
"=",
"part",
".",
"getDisposition",
"(",
")",
";... | Returns {@code true} if the {@link Part} is inline.
@param part {@link Part} to parse.
@return {@code true} if the {@link Part} is inline.
@throws MessagingException if there is a failure. | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"{",
"@link",
"Part",
"}",
"is",
"inline",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/ReceivedEmail.java#L262-L268 | test | Parse inline part. | Of course, here is the Java code you requested:
```java
protected static boolean parseInline(final Part part) throws MessagingException {
if (part instanceof MimePart) {
final String dispositionId = part.getDisposition();
return dispositionId != null && dispositionId.equalsIgnoreCase("inline");
}
return fa... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.forbidden | public static Result forbidden(JsonNode content, JsonEncoding encoding) {
return status(FORBIDDEN, content, encoding);
} | java | public static Result forbidden(JsonNode content, JsonEncoding encoding) {
return status(FORBIDDEN, content, encoding);
} | [
"public",
"static",
"Result",
"forbidden",
"(",
"JsonNode",
"content",
",",
"JsonEncoding",
"encoding",
")",
"{",
"return",
"status",
"(",
"FORBIDDEN",
",",
"content",
",",
"encoding",
")",
";",
"}"
] | Generates a 403 Forbidden result.
@param content the result's body content as a play-json object
@param encoding the encoding into which the json should be encoded
@return the result | [
"Generates",
"a",
"403",
"Forbidden",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L1909-L1911 | test | HTTP 403 status code. | Of course, here is the Java code you requested:
```java
public static Result forbidden(JsonNode content, JsonEncoding encoding) {
return status(FORBIDDEN, content, encoding);
}
```
Hope this helps! |
oblac/jodd | jodd-htmlstapler/src/main/java/jodd/htmlstapler/HtmlStaplerFilter.java | HtmlStaplerFilter.readFilterConfigParameters | protected void readFilterConfigParameters(final FilterConfig filterConfig, final Object target, final String... parameters) {
for (String parameter : parameters) {
String value = filterConfig.getInitParameter(parameter);
if (value != null) {
BeanUtil.declared.setProperty(target, parameter, value);
}
}... | java | protected void readFilterConfigParameters(final FilterConfig filterConfig, final Object target, final String... parameters) {
for (String parameter : parameters) {
String value = filterConfig.getInitParameter(parameter);
if (value != null) {
BeanUtil.declared.setProperty(target, parameter, value);
}
}... | [
"protected",
"void",
"readFilterConfigParameters",
"(",
"final",
"FilterConfig",
"filterConfig",
",",
"final",
"Object",
"target",
",",
"final",
"String",
"...",
"parameters",
")",
"{",
"for",
"(",
"String",
"parameter",
":",
"parameters",
")",
"{",
"String",
"v... | Reads filter config parameters and set into destination target. | [
"Reads",
"filter",
"config",
"parameters",
"and",
"set",
"into",
"destination",
"target",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-htmlstapler/src/main/java/jodd/htmlstapler/HtmlStaplerFilter.java#L112-L120 | test | Read filter config parameters. | Of course, here is the Java code you requested:
```java
protected void readFilterConfigParameters(final FilterConfig filterConfig, final Object target, final String... parameters) {
for (String parameter : parameters) {
String value = filterConfig.getInitParameter(parameter);
if (value != null) {
BeanUtil... |
real-logic/aeron | aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java | ChannelUriStringBuilder.validate | public ChannelUriStringBuilder validate()
{
if (null == media)
{
throw new IllegalStateException("media type is mandatory");
}
if (CommonContext.UDP_MEDIA.equals(media) && (null == endpoint && null == controlEndpoint))
{
throw new IllegalStateExceptio... | java | public ChannelUriStringBuilder validate()
{
if (null == media)
{
throw new IllegalStateException("media type is mandatory");
}
if (CommonContext.UDP_MEDIA.equals(media) && (null == endpoint && null == controlEndpoint))
{
throw new IllegalStateExceptio... | [
"public",
"ChannelUriStringBuilder",
"validate",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"media",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"media type is mandatory\"",
")",
";",
"}",
"if",
"(",
"CommonContext",
".",
"UDP_MEDIA",
".",
"equals",
... | Validates that the collection of set parameters are valid together.
@return this for a fluent API.
@throws IllegalStateException if the combination of params is invalid. | [
"Validates",
"that",
"the",
"collection",
"of",
"set",
"parameters",
"are",
"valid",
"together",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java#L97-L135 | test | Validate the CRA - 2882 specification. | Of course, here is the Java code you requested:
```java
public ChannelUriStringBuilder validate()
{
if (null == media)
{
throw new IllegalStateException("media type is mandatory");
}
if (CommonContext.UDP_MEDIA.equals(media) && (null == endpoint && null == controlEndpoi... |
subchen/jetbrick-all-1x | jetbrick-commons/src/main/java/jetbrick/io/buffer/FastBuffer.java | FastBuffer.toArray | public E[] toArray() {
int pos = 0;
E[] array = (E[]) new Object[size];
if (currentBufferIndex == -1) {
return array;
}
for (int i = 0; i < currentBufferIndex; i++) {
int len = buffers[i].length;
System.arraycopy(buffers[i], 0, array, pos, le... | java | public E[] toArray() {
int pos = 0;
E[] array = (E[]) new Object[size];
if (currentBufferIndex == -1) {
return array;
}
for (int i = 0; i < currentBufferIndex; i++) {
int len = buffers[i].length;
System.arraycopy(buffers[i], 0, array, pos, le... | [
"public",
"E",
"[",
"]",
"toArray",
"(",
")",
"{",
"int",
"pos",
"=",
"0",
";",
"E",
"[",
"]",
"array",
"=",
"(",
"E",
"[",
"]",
")",
"new",
"Object",
"[",
"size",
"]",
";",
"if",
"(",
"currentBufferIndex",
"==",
"-",
"1",
")",
"{",
"return",... | Creates <code>E</code> array from buffered content. | [
"Creates",
"<code",
">",
"E<",
"/",
"code",
">",
"array",
"from",
"buffered",
"content",
"."
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/io/buffer/FastBuffer.java#L209-L226 | test | Get an array of the underlying array. | Of course, here is the Java code you requested:
```java
public E[] toArray() {
int pos = 0;
E[] array = (E[]) new Object[size];
if (currentBufferIndex == -1) {
return array;
}
for (int i = 0; i < currentBufferIndex; i++) {
int len = buffers[i].length;
... |
streamsets/datacollector | kudu-protolib/src/main/java/com/streamsets/pipeline/stage/destination/kudu/KuduRecordConverter.java | KuduRecordConverter.binLogRecordFieldtoSdc | private String binLogRecordFieldtoSdc(String fieldPath, int operation) {
if (operation == KuduOperationType.DELETE.code) {
return "/OldData" + fieldPath;
}
return fieldPath;
} | java | private String binLogRecordFieldtoSdc(String fieldPath, int operation) {
if (operation == KuduOperationType.DELETE.code) {
return "/OldData" + fieldPath;
}
return fieldPath;
} | [
"private",
"String",
"binLogRecordFieldtoSdc",
"(",
"String",
"fieldPath",
",",
"int",
"operation",
")",
"{",
"if",
"(",
"operation",
"==",
"KuduOperationType",
".",
"DELETE",
".",
"code",
")",
"{",
"return",
"\"/OldData\"",
"+",
"fieldPath",
";",
"}",
"return... | delete record have /OldData | [
"delete",
"record",
"have",
"/",
"OldData"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/kudu-protolib/src/main/java/com/streamsets/pipeline/stage/destination/kudu/KuduRecordConverter.java#L70-L75 | test | Convert a record field path to a SDC path. | Of course, here is the Java code you requested:
```java
private String binLogRecordFieldtoSdc(String fieldPath, int operation) {
if (operation == KuduOperationType.DELETE.code) {
return "/OldData" + fieldPath;
}
return fieldPath;
}
```
Hope this helps! |
flow/noise | src/main/java/com/flowpowered/noise/module/modifier/Range.java | Range.setBounds | public void setBounds(double currentLower, double currentUpper, double newLower,
double newUpper) {
if (currentLower == currentUpper) {
throw new IllegalArgumentException("currentLower must not equal currentUpper. Both are " + currentUpper);
}
if (newLower == newUpper) {
throw new Illeg... | java | public void setBounds(double currentLower, double currentUpper, double newLower,
double newUpper) {
if (currentLower == currentUpper) {
throw new IllegalArgumentException("currentLower must not equal currentUpper. Both are " + currentUpper);
}
if (newLower == newUpper) {
throw new Illeg... | [
"public",
"void",
"setBounds",
"(",
"double",
"currentLower",
",",
"double",
"currentUpper",
",",
"double",
"newLower",
",",
"double",
"newUpper",
")",
"{",
"if",
"(",
"currentLower",
"==",
"currentUpper",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(... | Configure bounds for range module
@param currentLower current lower bound
@param currentUpper current upper bound
@param newLower new lower bound
@param newUpper new upper bound | [
"Configure",
"bounds",
"for",
"range",
"module"
] | fe880dbbb09731ade59d9b4c0da6720b70f17509 | https://github.com/flow/noise/blob/fe880dbbb09731ade59d9b4c0da6720b70f17509/src/main/java/com/flowpowered/noise/module/modifier/Range.java#L92-L105 | test | Sets the bounds of the bounds of this scale. | Of course, here is the Java code you requested:
```java
public void setBounds(double currentLower, double currentUpper, double newLower,
double newUpper) {
if (currentLower == currentUpper) {
throw new IllegalArgumentException("currentLower must not equal currentUpper. Both are " + currentUpper);
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLRetryAbstract.java | OCommandExecutorSQLRetryAbstract.parseRetry | protected void parseRetry() throws OCommandSQLParsingException {
retry = Integer.parseInt(parserNextWord(true));
String temp = parseOptionalWord(true);
if (temp.equals("WAIT")) {
wait = Integer.parseInt(parserNextWord(true));
} else
parserGoBack();
} | java | protected void parseRetry() throws OCommandSQLParsingException {
retry = Integer.parseInt(parserNextWord(true));
String temp = parseOptionalWord(true);
if (temp.equals("WAIT")) {
wait = Integer.parseInt(parserNextWord(true));
} else
parserGoBack();
} | [
"protected",
"void",
"parseRetry",
"(",
")",
"throws",
"OCommandSQLParsingException",
"{",
"retry",
"=",
"Integer",
".",
"parseInt",
"(",
"parserNextWord",
"(",
"true",
")",
")",
";",
"String",
"temp",
"=",
"parseOptionalWord",
"(",
"true",
")",
";",
"if",
"... | Parses the RETRY number of times | [
"Parses",
"the",
"RETRY",
"number",
"of",
"times"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLRetryAbstract.java#L36-L45 | test | Parse the retry. | Of course, here is the Java code you requested:
```java
protected void parseRetry() throws OCommandSQLParsingException {
retry = Integer.parseInt(parserNextWord(true));
String temp = parseOptionalWord(true);
if (temp.equals("WAIT")) {
wait = Integer.parseInt(parserNextWord(true));
} else
... |
Unidata/thredds | waterml/src/main/java/ucar/nc2/ogc/MarshallingUtil.java | MarshallingUtil.validate | public static void validate(XmlObject doc, boolean strict) throws XmlException {
// Create an XmlOptions instance and set the error listener.
Set<XmlError> validationErrors = new HashSet<>();
XmlOptions validationOptions = new XmlOptions();
validationOptions.setErrorListener(validationEr... | java | public static void validate(XmlObject doc, boolean strict) throws XmlException {
// Create an XmlOptions instance and set the error listener.
Set<XmlError> validationErrors = new HashSet<>();
XmlOptions validationOptions = new XmlOptions();
validationOptions.setErrorListener(validationEr... | [
"public",
"static",
"void",
"validate",
"(",
"XmlObject",
"doc",
",",
"boolean",
"strict",
")",
"throws",
"XmlException",
"{",
"// Create an XmlOptions instance and set the error listener.",
"Set",
"<",
"XmlError",
">",
"validationErrors",
"=",
"new",
"HashSet",
"<>",
... | Validates an xml doc. If the validation fails, the exception contains a detailed list of errors.
@param doc the document to validate
@throws XmlException thrown if the XML is incorrect | [
"Validates",
"an",
"xml",
"doc",
".",
"If",
"the",
"validation",
"fails",
"the",
"exception",
"contains",
"a",
"detailed",
"list",
"of",
"errors",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/waterml/src/main/java/ucar/nc2/ogc/MarshallingUtil.java#L112-L130 | test | Validate the XML document. | Of course, here is the Java code you requested:
```java
public static void validate(XmlObject doc, boolean strict) throws XmlException {
// Create an XmlOptions instance and set the error listener.
Set<XmlError> validationErrors = new HashSet<>();
XmlOptions validationOptions = new XmlOptions()... |
awslabs/aws-hal-client-java | src/main/java/com/amazonaws/hal/client/ConversionUtil.java | ConversionUtil.getCollectionType | static Type getCollectionType(Type type, int index, Class defaultClass) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
return parameterizedType.getActualTypeArguments()[index];
} else {
return defaultClass;
... | java | static Type getCollectionType(Type type, int index, Class defaultClass) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
return parameterizedType.getActualTypeArguments()[index];
} else {
return defaultClass;
... | [
"static",
"Type",
"getCollectionType",
"(",
"Type",
"type",
",",
"int",
"index",
",",
"Class",
"defaultClass",
")",
"{",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
"ParameterizedType",
"parameterizedType",
"=",
"(",
"ParameterizedType",
")",
... | ------------------------------------------------------------- | [
"-------------------------------------------------------------"
] | bbbb67326f6f1ff6e583d6fa95a7768a0c60b62b | https://github.com/awslabs/aws-hal-client-java/blob/bbbb67326f6f1ff6e583d6fa95a7768a0c60b62b/src/main/java/com/amazonaws/hal/client/ConversionUtil.java#L55-L63 | test | Get the type of a collection. | Of course, here is the Java code you requested:
```java
static Type getCollectionType(Type type, int index, Class defaultClass) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
return parameterizedType.getActualTypeArguments()[i... |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/SerializationUtils.java | SerializationUtils.deserialize | public static Object deserialize(byte[] bytes) {
if (bytes == null) {
return null;
}
try {
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
return ois.readObject();
} catch (IOException ex) {
throw new Illegal... | java | public static Object deserialize(byte[] bytes) {
if (bytes == null) {
return null;
}
try {
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
return ois.readObject();
} catch (IOException ex) {
throw new Illegal... | [
"public",
"static",
"Object",
"deserialize",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"ObjectInputStream",
"ois",
"=",
"new",
"ObjectInputStream",
"(",
"new",
"ByteArray... | Deserialize the byte array into an object.
@param bytes a serialized object
@return the result of deserializing the bytes | [
"Deserialize",
"the",
"byte",
"array",
"into",
"an",
"object",
"."
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/SerializationUtils.java#L56-L68 | test | Deserialize an object from bytes. | Of course, here is the Java code you requested:
```java
public static Object deserialize(byte[] bytes) {
if (bytes == null) {
return null;
}
try {
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
return ois.readObject();
... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/properties/ParsedProperties.java | ParsedProperties.setPropertyIfNull | public boolean setPropertyIfNull(String propname, boolean value)
{
return Boolean.parseBoolean(setPropertyIfNull(propname, Boolean.toString(value)));
} | java | public boolean setPropertyIfNull(String propname, boolean value)
{
return Boolean.parseBoolean(setPropertyIfNull(propname, Boolean.toString(value)));
} | [
"public",
"boolean",
"setPropertyIfNull",
"(",
"String",
"propname",
",",
"boolean",
"value",
")",
"{",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"setPropertyIfNull",
"(",
"propname",
",",
"Boolean",
".",
"toString",
"(",
"value",
")",
")",
")",
";",
"}... | Helper method for setting properties to defaults when they are not already set.
@param propname The name of the system property to set.
@param value The value to set it to.
@return The value of the property after this method call. | [
"Helper",
"method",
"for",
"setting",
"properties",
"to",
"defaults",
"when",
"they",
"are",
"not",
"already",
"set",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/properties/ParsedProperties.java#L162-L165 | test | Sets the property if null. | Of course, here is the Java code you requested:
```java
public boolean setPropertyIfNull(String propname, boolean value)
{
return Boolean.parseBoolean(setPropertyIfNull(propname, Boolean.toString(value)));
}
```
Hope this helps! |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/rpc/RpcRemoting.java | RpcRemoting.invokeWithCallback | public void invokeWithCallback(String addr, Object request, final InvokeContext invokeContext,
InvokeCallback invokeCallback, int timeoutMillis)
throws RemotingException,
... | java | public void invokeWithCallback(String addr, Object request, final InvokeContext invokeContext,
InvokeCallback invokeCallback, int timeoutMillis)
throws RemotingException,
... | [
"public",
"void",
"invokeWithCallback",
"(",
"String",
"addr",
",",
"Object",
"request",
",",
"final",
"InvokeContext",
"invokeContext",
",",
"InvokeCallback",
"invokeCallback",
",",
"int",
"timeoutMillis",
")",
"throws",
"RemotingException",
",",
"InterruptedException"... | Rpc invocation with callback.<br>
Notice! DO NOT modify the request object concurrently when this method is called.
@param addr
@param request
@param invokeContext
@param invokeCallback
@param timeoutMillis
@throws RemotingException
@throws InterruptedException | [
"Rpc",
"invocation",
"with",
"callback",
".",
"<br",
">",
"Notice!",
"DO",
"NOT",
"modify",
"the",
"request",
"object",
"concurrently",
"when",
"this",
"method",
"is",
"called",
"."
] | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcRemoting.java#L264-L270 | test | Invoke with callback. | Of course, here is the Java code you requested:
```java
public void invokeWithCallback(String addr, Object request, final InvokeContext invokeContext,
InvokeCallback invokeCallback, int timeoutMillis)
... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/user/UserConnection.java | UserConnection.handleCursor | private TResult handleCursor(Cursor cursor, UserQuery query) {
TResult result = convertCursor(cursor);
result.setQuery(query);
if (table != null) {
result.setTable(table);
}
return result;
} | java | private TResult handleCursor(Cursor cursor, UserQuery query) {
TResult result = convertCursor(cursor);
result.setQuery(query);
if (table != null) {
result.setTable(table);
}
return result;
} | [
"private",
"TResult",
"handleCursor",
"(",
"Cursor",
"cursor",
",",
"UserQuery",
"query",
")",
"{",
"TResult",
"result",
"=",
"convertCursor",
"(",
"cursor",
")",
";",
"result",
".",
"setQuery",
"(",
"query",
")",
";",
"if",
"(",
"table",
"!=",
"null",
"... | Convert the cursor to the result type cursor
@param cursor cursor
@param query user query
@return result cursor | [
"Convert",
"the",
"cursor",
"to",
"the",
"result",
"type",
"cursor"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/user/UserConnection.java#L182-L189 | test | Handle cursor. | Of course, here is the Java code you requested:
```java
private TResult handleCursor(Cursor cursor, UserQuery query) {
TResult result = convertCursor(cursor);
result.setQuery(query);
if (table != null) {
result.setTable(table);
}
return result;
}
```
Hope this h... |
Unidata/thredds | dap4/d4core/src/main/java/dap4/core/ce/CEConstraint.java | CEConstraint.dumpvar | protected void
dumpvar(Segment seg, StringBuilder buf, boolean forconstraint)
{
if(seg.var.isTopLevel())
buf.append(seg.var.getFQN());
else
buf.append(seg.var.getShortName());
List<DapDimension> dimset = seg.var.getDimensions();
// Add any slices
L... | java | protected void
dumpvar(Segment seg, StringBuilder buf, boolean forconstraint)
{
if(seg.var.isTopLevel())
buf.append(seg.var.getFQN());
else
buf.append(seg.var.getShortName());
List<DapDimension> dimset = seg.var.getDimensions();
// Add any slices
L... | [
"protected",
"void",
"dumpvar",
"(",
"Segment",
"seg",
",",
"StringBuilder",
"buf",
",",
"boolean",
"forconstraint",
")",
"{",
"if",
"(",
"seg",
".",
"var",
".",
"isTopLevel",
"(",
")",
")",
"buf",
".",
"append",
"(",
"seg",
".",
"var",
".",
"getFQN",
... | Recursive helper for tostring/toConstraintString
@param seg
@param buf
@param forconstraint | [
"Recursive",
"helper",
"for",
"tostring",
"/",
"toConstraintString"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/ce/CEConstraint.java#L573-L622 | test | Dump var. | Of course, here is the Java code you requested:
```java
protected void
dumpvar(Segment seg, StringBuilder buf, boolean forconstraint)
{
if(seg.var.isTopLevel())
buf.append(seg.var.getFQN());
else
buf.append(seg.var.getShortName());
List<DapDimension> dimset = seg... |
oblac/jodd | jodd-json/src/main/java/jodd/json/JsonContext.java | JsonContext.serialize | public boolean serialize(final Object object) {
if (object == null) {
write(NULL);
return true;
}
TypeJsonSerializer typeJsonSerializer = null;
// callback
if (serializerResolver != null) {
typeJsonSerializer = serializerResolver.apply(object);
}
if (typeJsonSerializer == null) {
// + re... | java | public boolean serialize(final Object object) {
if (object == null) {
write(NULL);
return true;
}
TypeJsonSerializer typeJsonSerializer = null;
// callback
if (serializerResolver != null) {
typeJsonSerializer = serializerResolver.apply(object);
}
if (typeJsonSerializer == null) {
// + re... | [
"public",
"boolean",
"serialize",
"(",
"final",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"write",
"(",
"NULL",
")",
";",
"return",
"true",
";",
"}",
"TypeJsonSerializer",
"typeJsonSerializer",
"=",
"null",
";",
"// callbac... | Serializes the object using {@link jodd.json.TypeJsonSerializer type serializer}.
Returns <code>true</code> if object was written, otherwise returns <code>false</code>. | [
"Serializes",
"the",
"object",
"using",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-json/src/main/java/jodd/json/JsonContext.java#L175-L214 | test | Serialize the given object. | Of course, here is the Java code you requested:
```java
public boolean serialize(final Object object) {
if (object == null) {
write(NULL);
return true;
}
TypeJsonSerializer typeJsonSerializer = null;
// callback
if (serializerResolver != null) {
typeJsonSerializer = serializerResolver.apply(obje... |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/TagLibraryInfoImpl.java | TagLibraryInfoImpl.generateTLDLocation | private String[] generateTLDLocation(String uri,
JspCompilationContext ctxt)
throws JasperException {
int uriType = TldScanner.uriType(uri);
if (uriType == TldScanner.ABS_URI) {
err.jspError("jsp.error.taglibDirective.absUriCannotBeResolved",
uri);
} else if (uriType == TldScanner.NOR... | java | private String[] generateTLDLocation(String uri,
JspCompilationContext ctxt)
throws JasperException {
int uriType = TldScanner.uriType(uri);
if (uriType == TldScanner.ABS_URI) {
err.jspError("jsp.error.taglibDirective.absUriCannotBeResolved",
uri);
} else if (uriType == TldScanner.NOR... | [
"private",
"String",
"[",
"]",
"generateTLDLocation",
"(",
"String",
"uri",
",",
"JspCompilationContext",
"ctxt",
")",
"throws",
"JasperException",
"{",
"int",
"uriType",
"=",
"TldScanner",
".",
"uriType",
"(",
"uri",
")",
";",
"if",
"(",
"uriType",
"==",
"T... | /*
@param uri The uri of the TLD
@param ctxt The compilation context
@return String array whose first element denotes the path to the TLD.
If the path to the TLD points to a jar file, then the second element
denotes the name of the TLD entry in the jar file, which is hardcoded
to META-INF/taglib.tld. | [
"/",
"*",
"@param",
"uri",
"The",
"uri",
"of",
"the",
"TLD",
"@param",
"ctxt",
"The",
"compilation",
"context"
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/TagLibraryInfoImpl.java#L425-L455 | test | Generate the location of the taglib. jsp file. | Of course, here is the Java code you requested:
```java
private String[] generateTLDLocation(String uri,
JspCompilationContext ctxt)
throws JasperException {
int uriType = TldScanner.uriType(uri);
if (uriType == TldScanner.ABS_URI) {
err.jspError("jsp.error.taglibDirective.absUriCannotBeR... |
Jasig/NotificationPortlet | notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/ssp/SSPTaskNotificationService.java | SSPTaskNotificationService.fetch | @Override
public NotificationResponse fetch(PortletRequest req) {
PortletPreferences preferences = req.getPreferences();
String enabled = preferences.getValue(SSP_NOTIFICATIONS_ENABLED, "false");
if (!"true".equalsIgnoreCase(enabled)) {
return new NotificationResponse();
... | java | @Override
public NotificationResponse fetch(PortletRequest req) {
PortletPreferences preferences = req.getPreferences();
String enabled = preferences.getValue(SSP_NOTIFICATIONS_ENABLED, "false");
if (!"true".equalsIgnoreCase(enabled)) {
return new NotificationResponse();
... | [
"@",
"Override",
"public",
"NotificationResponse",
"fetch",
"(",
"PortletRequest",
"req",
")",
"{",
"PortletPreferences",
"preferences",
"=",
"req",
".",
"getPreferences",
"(",
")",
";",
"String",
"enabled",
"=",
"preferences",
".",
"getValue",
"(",
"SSP_NOTIFICAT... | Fetch the set of SSP tasks for the uPortal user.
@param req The <code>PortletRequest</code>
@return The set of notifications for this data source. | [
"Fetch",
"the",
"set",
"of",
"SSP",
"tasks",
"for",
"the",
"uPortal",
"user",
"."
] | a74b87c145b66166a2cb6849d17ce9b0f2c98f3b | https://github.com/Jasig/NotificationPortlet/blob/a74b87c145b66166a2cb6849d17ce9b0f2c98f3b/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/ssp/SSPTaskNotificationService.java#L103-L138 | test | Retrieve the SSP Notifications for the current user. | Of course, here is the Java code you requested:
```java
@Override
public NotificationResponse fetch(PortletRequest req) {
PortletPreferences preferences = req.getPreferences();
String enabled = preferences.getValue(SSP_NOTIFICATIONS_ENABLED, "false");
if (!"true".equalsIgnoreCase(enabled)) ... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/standard/plug/Madis.java | Madis.getConfig | public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) {
Dimension obsDim = Evaluator.getDimension(ds, "recNum", errlog);
if (obsDim == null) {
errlog.format("MADIS: must have an Observation dimension: named recNum");
return null;
}
VNames vn = getVari... | java | public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) {
Dimension obsDim = Evaluator.getDimension(ds, "recNum", errlog);
if (obsDim == null) {
errlog.format("MADIS: must have an Observation dimension: named recNum");
return null;
}
VNames vn = getVari... | [
"public",
"TableConfig",
"getConfig",
"(",
"FeatureType",
"wantFeatureType",
",",
"NetcdfDataset",
"ds",
",",
"Formatter",
"errlog",
")",
"{",
"Dimension",
"obsDim",
"=",
"Evaluator",
".",
"getDimension",
"(",
"ds",
",",
"\"recNum\"",
",",
"errlog",
")",
";",
... | /*
<!-- C:/data/dt2/station/madis2.sao -->
<stationCollection>
<table dim="maxStaticIds" limit="nStaticIds">
<lastLink>lastRecord</lastLink>
<table dim="recNum">
<stationId>:stationIdVariable</stationId>
<stationWmoId>wmoId</stationWmoId>
<coordAxis type="time">timeObs</coordAxis>
<coordAxis type="lat">latitude</coord... | [
"/",
"*",
"<!",
"--",
"C",
":",
"/",
"data",
"/",
"dt2",
"/",
"station",
"/",
"madis2",
".",
"sao",
"--",
">",
"<stationCollection",
">",
"<table",
"dim",
"=",
"maxStaticIds",
"limit",
"=",
"nStaticIds",
">",
"<lastLink",
">",
"lastRecord<",
"/",
"last... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/Madis.java#L65-L156 | test | Get the config for a feature type | Of course, here is the Java code you requested:
```java
public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) {
Dimension obsDim = Evaluator.getDimension(ds, "recNum", errlog);
if (obsDim == null) {
errlog.format("MADIS: must have an Observation dimension: named r... |
HalBuilder/halbuilder-core | src/main/java/com/theoryinpractise/halbuilder5/ResourceRepresentation.java | ResourceRepresentation.withLink | public ResourceRepresentation<V> withLink(String rel, URI uri) {
return withLink(rel, uri.toASCIIString());
} | java | public ResourceRepresentation<V> withLink(String rel, URI uri) {
return withLink(rel, uri.toASCIIString());
} | [
"public",
"ResourceRepresentation",
"<",
"V",
">",
"withLink",
"(",
"String",
"rel",
",",
"URI",
"uri",
")",
"{",
"return",
"withLink",
"(",
"rel",
",",
"uri",
".",
"toASCIIString",
"(",
")",
")",
";",
"}"
] | Add a link to this resource.
@param rel
@param uri The target URI for the link, possibly relative to the href of this resource.
@return | [
"Add",
"a",
"link",
"to",
"this",
"resource",
"."
] | 73a277d844ec9616722f655dc34f8174b06b1327 | https://github.com/HalBuilder/halbuilder-core/blob/73a277d844ec9616722f655dc34f8174b06b1327/src/main/java/com/theoryinpractise/halbuilder5/ResourceRepresentation.java#L197-L199 | test | Add a link to the resource. | Of course, here is the Java code you requested:
```java
public ResourceRepresentation<V> withLink(String rel, URI uri) {
return withLink(rel, uri.toASCIIString());
}
```
Hope this helps! |
Netflix/hollow | hollow/src/main/java/com/netflix/hollow/core/memory/encoding/VarInt.java | VarInt.readVLong | public static long readVLong(ByteData arr, long position) {
byte b = arr.get(position++);
if(b == (byte) 0x80)
throw new RuntimeException("Attempting to read null value as long");
long value = b & 0x7F;
while ((b & 0x80) != 0) {
b = arr.get(position++);
... | java | public static long readVLong(ByteData arr, long position) {
byte b = arr.get(position++);
if(b == (byte) 0x80)
throw new RuntimeException("Attempting to read null value as long");
long value = b & 0x7F;
while ((b & 0x80) != 0) {
b = arr.get(position++);
... | [
"public",
"static",
"long",
"readVLong",
"(",
"ByteData",
"arr",
",",
"long",
"position",
")",
"{",
"byte",
"b",
"=",
"arr",
".",
"get",
"(",
"position",
"++",
")",
";",
"if",
"(",
"b",
"==",
"(",
"byte",
")",
"0x80",
")",
"throw",
"new",
"RuntimeE... | Read a variable length long from the supplied {@link ByteData} starting at the specified position.
@param arr the byte data to read from
@param position the position in the byte data to read from
@return the long value | [
"Read",
"a",
"variable",
"length",
"long",
"from",
"the",
"supplied",
"{"
] | 43ca100034a01050fb764170bd32b085ac9a3c22 | https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/memory/encoding/VarInt.java#L196-L210 | test | Read a VLong from the byte array at the given position. | Of course, here is the Java code you requested:
```java
public static long readVLong(ByteData arr, long position) {
byte b = arr.get(position++);
if(b == (byte) 0x80)
throw new RuntimeException("Attempting to read null value as long");
long value = b & 0x7F;
while ((b & 0x... |
wildfly/wildfly | security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java | ConnectionSecurityContext.popIdentity | public static void popIdentity(final ContextStateCache stateCache) {
RemotingContext.setConnection(stateCache.getConnection());
SecurityContextAssociation.setSecurityContext(stateCache.getSecurityContext());
} | java | public static void popIdentity(final ContextStateCache stateCache) {
RemotingContext.setConnection(stateCache.getConnection());
SecurityContextAssociation.setSecurityContext(stateCache.getSecurityContext());
} | [
"public",
"static",
"void",
"popIdentity",
"(",
"final",
"ContextStateCache",
"stateCache",
")",
"{",
"RemotingContext",
".",
"setConnection",
"(",
"stateCache",
".",
"getConnection",
"(",
")",
")",
";",
"SecurityContextAssociation",
".",
"setSecurityContext",
"(",
... | Pop the identity previously associated and restore internal state to it's previous value.
@param stateCache - The cache containing the state as it was when pushIdentity was called. | [
"Pop",
"the",
"identity",
"previously",
"associated",
"and",
"restore",
"internal",
"state",
"to",
"it",
"s",
"previous",
"value",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java#L119-L122 | test | Pop identity from context cache. | Of course, here is the Java code you requested:
```java
public static void popIdentity(final ContextStateCache stateCache) {
RemotingContext.setConnection(stateCache.getConnection());
SecurityContextAssociation.setSecurityContext(stateCache.getSecurityContext());
}
```
Hope this helps! |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/matcher/ResponseAwareMatcherComposer.java | ResponseAwareMatcherComposer.and | @SuppressWarnings("unchecked")
public static <T extends ResponseBody<T> & ResponseOptions<T>> ResponseAwareMatcher<T> and(
final ResponseAwareMatcher<T> matcher1, final ResponseAwareMatcher<T> matcher2,
final ResponseAwareMatcher<T>... additionalMatchers) {
return response -> {
... | java | @SuppressWarnings("unchecked")
public static <T extends ResponseBody<T> & ResponseOptions<T>> ResponseAwareMatcher<T> and(
final ResponseAwareMatcher<T> matcher1, final ResponseAwareMatcher<T> matcher2,
final ResponseAwareMatcher<T>... additionalMatchers) {
return response -> {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"ResponseBody",
"<",
"T",
">",
"&",
"ResponseOptions",
"<",
"T",
">",
">",
"ResponseAwareMatcher",
"<",
"T",
">",
"and",
"(",
"final",
"ResponseAwareMatcher",
"<",
"... | Compose this {@link ResponseAwareMatcher} with another {@link ResponseAwareMatcher}.
@param matcher1 The first matcher to compose
@param matcher2 The second matcher to compose
@param additionalMatchers The additional matchers to compose
@return A and-composed {@link ResponseAwareMatcher}. | [
"Compose",
"this",
"{",
"@link",
"ResponseAwareMatcher",
"}",
"with",
"another",
"{",
"@link",
"ResponseAwareMatcher",
"}",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/matcher/ResponseAwareMatcherComposer.java#L60-L68 | test | Create a matcher which is an AND of the given matchers. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <T extends ResponseBody<T> & ResponseOptions<T>> ResponseAwareMatcher<T> and(
final ResponseAwareMatcher<T> matcher1, final ResponseAwareMatcher<T> matcher2,
final ResponseAwareMatcher<T>...... |
rackerlabs/blueflood | blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/ElasticsearchRestHelper.java | ElasticsearchRestHelper.getRegexToHandleTokens | protected String getRegexToHandleTokens(GlobPattern globPattern) {
String[] queryRegexParts = globPattern.compiled().toString().split("\\\\.");
return Arrays.stream(queryRegexParts)
.map(this::convertRegexToCaptureUptoNextToken)
.collect(joining(Locator.METRIC_TOKEN_SEPA... | java | protected String getRegexToHandleTokens(GlobPattern globPattern) {
String[] queryRegexParts = globPattern.compiled().toString().split("\\\\.");
return Arrays.stream(queryRegexParts)
.map(this::convertRegexToCaptureUptoNextToken)
.collect(joining(Locator.METRIC_TOKEN_SEPA... | [
"protected",
"String",
"getRegexToHandleTokens",
"(",
"GlobPattern",
"globPattern",
")",
"{",
"String",
"[",
"]",
"queryRegexParts",
"=",
"globPattern",
".",
"compiled",
"(",
")",
".",
"toString",
"(",
")",
".",
"split",
"(",
"\"\\\\\\\\.\"",
")",
";",
"return... | For a given glob, gives regex for {@code Locator.METRIC_TOKEN_SEPARATOR} separated tokens
For example:
globPattern of foo.*.* would produce a regex foo\.[^.]+\.[^.]+
globPattern of foo.b*.* would produce a regex foo\.b[^.]*\.[^.]+
@param globPattern
@return | [
"For",
"a",
"given",
"glob",
"gives",
"regex",
"for",
"{",
"@code",
"Locator",
".",
"METRIC_TOKEN_SEPARATOR",
"}",
"separated",
"tokens"
] | 4722a3449b1a7f8e88889ea8c340c6f24396b5b0 | https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/ElasticsearchRestHelper.java#L376-L382 | test | Returns the regex to handle tokens. | Of course, here is the Java code you requested:
```java
protected String getRegexToHandleTokens(GlobPattern globPattern) {
String[] queryRegexParts = globPattern.compiled().toString().split("\\\\.");
return Arrays.stream(queryRegexParts)
.map(this::convertRegexToCaptureUptoNextToken)
... |
js-lib-com/tiny-container | src/main/java/js/net/EventStreamServlet.java | EventStreamServlet.handleRequest | @Override
protected void handleRequest(RequestContext context) throws IOException {
log.trace("handleRequest(RequestContext)");
final HttpServletResponse httpResponse = context.getResponse();
final String sessionID = getEventStreamSessionID(context.getRequestPath());
EventStream eventStream = eventStrea... | java | @Override
protected void handleRequest(RequestContext context) throws IOException {
log.trace("handleRequest(RequestContext)");
final HttpServletResponse httpResponse = context.getResponse();
final String sessionID = getEventStreamSessionID(context.getRequestPath());
EventStream eventStream = eventStrea... | [
"@",
"Override",
"protected",
"void",
"handleRequest",
"(",
"RequestContext",
"context",
")",
"throws",
"IOException",
"{",
"log",
".",
"trace",
"(",
"\"handleRequest(RequestContext)\"",
")",
";",
"final",
"HttpServletResponse",
"httpResponse",
"=",
"context",
".",
... | Create {@link EventStream} for session ID from request URI and run {@link EventStream#loop()} as far it returns true.
This method takes also care to handle connections errors due to network or client failure. At event stream loop exit,
graceful or due to error, unbind event stream from manager.
<p>
If event stream cann... | [
"Create",
"{",
"@link",
"EventStream",
"}",
"for",
"session",
"ID",
"from",
"request",
"URI",
"and",
"run",
"{",
"@link",
"EventStream#loop",
"()",
"}",
"as",
"far",
"it",
"returns",
"true",
".",
"This",
"method",
"takes",
"also",
"care",
"to",
"handle",
... | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/net/EventStreamServlet.java#L68-L112 | test | Override handleRequest in order to handle the HTTP response. | Of course, here is the Java code you requested:
```java
@Override
protected void handleRequest(RequestContext context) throws IOException {
log.trace("handleRequest(RequestContext)");
final HttpServletResponse httpResponse = context.getResponse();
final String sessionID = getEventStreamSessionID(context.get... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/CssDataUriPreProcessor.java | CssDataUriPreProcessor.replaceImageUrl | @Override
protected String replaceImageUrl(final String cssUri, final String imageUrl) {
Validate.notNull(uriLocatorFactory);
LOG.debug("replace url for image: {} from css: {}", imageUrl, cssUri);
final String cleanImageUrl = cleanImageUrl(imageUrl);
final String fileName = FilenameUtils.getName(... | java | @Override
protected String replaceImageUrl(final String cssUri, final String imageUrl) {
Validate.notNull(uriLocatorFactory);
LOG.debug("replace url for image: {} from css: {}", imageUrl, cssUri);
final String cleanImageUrl = cleanImageUrl(imageUrl);
final String fileName = FilenameUtils.getName(... | [
"@",
"Override",
"protected",
"String",
"replaceImageUrl",
"(",
"final",
"String",
"cssUri",
",",
"final",
"String",
"imageUrl",
")",
"{",
"Validate",
".",
"notNull",
"(",
"uriLocatorFactory",
")",
";",
"LOG",
".",
"debug",
"(",
"\"replace url for image: {} from c... | Replace provided url with the new url if needed.
@param imageUrl
to replace.
@param cssUri
Uri of the parsed css.
@return replaced url. | [
"Replace",
"provided",
"url",
"with",
"the",
"new",
"url",
"if",
"needed",
"."
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/CssDataUriPreProcessor.java#L66-L104 | test | Replace image url. | Of course, here is the Java code you requested:
```java
@Override
protected String replaceImageUrl(final String cssUri, final String imageUrl) {
Validate.notNull(uriLocatorFactory);
LOG.debug("replace url for image: {} from css: {}", imageUrl, cssUri);
final String cleanImageUrl = cleanImageUrl(image... |
GojaFramework/goja | goja-web/src/main/java/goja/mvc/kits/Requests.java | Requests.browserInfo | public static String browserInfo(HttpServletRequest req) {
String browserInfo = "other";
String ua = req.getHeader("User-Agent").toLowerCase();
String s;
String version;
String msieP = "msie ([\\d.]+)";
String ieheighP = "rv:([\\d.]+)";
String firefoxP = "firefox\... | java | public static String browserInfo(HttpServletRequest req) {
String browserInfo = "other";
String ua = req.getHeader("User-Agent").toLowerCase();
String s;
String version;
String msieP = "msie ([\\d.]+)";
String ieheighP = "rv:([\\d.]+)";
String firefoxP = "firefox\... | [
"public",
"static",
"String",
"browserInfo",
"(",
"HttpServletRequest",
"req",
")",
"{",
"String",
"browserInfo",
"=",
"\"other\"",
";",
"String",
"ua",
"=",
"req",
".",
"getHeader",
"(",
"\"User-Agent\"",
")",
".",
"toLowerCase",
"(",
")",
";",
"String",
"s... | 获取客户端浏览器信息
@return string | [
"获取客户端浏览器信息"
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/mvc/kits/Requests.java#L47-L125 | test | Gets the browser info. | Of course, here is the Java code you requested:
```java
public static String browserInfo(HttpServletRequest req) {
String browserInfo = "other";
String ua = req.getHeader("User-Agent").toLowerCase();
String s;
String version;
String msieP = "msie ([\\d.]+)";
String iehei... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/DefaultProcessorProvider.java | DefaultProcessorProvider.providePreProcessors | public Map<String, ResourcePreProcessor> providePreProcessors() {
final Map<String, ResourcePreProcessor> map = new HashMap<String, ResourcePreProcessor>();
populateProcessorsMap(map);
return map;
} | java | public Map<String, ResourcePreProcessor> providePreProcessors() {
final Map<String, ResourcePreProcessor> map = new HashMap<String, ResourcePreProcessor>();
populateProcessorsMap(map);
return map;
} | [
"public",
"Map",
"<",
"String",
",",
"ResourcePreProcessor",
">",
"providePreProcessors",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"ResourcePreProcessor",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"ResourcePreProcessor",
">",
"(",
")",
... | {@inheritDoc} | [
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/DefaultProcessorProvider.java#L41-L45 | test | Provide pre processors. | Of course, here is the Java code you requested:
```java
public Map<String, ResourcePreProcessor> providePreProcessors() {
final Map<String, ResourcePreProcessor> map = new HashMap<String, ResourcePreProcessor>();
populateProcessorsMap(map);
return map;
}
```
Hope this helps! |
kocakosm/pitaya | src/org/kocakosm/pitaya/util/Strings.java | Strings.trimRight | public static String trimRight(String str)
{
int end = str.length();
for (int i = str.length() - 1; i >= 0; i--) {
if (str.charAt(i) != ' ') {
break;
}
end--;
}
return str.substring(0, end);
} | java | public static String trimRight(String str)
{
int end = str.length();
for (int i = str.length() - 1; i >= 0; i--) {
if (str.charAt(i) != ' ') {
break;
}
end--;
}
return str.substring(0, end);
} | [
"public",
"static",
"String",
"trimRight",
"(",
"String",
"str",
")",
"{",
"int",
"end",
"=",
"str",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"str",
".",
"length",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")"... | Returns a copy of the given {@code String} with trailing whitespaces
omitted.
@param str the {@code String} to trim.
@return the trimmed {@code String}.
@throws NullPointerException if {@code str} is {@code null}. | [
"Returns",
"a",
"copy",
"of",
"the",
"given",
"{",
"@code",
"String",
"}",
"with",
"trailing",
"whitespaces",
"omitted",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/Strings.java#L467-L477 | test | Trims the right - hand side of a String. | Of course, here is the Java code you requested:
```java
public static String trimRight(String str)
{
int end = str.length();
for (int i = str.length() - 1; i >= 0; i--) {
if (str.charAt(i) != ' ') {
break;
}
end--;
}
return str.substring(0, end);
}
```
Hope this helps! |
algolia/algoliasearch-client-android | algoliasearch/src/offline/java/com/algolia/search/saas/OfflineClient.java | OfflineClient.moveIndexOfflineAsync | public Request moveIndexOfflineAsync(final @NonNull String srcIndexName, final @NonNull String dstIndexName, CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandler, localBuildExecutorService) {
@NonNull
@Override
protected JSONObject run() throws... | java | public Request moveIndexOfflineAsync(final @NonNull String srcIndexName, final @NonNull String dstIndexName, CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandler, localBuildExecutorService) {
@NonNull
@Override
protected JSONObject run() throws... | [
"public",
"Request",
"moveIndexOfflineAsync",
"(",
"final",
"@",
"NonNull",
"String",
"srcIndexName",
",",
"final",
"@",
"NonNull",
"String",
"dstIndexName",
",",
"CompletionHandler",
"completionHandler",
")",
"{",
"return",
"new",
"AsyncTaskRequest",
"(",
"completion... | Move an existing offline index.
**Warning:** This will overwrite the destination index if it exists.
**Note:** This applies both to {@link MirroredIndex} and {@link OfflineIndex} instances.
@param srcIndexName Name of index to move.
@param dstIndexName The new index name.
@param completionHandler The listener that w... | [
"Move",
"an",
"existing",
"offline",
"index",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/OfflineClient.java#L382-L390 | test | Asynchronously move a single index from one index to another. | Of course, here is the Java code you requested:
```java
public Request moveIndexOfflineAsync(final @NonNull String srcIndexName, final @NonNull String dstIndexName, CompletionHandler completionHandler) {
return new AsyncTaskRequest(completionHandler, localBuildExecutorService) {
@NonNull
... |
rest-assured/rest-assured | json-path/src/main/java/io/restassured/path/json/JsonPath.java | JsonPath.param | public JsonPath param(String key, Object value) {
JsonPath newP = new JsonPath(this, config);
if (newP.params == null) {
newP.params = new HashMap<String, Object>();
}
newP.params.put(key, value);
return newP;
} | java | public JsonPath param(String key, Object value) {
JsonPath newP = new JsonPath(this, config);
if (newP.params == null) {
newP.params = new HashMap<String, Object>();
}
newP.params.put(key, value);
return newP;
} | [
"public",
"JsonPath",
"param",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"JsonPath",
"newP",
"=",
"new",
"JsonPath",
"(",
"this",
",",
"config",
")",
";",
"if",
"(",
"newP",
".",
"params",
"==",
"null",
")",
"{",
"newP",
".",
"params",
... | Add a parameter for the expression. Example:
<pre>
String name = System.console().readLine();
List<Map> books = with(Object).param("name", name).get("store.book.findAll { book -> book.author == name }");
</pre>
@param key The name of the parameter. Just use this name in your expression as a variable
@param val... | [
"Add",
"a",
"parameter",
"for",
"the",
"expression",
".",
"Example",
":",
"<pre",
">",
"String",
"name",
"=",
"System",
".",
"console",
"()",
".",
"readLine",
"()",
";",
"List<",
";",
"Map>",
";",
"books",
"=",
"with",
"(",
"Object",
")",
".",
"p... | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/json-path/src/main/java/io/restassured/path/json/JsonPath.java#L629-L636 | test | Add a parameter to the path. | Of course, here is the Java code you requested:
```java
public JsonPath param(String key, Object value) {
JsonPath newP = new JsonPath(this, config);
if (newP.params == null) {
newP.params = new HashMap<String, Object>();
}
newP.params.put(key, value);
return newP;
... |
objectify/objectify | src/main/java/com/googlecode/objectify/Key.java | Key.create | public static <T> Key<T> create(final com.google.cloud.datastore.Key raw) {
if (raw == null)
throw new NullPointerException("Cannot create a Key<?> from a null datastore Key");
return new Key<>(raw);
} | java | public static <T> Key<T> create(final com.google.cloud.datastore.Key raw) {
if (raw == null)
throw new NullPointerException("Cannot create a Key<?> from a null datastore Key");
return new Key<>(raw);
} | [
"public",
"static",
"<",
"T",
">",
"Key",
"<",
"T",
">",
"create",
"(",
"final",
"com",
".",
"google",
".",
"cloud",
".",
"datastore",
".",
"Key",
"raw",
")",
"{",
"if",
"(",
"raw",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\... | Key.create(key) is easier to type than new Key<Blah>(key) | [
"Key",
".",
"create",
"(",
"key",
")",
"is",
"easier",
"to",
"type",
"than",
"new",
"Key<Blah",
">",
"(",
"key",
")"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/Key.java#L26-L31 | test | Creates a Key from a Cloud Datastore Key. | Of course, here is the Java code you requested:
```java
public static <T> Key<T> create(final com.google.cloud.datastore.Key raw) {
if (raw == null)
throw new NullPointerException("Cannot create a Key<?> from a null datastore Key");
return new Key<>(raw);
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/form/Form.java | Form.getFieldValueAsString | @XmlTransient
public String getFieldValueAsString(String fieldNameParam) {
Field fieldWithName = this.getField(fieldNameParam);
return (fieldWithName == null) ? null : fieldWithName.getFieldValueAsString();
} | java | @XmlTransient
public String getFieldValueAsString(String fieldNameParam) {
Field fieldWithName = this.getField(fieldNameParam);
return (fieldWithName == null) ? null : fieldWithName.getFieldValueAsString();
} | [
"@",
"XmlTransient",
"public",
"String",
"getFieldValueAsString",
"(",
"String",
"fieldNameParam",
")",
"{",
"Field",
"fieldWithName",
"=",
"this",
".",
"getField",
"(",
"fieldNameParam",
")",
";",
"return",
"(",
"fieldWithName",
"==",
"null",
")",
"?",
"null",
... | <p>
Returns the value of the {@code fieldNameParam} requested.
<p>
The {@code fieldNameParam} <b>is not</b> case sensitive.
<p>
A {@code null} will be returned if;
<ul>
<li>{@code fieldNameParam} is {@code null} or empty.</li>
<li>{@code getFormFields()} is {@code null} or empty.</li>
<li>Field is not found by {@code... | [
"<p",
">",
"Returns",
"the",
"value",
"of",
"the",
"{",
"@code",
"fieldNameParam",
"}",
"requested",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/form/Form.java#L437-L441 | test | Gets the value of the field with the given name as a String. | Of course, here is the Java code you requested:
```java
@XmlTransient
public String getFieldValueAsString(String fieldNameParam) {
Field fieldWithName = this.getField(fieldNameParam);
return (fieldWithName == null) ? null : fieldWithName.getFieldValueAsString();
}
```
Hope this helps! |
spring-projects/spring-security | messaging/src/main/java/org/springframework/security/messaging/context/AuthenticationPrincipalArgumentResolver.java | AuthenticationPrincipalArgumentResolver.resolveArgument | public Object resolveArgument(MethodParameter parameter, Message<?> message)
throws Exception {
Authentication authentication = SecurityContextHolder.getContext()
.getAuthentication();
if (authentication == null) {
return null;
}
Object principal = authentication.getPrincipal();
AuthenticationPrinc... | java | public Object resolveArgument(MethodParameter parameter, Message<?> message)
throws Exception {
Authentication authentication = SecurityContextHolder.getContext()
.getAuthentication();
if (authentication == null) {
return null;
}
Object principal = authentication.getPrincipal();
AuthenticationPrinc... | [
"public",
"Object",
"resolveArgument",
"(",
"MethodParameter",
"parameter",
",",
"Message",
"<",
"?",
">",
"message",
")",
"throws",
"Exception",
"{",
"Authentication",
"authentication",
"=",
"SecurityContextHolder",
".",
"getContext",
"(",
")",
".",
"getAuthenticat... | /*
(non-Javadoc)
@see
org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver#
resolveArgument(org.springframework.core.MethodParameter,
org.springframework.messaging.Message) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/messaging/src/main/java/org/springframework/security/messaging/context/AuthenticationPrincipalArgumentResolver.java#L108-L141 | test | Resolves the argument of the given method parameter. | Of course, here is the Java code you requested:
```java
public Object resolveArgument(MethodParameter parameter, Message<?> message)
throws Exception {
Authentication authentication = SecurityContextHolder.getContext()
.getAuthentication();
if (authentication == null) {
return null;
}
Object principa... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/ContainerStream.java | ContainerStream.findTimeStampEntryInIndex | public IndexEntry findTimeStampEntryInIndex(long wantedTimeStamp, int flags) {
long cPtr = VideoJNI.ContainerStream_findTimeStampEntryInIndex(swigCPtr, this, wantedTimeStamp, flags);
return (cPtr == 0) ? null : new IndexEntry(cPtr, false);
} | java | public IndexEntry findTimeStampEntryInIndex(long wantedTimeStamp, int flags) {
long cPtr = VideoJNI.ContainerStream_findTimeStampEntryInIndex(swigCPtr, this, wantedTimeStamp, flags);
return (cPtr == 0) ? null : new IndexEntry(cPtr, false);
} | [
"public",
"IndexEntry",
"findTimeStampEntryInIndex",
"(",
"long",
"wantedTimeStamp",
",",
"int",
"flags",
")",
"{",
"long",
"cPtr",
"=",
"VideoJNI",
".",
"ContainerStream_findTimeStampEntryInIndex",
"(",
"swigCPtr",
",",
"this",
",",
"wantedTimeStamp",
",",
"flags",
... | Search for the given time stamp in the key-frame index for this Stream.<br>
<p><br>
Not all ContainerFormat implementations<br>
maintain key frame indexes, but if they have one,<br>
then this method searches in the Stream index<br>
to quickly find the byte-offset of the nearest key-frame to<br>
the given time stamp.<br... | [
"Search",
"for",
"the",
"given",
"time",
"stamp",
"in",
"the",
"key",
"-",
"frame",
"index",
"for",
"this",
"Stream",
".",
"<br",
">",
"<p",
">",
"<br",
">",
"Not",
"all",
"ContainerFormat",
"implementations<br",
">",
"maintain",
"key",
"frame",
"indexes",... | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/ContainerStream.java#L328-L331 | test | Returns the index entry for the given timestamp. | Of course, here is the Java code you requested:
```java
public IndexEntry findTimeStampEntryInIndex(long wantedTimeStamp, int flags) {
long cPtr = VideoJNI.ContainerStream_findTimeStampEntryInIndex(swigCPtr, this, wantedTimeStamp, flags);
return (cPtr == 0) ? null : new IndexEntry(cPtr, false);
}
```
Hope t... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/NetcdfFile.java | NetcdfFile.readToByteChannel | protected long readToByteChannel(ucar.nc2.Variable v, Section section, WritableByteChannel wbc)
throws java.io.IOException, ucar.ma2.InvalidRangeException {
//if (unlocked)
// throw new IllegalStateException("File is unlocked - cannot use");
if ((spi == null) || v.hasCachedData())
return ... | java | protected long readToByteChannel(ucar.nc2.Variable v, Section section, WritableByteChannel wbc)
throws java.io.IOException, ucar.ma2.InvalidRangeException {
//if (unlocked)
// throw new IllegalStateException("File is unlocked - cannot use");
if ((spi == null) || v.hasCachedData())
return ... | [
"protected",
"long",
"readToByteChannel",
"(",
"ucar",
".",
"nc2",
".",
"Variable",
"v",
",",
"Section",
"section",
",",
"WritableByteChannel",
"wbc",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"ucar",
".",
"ma2",
".",
"InvalidRangeException",
... | Read data from a top level Variable and send data to a WritableByteChannel. Experimental.
@param v a top-level Variable
@param section the section of data to read.
There must be a Range for each Dimension in the variable, in order.
Note: no nulls allowed. IOSP may not modify.
@param wbc write data to this Wr... | [
"Read",
"data",
"from",
"a",
"top",
"level",
"Variable",
"and",
"send",
"data",
"to",
"a",
"WritableByteChannel",
".",
"Experimental",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L2139-L2149 | test | read to byte channel | Of course, here is the Java code you requested:
```java
protected long readToByteChannel(ucar.nc2.Variable v, Section section, WritableByteChannel wbc)
throws java.io.IOException, ucar.ma2.InvalidRangeException {
//if (unlocked)
// throw new IllegalStateException("File is unlocked - cannot use");
... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java | ObjectFactory.createEndeBietzeit | @XmlElementDecl(namespace = "", name = "ende_bietzeit")
@XmlJavaTypeAdapter(Adapter4 .class)
public JAXBElement<Calendar> createEndeBietzeit(Calendar value) {
return new JAXBElement<Calendar>(_EndeBietzeit_QNAME, Calendar.class, null, value);
} | java | @XmlElementDecl(namespace = "", name = "ende_bietzeit")
@XmlJavaTypeAdapter(Adapter4 .class)
public JAXBElement<Calendar> createEndeBietzeit(Calendar value) {
return new JAXBElement<Calendar>(_EndeBietzeit_QNAME, Calendar.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"\"",
",",
"name",
"=",
"\"ende_bietzeit\"",
")",
"@",
"XmlJavaTypeAdapter",
"(",
"Adapter4",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"Calendar",
">",
"createEndeBietzeit",
"(",
"Calendar",
"value",
")",
... | Create an instance of {@link JAXBElement }{@code <}{@link Calendar }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"Calendar",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2557-L2561 | test | Create an instance of a calendar in the ENDE_Bietzeit namespace. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "", name = "ende_bietzeit")
@XmlJavaTypeAdapter(Adapter4 .class)
public JAXBElement<Calendar> createEndeBietzeit(Calendar value) {
return new JAXBElement<Calendar>(_EndeBietzeit_QNAME, Calendar.class, null, value);
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java | OSelectExecutionPlanner.getServersThatHasAllClusters | private Set<String> getServersThatHasAllClusters(Map<String, Set<String>> clusterMap, Set<String> queryClusters) {
Set<String> remainingServers = clusterMap.keySet();
for (String cluster : queryClusters) {
for (Map.Entry<String, Set<String>> serverConfig : clusterMap.entrySet()) {
if (!serverConfi... | java | private Set<String> getServersThatHasAllClusters(Map<String, Set<String>> clusterMap, Set<String> queryClusters) {
Set<String> remainingServers = clusterMap.keySet();
for (String cluster : queryClusters) {
for (Map.Entry<String, Set<String>> serverConfig : clusterMap.entrySet()) {
if (!serverConfi... | [
"private",
"Set",
"<",
"String",
">",
"getServersThatHasAllClusters",
"(",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"clusterMap",
",",
"Set",
"<",
"String",
">",
"queryClusters",
")",
"{",
"Set",
"<",
"String",
">",
"remainingServers",
"=... | @param clusterMap the cluster map for current sharding configuration
@param queryClusters the clusters that are target of the query
@return | [
"@param",
"clusterMap",
"the",
"cluster",
"map",
"for",
"current",
"sharding",
"configuration",
"@param",
"queryClusters",
"the",
"clusters",
"that",
"are",
"target",
"of",
"the",
"query"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java#L312-L322 | test | Get servers that have all clusters | Of course, here is the Java code you requested:
```java
private Set<String> getServersThatHasAllClusters(Map<String, Set<String>> clusterMap, Set<String> queryClusters) {
Set<String> remainingServers = clusterMap.keySet();
for (String cluster : queryClusters) {
for (Map.Entry<String, Set<String>> serverC... |
boonproject/boon | boon/src/main/java/org/boon/primitive/Lng.java | Lng.median | public static long median(long[] values, final int start, final int length) {
long[] sorted = new long[length];
System.arraycopy(values, start, sorted, 0, length);
Arrays.sort(sorted);
if (length % 2 == 0) {
int middle = sorted.length / 2;
double median = (sorted... | java | public static long median(long[] values, final int start, final int length) {
long[] sorted = new long[length];
System.arraycopy(values, start, sorted, 0, length);
Arrays.sort(sorted);
if (length % 2 == 0) {
int middle = sorted.length / 2;
double median = (sorted... | [
"public",
"static",
"long",
"median",
"(",
"long",
"[",
"]",
"values",
",",
"final",
"int",
"start",
",",
"final",
"int",
"length",
")",
"{",
"long",
"[",
"]",
"sorted",
"=",
"new",
"long",
"[",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
... | Calculate Median
@param values values
@param start start
@param length length
@return median | [
"Calculate",
"Median"
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/primitive/Lng.java#L1110-L1122 | test | Get the median value. | Of course, here is the Java code you requested:
```java
public static long median(long[] values, final int start, final int length) {
long[] sorted = new long[length];
System.arraycopy(values, start, sorted, 0, length);
Arrays.sort(sorted);
if (length % 2 == 0) {
int middle... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_1.java | OpenImmo_1_2_1.upgradeFromPreviousVersion | @Override
@SuppressWarnings("Duplicates")
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.upgradeEnergiepassElements(doc.getDocument());
... | java | @Override
@SuppressWarnings("Duplicates")
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.upgradeEnergiepassElements(doc.getDocument());
... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"Duplicates\"",
")",
"public",
"void",
"upgradeFromPreviousVersion",
"(",
"OpenImmoDocument",
"doc",
")",
"{",
"doc",
".",
"setDocumentVersion",
"(",
"OpenImmoVersion",
".",
"V1_2_1",
")",
";",
"if",
"(",
"doc",
"... | Upgrade an OpenImmo document from version 1.2.0 to 1.2.1.
@param doc OpenImmo document in version 1.2.0 | [
"Upgrade",
"an",
"OpenImmo",
"document",
"from",
"version",
"1",
".",
"2",
".",
"0",
"to",
"1",
".",
"2",
".",
"1",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_1.java#L94-L114 | test | Upgrade from the previous version of the document. | Of course, here is the Java code you requested:
```java
@Override
@SuppressWarnings("Duplicates")
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_1);
if (doc instanceof OpenImmoTransferDocument) {
try {
this... |
boonproject/boon | boon/src/main/java/org/boon/core/reflection/Annotations.java | Annotations.extractValidationAnnotationData | public static List<AnnotationData> extractValidationAnnotationData(
Annotation[] annotations, Set<String> allowedPackages ) {
List<AnnotationData> annotationsList = new ArrayList<>();
for ( Annotation annotation : annotations ) {
AnnotationData annotationData = new AnnotationData... | java | public static List<AnnotationData> extractValidationAnnotationData(
Annotation[] annotations, Set<String> allowedPackages ) {
List<AnnotationData> annotationsList = new ArrayList<>();
for ( Annotation annotation : annotations ) {
AnnotationData annotationData = new AnnotationData... | [
"public",
"static",
"List",
"<",
"AnnotationData",
">",
"extractValidationAnnotationData",
"(",
"Annotation",
"[",
"]",
"annotations",
",",
"Set",
"<",
"String",
">",
"allowedPackages",
")",
"{",
"List",
"<",
"AnnotationData",
">",
"annotationsList",
"=",
"new",
... | Create an annotation data list.
@param annotations list of annotation.
@return | [
"Create",
"an",
"annotation",
"data",
"list",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/core/reflection/Annotations.java#L273-L283 | test | Extract validation annotation data. | Of course, here is the Java code you requested:
```java
public static List<AnnotationData> extractValidationAnnotationData(
Annotation[] annotations, Set<String> allowedPackages ) {
List<AnnotationData> annotationsList = new ArrayList<>();
for ( Annotation annotation : annotations ) {
... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/UserNotificationClient.java | UserNotificationClient.getUserNotificationById | public UserNotification getUserNotificationById(
Long userNotificationPkParam)
{
UserNotification userNoti = new UserNotification();
userNoti.setId(userNotificationPkParam);
if(this.serviceTicket != null)
{
userNoti.setServiceTicket(this.serviceTicket);
}
try {
return new UserNotification(this.p... | java | public UserNotification getUserNotificationById(
Long userNotificationPkParam)
{
UserNotification userNoti = new UserNotification();
userNoti.setId(userNotificationPkParam);
if(this.serviceTicket != null)
{
userNoti.setServiceTicket(this.serviceTicket);
}
try {
return new UserNotification(this.p... | [
"public",
"UserNotification",
"getUserNotificationById",
"(",
"Long",
"userNotificationPkParam",
")",
"{",
"UserNotification",
"userNoti",
"=",
"new",
"UserNotification",
"(",
")",
";",
"userNoti",
".",
"setId",
"(",
"userNotificationPkParam",
")",
";",
"if",
"(",
"... | Deletes the {@code UserNotification} provided.
Id must be set on the {@code UserNotification}.
@param userNotificationPkParam The Id of the User Notification to fetch.
@return The User Notification by PK. | [
"Deletes",
"the",
"{",
"@code",
"UserNotification",
"}",
"provided",
".",
"Id",
"must",
"be",
"set",
"on",
"the",
"{",
"@code",
"UserNotification",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/UserNotificationClient.java#L173-L193 | test | Get UserNotification by id | Of course, here is the Java code you requested:
```java
public UserNotification getUserNotificationById(
Long userNotificationPkParam)
{
UserNotification userNoti = new UserNotification();
userNoti.setId(userNotificationPkParam);
if(this.serviceTicket != null)
{
userNoti.setServiceTicket(this.serviceTi... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java | OSelectExecutionPlanner.translateDistinct | protected static OProjection translateDistinct(OProjection projection) {
if (projection != null && projection.getItems().size() == 1) {
if (isDistinct(projection.getItems().get(0))) {
projection = projection.copy();
OProjectionItem item = projection.getItems().get(0);
OFunctionCall fun... | java | protected static OProjection translateDistinct(OProjection projection) {
if (projection != null && projection.getItems().size() == 1) {
if (isDistinct(projection.getItems().get(0))) {
projection = projection.copy();
OProjectionItem item = projection.getItems().get(0);
OFunctionCall fun... | [
"protected",
"static",
"OProjection",
"translateDistinct",
"(",
"OProjection",
"projection",
")",
"{",
"if",
"(",
"projection",
"!=",
"null",
"&&",
"projection",
".",
"getItems",
"(",
")",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"if",
"(",
"isDistinct"... | for backward compatibility, translate "distinct(foo)" to "DISTINCT foo". This method modifies the projection itself.
@param projection the projection | [
"for",
"backward",
"compatibility",
"translate",
"distinct",
"(",
"foo",
")",
"to",
"DISTINCT",
"foo",
".",
"This",
"method",
"modifies",
"the",
"projection",
"itself",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java#L435-L454 | test | Translate a distinct projection to a single projection. | Of course, here is the Java code you requested:
```java
protected static OProjection translateDistinct(OProjection projection) {
if (projection != null && projection.getItems().size() == 1) {
if (isDistinct(projection.getItems().get(0))) {
projection = projection.copy();
OProjectionItem item ... |
subchen/jetbrick-all-1x | jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java | StringUtils.left | public static String left(final String s, final int len) {
if (s == null) {
return null;
}
if (len < 0) {
return "";
}
if (s.length() <= len) {
return s;
}
return s.substring(0, len);
} | java | public static String left(final String s, final int len) {
if (s == null) {
return null;
}
if (len < 0) {
return "";
}
if (s.length() <= len) {
return s;
}
return s.substring(0, len);
} | [
"public",
"static",
"String",
"left",
"(",
"final",
"String",
"s",
",",
"final",
"int",
"len",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"len",
"<",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",... | <p>
Gets the leftmost {@code len} characters of a String.
</p>
<p>
If {@code len} characters are not available, or the String is
{@code null}, the String will be returned without an exception. An empty
String is returned if len is negative.
</p>
<pre>
StringUtils.left(null, *) = null
StringUtils.left(*, -ve) =... | [
"<p",
">",
"Gets",
"the",
"leftmost",
"{",
"@code",
"len",
"}",
"characters",
"of",
"a",
"String",
".",
"<",
"/",
"p",
">"
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java#L1449-L1460 | test | Left method. | Of course, here is the Java code you requested:
```java
public static String left(final String s, final int len) {
if (s == null) {
return null;
}
if (len < 0) {
return "";
}
if (s.length() <= len) {
return s;
}
return s.substr... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java | HTMLLayoutBase.getFileHeader | @Override
public String getFileHeader() {
StringBuilder sbuf = new StringBuilder();
sbuf.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"");
sbuf.append(" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
sbuf.append(LINE_SEPARATOR);
sbuf.append("<html>");
sbuf.append... | java | @Override
public String getFileHeader() {
StringBuilder sbuf = new StringBuilder();
sbuf.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"");
sbuf.append(" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
sbuf.append(LINE_SEPARATOR);
sbuf.append("<html>");
sbuf.append... | [
"@",
"Override",
"public",
"String",
"getFileHeader",
"(",
")",
"{",
"StringBuilder",
"sbuf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Strict//EN\\\"\"",
")",
";",
"sbuf",
".",
"append... | Returns appropriate HTML headers.
@return the headers | [
"Returns",
"appropriate",
"HTML",
"headers",
"."
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java#L165-L189 | test | Get the file header. | Of course, here is the Java code you requested:
```java
@Override
public String getFileHeader() {
StringBuilder sbuf = new StringBuilder();
sbuf.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"");
sbuf.append(" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
sbuf.append(LI... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/DataSetUtil.java | DataSetUtil.merge2d | public static Pair<INDArray, INDArray> merge2d(INDArray[] arrays, INDArray[] masks) {
long cols = arrays[0].columns();
INDArray[] temp = new INDArray[arrays.length];
boolean hasMasks = false;
for (int i = 0; i < arrays.length; i++) {
if (arrays[i].columns() != cols) {
... | java | public static Pair<INDArray, INDArray> merge2d(INDArray[] arrays, INDArray[] masks) {
long cols = arrays[0].columns();
INDArray[] temp = new INDArray[arrays.length];
boolean hasMasks = false;
for (int i = 0; i < arrays.length; i++) {
if (arrays[i].columns() != cols) {
... | [
"public",
"static",
"Pair",
"<",
"INDArray",
",",
"INDArray",
">",
"merge2d",
"(",
"INDArray",
"[",
"]",
"arrays",
",",
"INDArray",
"[",
"]",
"masks",
")",
"{",
"long",
"cols",
"=",
"arrays",
"[",
"0",
"]",
".",
"columns",
"(",
")",
";",
"INDArray",
... | Merge the specified 2d arrays and masks. See {@link #mergeFeatures(INDArray[], INDArray[])}
and {@link #mergeLabels(INDArray[], INDArray[])}
@param arrays Arrays to merge
@param masks Mask arrays to merge
@return Merged arrays and mask | [
"Merge",
"the",
"specified",
"2d",
"arrays",
"and",
"masks",
".",
"See",
"{",
"@link",
"#mergeFeatures",
"(",
"INDArray",
"[]",
"INDArray",
"[]",
")",
"}",
"and",
"{",
"@link",
"#mergeLabels",
"(",
"INDArray",
"[]",
"INDArray",
"[]",
")",
"}"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/DataSetUtil.java#L283-L308 | test | Merge 2d arrays with masks | Of course, here is the Java code you requested:
```java
public static Pair<INDArray, INDArray> merge2d(INDArray[] arrays, INDArray[] masks) {
long cols = arrays[0].columns();
INDArray[] temp = new INDArray[arrays.length];
boolean hasMasks = false;
for (int i = 0; i < arrays.length; i++... |
hawkular/hawkular-metrics | core/metrics-core-service/src/main/java/org/hawkular/metrics/core/service/MetricsServiceImpl.java | MetricsServiceImpl.verifyAndCreateTempTables | public void verifyAndCreateTempTables() {
ZonedDateTime currentBlock = ZonedDateTime.ofInstant(Instant.ofEpochMilli(DateTimeService.now.get().getMillis()), UTC)
.with(DateTimeService.startOfPreviousEvenHour());
ZonedDateTime lastStartupBlock = currentBlock.plus(6, ChronoUnit.HOURS);
... | java | public void verifyAndCreateTempTables() {
ZonedDateTime currentBlock = ZonedDateTime.ofInstant(Instant.ofEpochMilli(DateTimeService.now.get().getMillis()), UTC)
.with(DateTimeService.startOfPreviousEvenHour());
ZonedDateTime lastStartupBlock = currentBlock.plus(6, ChronoUnit.HOURS);
... | [
"public",
"void",
"verifyAndCreateTempTables",
"(",
")",
"{",
"ZonedDateTime",
"currentBlock",
"=",
"ZonedDateTime",
".",
"ofInstant",
"(",
"Instant",
".",
"ofEpochMilli",
"(",
"DateTimeService",
".",
"now",
".",
"get",
"(",
")",
".",
"getMillis",
"(",
")",
")... | Intended to be used at the startup of the MetricsServiceImpl to ensure we have enough tables for processing | [
"Intended",
"to",
"be",
"used",
"at",
"the",
"startup",
"of",
"the",
"MetricsServiceImpl",
"to",
"ensure",
"we",
"have",
"enough",
"tables",
"for",
"processing"
] | 6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c | https://github.com/hawkular/hawkular-metrics/blob/6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c/core/metrics-core-service/src/main/java/org/hawkular/metrics/core/service/MetricsServiceImpl.java#L743-L749 | test | Verify and create temp tables. | Of course, here is the Java code you requested:
```java
public void verifyAndCreateTempTables() {
ZonedDateTime currentBlock = ZonedDateTime.ofInstant(Instant.ofEpochMilli(DateTimeService.now.get().getMillis()), UTC)
.with(DateTimeService.startOfPreviousEvenHour());
ZonedDateTime lastS... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/InterfaceDefImpl.java | InterfaceDefImpl.lookup | public Contained lookup(String search_name) {
Contained res = delegate.lookup(search_name);
return res;
} | java | public Contained lookup(String search_name) {
Contained res = delegate.lookup(search_name);
return res;
} | [
"public",
"Contained",
"lookup",
"(",
"String",
"search_name",
")",
"{",
"Contained",
"res",
"=",
"delegate",
".",
"lookup",
"(",
"search_name",
")",
";",
"return",
"res",
";",
"}"
] | ContainerOperations implementation ---------------------------- | [
"ContainerOperations",
"implementation",
"----------------------------"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/InterfaceDefImpl.java#L136-L139 | test | Lookup a resource in the cache. | Of course, here is the Java code you requested:
```java
public Contained lookup(String search_name) {
Contained res = delegate.lookup(search_name);
return res;
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/dataobjects/CachedCells.java | CachedCells.put | public final void put(final Cell cell, final String originFormula) {
Map<Cell, FormulaMapping> map = cachedMap;
// if cellType not null then only specified Type will be put into Cache
// e.g. only formula cell will be cached then pass in
// Cell.CELL_TYPE_FORMULA
if ((cell != null) && (originFormula != n... | java | public final void put(final Cell cell, final String originFormula) {
Map<Cell, FormulaMapping> map = cachedMap;
// if cellType not null then only specified Type will be put into Cache
// e.g. only formula cell will be cached then pass in
// Cell.CELL_TYPE_FORMULA
if ((cell != null) && (originFormula != n... | [
"public",
"final",
"void",
"put",
"(",
"final",
"Cell",
"cell",
",",
"final",
"String",
"originFormula",
")",
"{",
"Map",
"<",
"Cell",
",",
"FormulaMapping",
">",
"map",
"=",
"cachedMap",
";",
"// if cellType not null then only specified Type will be put into Cache\r"... | Put.
@param cell
the cell
@param originFormula
the origin formula | [
"Put",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/dataobjects/CachedCells.java#L81-L98 | test | Put a
mapping into the cache. | Of course, here is the Java code you requested:
```java
public final void put(final Cell cell, final String originFormula) {
Map<Cell, FormulaMapping> map = cachedMap;
// if cellType not null then only specified Type will be put into Cache
// e.g. only formula cell will be cached then pass in
// Cell.CELL_... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java | BaseLevel1.axpy | @Override
public void axpy(long n, double alpha, INDArray x, INDArray y) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, x, y);
if (x.isSparse() && !y.isSparse()) {
Nd4j.getSparseBlasWrapper(... | java | @Override
public void axpy(long n, double alpha, INDArray x, INDArray y) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, x, y);
if (x.isSparse() && !y.isSparse()) {
Nd4j.getSparseBlasWrapper(... | [
"@",
"Override",
"public",
"void",
"axpy",
"(",
"long",
"n",
",",
"double",
"alpha",
",",
"INDArray",
"x",
",",
"INDArray",
"y",
")",
"{",
"if",
"(",
"Nd4j",
".",
"getExecutioner",
"(",
")",
".",
"getProfilingMode",
"(",
")",
"==",
"OpExecutioner",
"."... | computes a vector-scalar product and adds the result to a vector.
@param n
@param alpha
@param x
@param y | [
"computes",
"a",
"vector",
"-",
"scalar",
"product",
"and",
"adds",
"the",
"result",
"to",
"a",
"vector",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel1.java#L395-L413 | test | A simple axpy operation | Of course, here is the Java code you requested:
```java
@Override
public void axpy(long n, double alpha, INDArray x, INDArray y) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, x, y);
if (x.isSparse() &... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/proxetta/asm/HistoryMethodAdapter.java | HistoryMethodAdapter.getArgumentIndex | protected int getArgumentIndex() {
if (!isPrevious) {
throw new ProxettaException("Unexpected previous instruction type used for setting argument index");
}
int argIndex;
switch (opcode) {
case ICONST_0: argIndex = 0; break;
case ICONST_1: argIndex = 1; break;
case ICONST_2: argIndex = 2; break;
... | java | protected int getArgumentIndex() {
if (!isPrevious) {
throw new ProxettaException("Unexpected previous instruction type used for setting argument index");
}
int argIndex;
switch (opcode) {
case ICONST_0: argIndex = 0; break;
case ICONST_1: argIndex = 1; break;
case ICONST_2: argIndex = 2; break;
... | [
"protected",
"int",
"getArgumentIndex",
"(",
")",
"{",
"if",
"(",
"!",
"isPrevious",
")",
"{",
"throw",
"new",
"ProxettaException",
"(",
"\"Unexpected previous instruction type used for setting argument index\"",
")",
";",
"}",
"int",
"argIndex",
";",
"switch",
"(",
... | Returns argument index from the history.
<b>Must</b> POP value from the stack after the execution. | [
"Returns",
"argument",
"index",
"from",
"the",
"history",
".",
"<b",
">",
"Must<",
"/",
"b",
">",
"POP",
"value",
"from",
"the",
"stack",
"after",
"the",
"execution",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/asm/HistoryMethodAdapter.java#L70-L89 | test | Returns the argument index for this instruction. | Of course, here is the Java code you requested:
```java
protected int getArgumentIndex() {
if (!isPrevious) {
throw new ProxettaException("Unexpected previous instruction type used for setting argument index");
}
int argIndex;
switch (opcode) {
case ICONST_0: argIndex = 0; break;
case ICONST_1: argInd... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java | ABaseClientWS.deleteJson | protected JSONObject deleteJson(
boolean checkConnectionValidParam,
ABaseFluidJSONObject baseDomainParam,
String postfixUrlParam) {
return this.executeJson(
HttpMethod.DELETE,
null,
checkConnectionValidParam,
baseDomainParam,
ContentType.APPLICATION_JSON,
postfixUrlParam);
} | java | protected JSONObject deleteJson(
boolean checkConnectionValidParam,
ABaseFluidJSONObject baseDomainParam,
String postfixUrlParam) {
return this.executeJson(
HttpMethod.DELETE,
null,
checkConnectionValidParam,
baseDomainParam,
ContentType.APPLICATION_JSON,
postfixUrlParam);
} | [
"protected",
"JSONObject",
"deleteJson",
"(",
"boolean",
"checkConnectionValidParam",
",",
"ABaseFluidJSONObject",
"baseDomainParam",
",",
"String",
"postfixUrlParam",
")",
"{",
"return",
"this",
".",
"executeJson",
"(",
"HttpMethod",
".",
"DELETE",
",",
"null",
",",
... | Performs an HTTP-DELETE request with {@code postfixUrlParam}.
@param checkConnectionValidParam Check if connection to base endpoint is valid.
@param baseDomainParam The base domain to convert to JSON and DELETE
to {@code this} endpoint.
@param postfixUrlParam URL mapping after the Base endpoint.
@return Return body as... | [
"Performs",
"an",
"HTTP",
"-",
"DELETE",
"request",
"with",
"{",
"@code",
"postfixUrlParam",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java#L498-L510 | test | Delete a JSON object from the server. | Of course, here is the Java code you requested:
```java
protected JSONObject deleteJson(
boolean checkConnectionValidParam,
ABaseFluidJSONObject baseDomainParam,
String postfixUrlParam) {
return this.executeJson(
HttpMethod.DELETE,
null,
checkConnectionValidParam,
baseDomainParam,
Conte... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Index.java | Index.setSettingsAsync | public Request setSettingsAsync(final @NonNull JSONObject settings, final boolean forwardToReplicas, @Nullable final RequestOptions requestOptions, @Nullable CompletionHandler completionHandler) {
return getClient().new AsyncTaskRequest(completionHandler) {
@NonNull
@Override protected J... | java | public Request setSettingsAsync(final @NonNull JSONObject settings, final boolean forwardToReplicas, @Nullable final RequestOptions requestOptions, @Nullable CompletionHandler completionHandler) {
return getClient().new AsyncTaskRequest(completionHandler) {
@NonNull
@Override protected J... | [
"public",
"Request",
"setSettingsAsync",
"(",
"final",
"@",
"NonNull",
"JSONObject",
"settings",
",",
"final",
"boolean",
"forwardToReplicas",
",",
"@",
"Nullable",
"final",
"RequestOptions",
"requestOptions",
",",
"@",
"Nullable",
"CompletionHandler",
"completionHandle... | Set this index's settings (asynchronously).
<p>
Please refer to our <a href="https://www.algolia.com/doc/android#index-settings">API documentation</a> for the
list of supported settings.
@param settings New settings.
@param requestOptions Request-specific options.
@param completionHandler The listener that... | [
"Set",
"this",
"index",
"s",
"settings",
"(",
"asynchronously",
")",
".",
"<p",
">",
"Please",
"refer",
"to",
"our",
"<a",
"href",
"=",
"https",
":",
"//",
"www",
".",
"algolia",
".",
"com",
"/",
"doc",
"/",
"android#index",
"-",
"settings",
">",
"AP... | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L861-L868 | test | Asynchronously sets the settings of a single class. | Of course, here is the Java code you requested:
```java
public Request setSettingsAsync(final @NonNull JSONObject settings, final boolean forwardToReplicas, @Nullable final RequestOptions requestOptions, @Nullable CompletionHandler completionHandler) {
return getClient().new AsyncTaskRequest(completionHandler)... |
oblac/jodd | jodd-servlet/src/main/java/jodd/servlet/tag/TagUtil.java | TagUtil.setScopeAttribute | public static void setScopeAttribute(final String name, final Object value, final String scope, final PageContext pageContext) throws JspException {
try {
ServletUtil.setScopeAttribute(name, value, scope, pageContext);
} catch (UncheckedException uex) {
throw new JspException(uex);
}
} | java | public static void setScopeAttribute(final String name, final Object value, final String scope, final PageContext pageContext) throws JspException {
try {
ServletUtil.setScopeAttribute(name, value, scope, pageContext);
} catch (UncheckedException uex) {
throw new JspException(uex);
}
} | [
"public",
"static",
"void",
"setScopeAttribute",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
",",
"final",
"String",
"scope",
",",
"final",
"PageContext",
"pageContext",
")",
"throws",
"JspException",
"{",
"try",
"{",
"ServletUtil",
".",
"... | Sets scope attribute. | [
"Sets",
"scope",
"attribute",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/tag/TagUtil.java#L93-L99 | test | Sets the value of a scope attribute. | Of course, here is the Java code you requested:
```java
public static void setScopeAttribute(final String name, final Object value, final String scope, final PageContext pageContext) throws JspException {
try {
ServletUtil.setScopeAttribute(name, value, scope, pageContext);
} catch (UncheckedException uex) {
... |
wro4j/wro4j | wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/js/AbstractLinterProcessor.java | AbstractLinterProcessor.onLinterException | protected void onLinterException(final LinterException e, final Resource resource) {
LOG.error("The following resource: " + resource + " has " + e.getErrors().size() + " errors.", e);
} | java | protected void onLinterException(final LinterException e, final Resource resource) {
LOG.error("The following resource: " + resource + " has " + e.getErrors().size() + " errors.", e);
} | [
"protected",
"void",
"onLinterException",
"(",
"final",
"LinterException",
"e",
",",
"final",
"Resource",
"resource",
")",
"{",
"LOG",
".",
"error",
"(",
"\"The following resource: \"",
"+",
"resource",
"+",
"\" has \"",
"+",
"e",
".",
"getErrors",
"(",
")",
"... | Called when {@link LinterException} is thrown. Allows subclasses to re-throw this exception as a
{@link RuntimeException} or handle it differently. The default implementation simply logs the errors.
@param e {@link LinterException} which has occurred.
@param resource the processed resource which caused the exception. | [
"Called",
"when",
"{",
"@link",
"LinterException",
"}",
"is",
"thrown",
".",
"Allows",
"subclasses",
"to",
"re",
"-",
"throw",
"this",
"exception",
"as",
"a",
"{",
"@link",
"RuntimeException",
"}",
"or",
"handle",
"it",
"differently",
".",
"The",
"default",
... | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/js/AbstractLinterProcessor.java#L99-L101 | test | On inter exception. | Of course, here is the Java code you requested:
```java
protected void onLinterException(final LinterException e, final Resource resource) {
LOG.error("The following resource: " + resource + " has " + e.getErrors().size() + " errors.", e);
}
```
Hope this helps! |
Netflix/hollow | hollow/src/main/java/com/netflix/hollow/core/read/engine/object/HollowObjectTypeReadStateShard.java | HollowObjectTypeReadStateShard.bitsRequiredForField | public int bitsRequiredForField(String fieldName) {
int fieldIndex = schema.getPosition(fieldName);
return fieldIndex == -1 ? 0 : currentDataVolatile.bitsPerField[fieldIndex];
} | java | public int bitsRequiredForField(String fieldName) {
int fieldIndex = schema.getPosition(fieldName);
return fieldIndex == -1 ? 0 : currentDataVolatile.bitsPerField[fieldIndex];
} | [
"public",
"int",
"bitsRequiredForField",
"(",
"String",
"fieldName",
")",
"{",
"int",
"fieldIndex",
"=",
"schema",
".",
"getPosition",
"(",
"fieldName",
")",
";",
"return",
"fieldIndex",
"==",
"-",
"1",
"?",
"0",
":",
"currentDataVolatile",
".",
"bitsPerField"... | Warning: Not thread-safe. Should only be called within the update thread. | [
"Warning",
":",
"Not",
"thread",
"-",
"safe",
".",
"Should",
"only",
"be",
"called",
"within",
"the",
"update",
"thread",
"."
] | 43ca100034a01050fb764170bd32b085ac9a3c22 | https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/read/engine/object/HollowObjectTypeReadStateShard.java#L301-L304 | test | Returns the number of bits required for a field. | Of course, here is the Java code you requested:
```java
public int bitsRequiredForField(String fieldName) {
int fieldIndex = schema.getPosition(fieldName);
return fieldIndex == -1 ? 0 : currentDataVolatile.bitsPerField[fieldIndex];
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java | RelatedTablesExtension.getMappingsForBase | public List<Long> getMappingsForBase(ExtendedRelation extendedRelation,
long baseId) {
return getMappingsForBase(extendedRelation.getMappingTableName(),
baseId);
} | java | public List<Long> getMappingsForBase(ExtendedRelation extendedRelation,
long baseId) {
return getMappingsForBase(extendedRelation.getMappingTableName(),
baseId);
} | [
"public",
"List",
"<",
"Long",
">",
"getMappingsForBase",
"(",
"ExtendedRelation",
"extendedRelation",
",",
"long",
"baseId",
")",
"{",
"return",
"getMappingsForBase",
"(",
"extendedRelation",
".",
"getMappingTableName",
"(",
")",
",",
"baseId",
")",
";",
"}"
] | Get the related id mappings for the base id
@param extendedRelation extended relation
@param baseId base id
@return IDs representing the matching related IDs | [
"Get",
"the",
"related",
"id",
"mappings",
"for",
"the",
"base",
"id"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java#L174-L178 | test | Get the mappings for a base | Of course, here is the Java code you requested:
```java
public List<Long> getMappingsForBase(ExtendedRelation extendedRelation,
long baseId) {
return getMappingsForBase(extendedRelation.getMappingTableName(),
baseId);
}
```
Hope this helps! |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/Deferrer.java | Deferrer.undefer | public void undefer(final Object keyOrEntity) {
if (keyOrEntity instanceof Key<?>) {
operations.remove((Key<?>)keyOrEntity);
}
else if (keyOrEntity instanceof com.google.cloud.datastore.Key) {
operations.remove(Key.create((com.google.cloud.datastore.Key)keyOrEntity));
}
else if (factory().keys().require... | java | public void undefer(final Object keyOrEntity) {
if (keyOrEntity instanceof Key<?>) {
operations.remove((Key<?>)keyOrEntity);
}
else if (keyOrEntity instanceof com.google.cloud.datastore.Key) {
operations.remove(Key.create((com.google.cloud.datastore.Key)keyOrEntity));
}
else if (factory().keys().require... | [
"public",
"void",
"undefer",
"(",
"final",
"Object",
"keyOrEntity",
")",
"{",
"if",
"(",
"keyOrEntity",
"instanceof",
"Key",
"<",
"?",
">",
")",
"{",
"operations",
".",
"remove",
"(",
"(",
"Key",
"<",
"?",
">",
")",
"keyOrEntity",
")",
";",
"}",
"els... | Eliminate any deferred operations against the entity. Used when an explicit save (or delete) was
executed against the key, so we no longer need the deferred operation.
@param keyOrEntity can be a Key, Key<?>, Entity, or entity pojo | [
"Eliminate",
"any",
"deferred",
"operations",
"against",
"the",
"entity",
".",
"Used",
"when",
"an",
"explicit",
"save",
"(",
"or",
"delete",
")",
"was",
"executed",
"against",
"the",
"key",
"so",
"we",
"no",
"longer",
"need",
"the",
"deferred",
"operation",... | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/Deferrer.java#L38-L52 | test | Undefer the given key or entity. | Of course, here is the Java code you requested:
```java
public void undefer(final Object keyOrEntity) {
if (keyOrEntity instanceof Key<?>) {
operations.remove((Key<?>)keyOrEntity);
}
else if (keyOrEntity instanceof com.google.cloud.datastore.Key) {
operations.remove(Key.create((com.google.cloud.datastore.K... |
jryans/jless | src/main/java/com/bazaarvoice/jless/parser/Parser.java | Parser.Keyword | Rule Keyword() {
return Sequence(
Sequence(Ident(), Test(Delimiter())),
push(new SimpleNode(match()))
);
} | java | Rule Keyword() {
return Sequence(
Sequence(Ident(), Test(Delimiter())),
push(new SimpleNode(match()))
);
} | [
"Rule",
"Keyword",
"(",
")",
"{",
"return",
"Sequence",
"(",
"Sequence",
"(",
"Ident",
"(",
")",
",",
"Test",
"(",
"Delimiter",
"(",
")",
")",
")",
",",
"push",
"(",
"new",
"SimpleNode",
"(",
"match",
"(",
")",
")",
")",
")",
";",
"}"
] | Ident &Delimiter
Ex: blue, small, normal | [
"Ident",
"&Delimiter"
] | 0e448fac752b4fc7bfef6b220ed1c64a490c29c0 | https://github.com/jryans/jless/blob/0e448fac752b4fc7bfef6b220ed1c64a490c29c0/src/main/java/com/bazaarvoice/jless/parser/Parser.java#L669-L674 | test | Keyword - Expression | Of course, here is the Java code you requested:
```java
Rule Keyword() {
return Sequence(
Sequence(Ident(), Test(Delimiter())),
push(new SimpleNode(match()))
);
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java | UrlTileGenerator.createTile | @Override
protected byte[] createTile(int z, long x, long y) {
byte[] bytes = null;
String zoomUrl = tileUrl;
// Replace x, y, and z
if (urlHasXYZ) {
long yRequest = y;
// If TMS, flip the y value
if (tms) {
yRequest = TileBound... | java | @Override
protected byte[] createTile(int z, long x, long y) {
byte[] bytes = null;
String zoomUrl = tileUrl;
// Replace x, y, and z
if (urlHasXYZ) {
long yRequest = y;
// If TMS, flip the y value
if (tms) {
yRequest = TileBound... | [
"@",
"Override",
"protected",
"byte",
"[",
"]",
"createTile",
"(",
"int",
"z",
",",
"long",
"x",
",",
"long",
"y",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"null",
";",
"String",
"zoomUrl",
"=",
"tileUrl",
";",
"// Replace x, y, and z",
"if",
"(",
"... | {@inheritDoc} | [
"{"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java#L208-L275 | test | Create the tile from the tile url | Of course, here is the Java code you requested:
```java
@Override
protected byte[] createTile(int z, long x, long y) {
byte[] bytes = null;
String zoomUrl = tileUrl;
// Replace x, y, and z
if (urlHasXYZ) {
long yRequest = y;
// If TMS, flip the y value
... |
polyjdbc/polyjdbc | src/main/java/org/polyjdbc/core/PolyJDBCBuilder.java | PolyJDBCBuilder.build | public PolyJDBC build() {
TransactionManager manager;
if (dataSource != null) {
manager = new DataSourceTransactionManager(dataSource);
} else {
manager = new ExternalTransactionManager(connectionProvider);
}
return new DefaultPolyJDBC(dialect, schemaName,... | java | public PolyJDBC build() {
TransactionManager manager;
if (dataSource != null) {
manager = new DataSourceTransactionManager(dataSource);
} else {
manager = new ExternalTransactionManager(connectionProvider);
}
return new DefaultPolyJDBC(dialect, schemaName,... | [
"public",
"PolyJDBC",
"build",
"(",
")",
"{",
"TransactionManager",
"manager",
";",
"if",
"(",
"dataSource",
"!=",
"null",
")",
"{",
"manager",
"=",
"new",
"DataSourceTransactionManager",
"(",
"dataSource",
")",
";",
"}",
"else",
"{",
"manager",
"=",
"new",
... | Return new PolyJDBC instance. | [
"Return",
"new",
"PolyJDBC",
"instance",
"."
] | 824d0e1ad14390a5b52cb96e527c943c14e28339 | https://github.com/polyjdbc/polyjdbc/blob/824d0e1ad14390a5b52cb96e527c943c14e28339/src/main/java/org/polyjdbc/core/PolyJDBCBuilder.java#L53-L61 | test | Build the PolyJDBC object. | Of course, here is the Java code you requested:
```java
public PolyJDBC build() {
TransactionManager manager;
if (dataSource != null) {
manager = new DataSourceTransactionManager(dataSource);
} else {
manager = new ExternalTransactionManager(connectionProvider);
... |
rest-assured/rest-assured | json-path/src/main/java/io/restassured/path/json/config/JsonPathConfig.java | JsonPathConfig.defaultObjectDeserializer | public JsonPathConfig defaultObjectDeserializer(JsonPathObjectDeserializer defaultObjectDeserializer) {
return new JsonPathConfig(numberReturnType, null, gsonObjectMapperFactory, jackson1ObjectMapperFactory,
jackson2ObjectMapperFactory, johnzonObjectMapperFactory, defaultObjectDeserializer, char... | java | public JsonPathConfig defaultObjectDeserializer(JsonPathObjectDeserializer defaultObjectDeserializer) {
return new JsonPathConfig(numberReturnType, null, gsonObjectMapperFactory, jackson1ObjectMapperFactory,
jackson2ObjectMapperFactory, johnzonObjectMapperFactory, defaultObjectDeserializer, char... | [
"public",
"JsonPathConfig",
"defaultObjectDeserializer",
"(",
"JsonPathObjectDeserializer",
"defaultObjectDeserializer",
")",
"{",
"return",
"new",
"JsonPathConfig",
"(",
"numberReturnType",
",",
"null",
",",
"gsonObjectMapperFactory",
",",
"jackson1ObjectMapperFactory",
",",
... | Creates an json path configuration that uses the specified object de-serializer as default.
@param defaultObjectDeserializer The object de-serializer to use. If <code>null</code> then classpath scanning will be used. | [
"Creates",
"an",
"json",
"path",
"configuration",
"that",
"uses",
"the",
"specified",
"object",
"de",
"-",
"serializer",
"as",
"default",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/json-path/src/main/java/io/restassured/path/json/config/JsonPathConfig.java#L188-L191 | test | Default object deserializer. | Of course, here is the Java code you requested:
```java
public JsonPathConfig defaultObjectDeserializer(JsonPathObjectDeserializer defaultObjectDeserializer) {
return new JsonPathConfig(numberReturnType, null, gsonObjectMapperFactory, jackson1ObjectMapperFactory,
jackson2ObjectMapperFactory, jo... |
streamsets/datacollector | jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/TableOrderProviderFactory.java | TableOrderProviderFactory.create | public TableOrderProvider create() {
switch (tableOrderStrategy) {
case NONE:
//Don't do any ordering, just add tables as per the incoming order.
return new DefaultTableOrderProvider(new LinkedHashSet<>());
case ALPHABETICAL:
//Alphabetical sorting based on table qualified names.... | java | public TableOrderProvider create() {
switch (tableOrderStrategy) {
case NONE:
//Don't do any ordering, just add tables as per the incoming order.
return new DefaultTableOrderProvider(new LinkedHashSet<>());
case ALPHABETICAL:
//Alphabetical sorting based on table qualified names.... | [
"public",
"TableOrderProvider",
"create",
"(",
")",
"{",
"switch",
"(",
"tableOrderStrategy",
")",
"{",
"case",
"NONE",
":",
"//Don't do any ordering, just add tables as per the incoming order.",
"return",
"new",
"DefaultTableOrderProvider",
"(",
"new",
"LinkedHashSet",
"<>... | Create {@link TableOrderProvider} for the {@link TableOrderStrategy}
@return {@link TableOrderProvider} | [
"Create",
"{"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/TableOrderProviderFactory.java#L44-L57 | test | Create a new table order provider. | Of course, here is the Java code you requested:
```java
public TableOrderProvider create() {
switch (tableOrderStrategy) {
case NONE:
//Don't do any ordering, just add tables as per the incoming order.
return new DefaultTableOrderProvider(new LinkedHashSet<>());
case ALPHABETICAL:
... |
boonproject/boon | boon/src/main/java/org/boon/primitive/Int.java | Int.equalsOrDie | public static boolean equalsOrDie(int expected, int got) {
if (expected != got) {
return die(Boolean.class, "Expected was", expected, "but we got ", got);
}
return true;
} | java | public static boolean equalsOrDie(int expected, int got) {
if (expected != got) {
return die(Boolean.class, "Expected was", expected, "but we got ", got);
}
return true;
} | [
"public",
"static",
"boolean",
"equalsOrDie",
"(",
"int",
"expected",
",",
"int",
"got",
")",
"{",
"if",
"(",
"expected",
"!=",
"got",
")",
"{",
"return",
"die",
"(",
"Boolean",
".",
"class",
",",
"\"Expected was\"",
",",
"expected",
",",
"\"but we got \""... | Checks to see if two values are the same
@param expected expected value
@param got got value
@return true if equal throws exception if not equal | [
"Checks",
"to",
"see",
"if",
"two",
"values",
"are",
"the",
"same"
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/primitive/Int.java#L977-L982 | test | Checks if two int values are equal. | Of course, here is the Java code you requested:
```java
public static boolean equalsOrDie(int expected, int got) {
if (expected != got) {
return die(Boolean.class, "Expected was", expected, "but we got ", got);
}
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.