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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/KeyValueBag.java | KeyValueBag.getKeys | public java.util.Collection<String> getKeys()
{
int numKeys = getNumKeys();
java.util.List<String> retval = new java.util.ArrayList<String>(numKeys);
for(int i = 0; i < getNumKeys(); i++)
{
String key = getKey(i);
if (key != null && key.length() > 0)
retval.add(key);
}
... | java | public java.util.Collection<String> getKeys()
{
int numKeys = getNumKeys();
java.util.List<String> retval = new java.util.ArrayList<String>(numKeys);
for(int i = 0; i < getNumKeys(); i++)
{
String key = getKey(i);
if (key != null && key.length() > 0)
retval.add(key);
}
... | [
"public",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"getKeys",
"(",
")",
"{",
"int",
"numKeys",
"=",
"getNumKeys",
"(",
")",
";",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"retval",
"=",
"new",
"java",
".",
"util",
"."... | Get the set of keys currently in this {@link KeyValueBag} object
as an unordered collection.
@return the keys. | [
"Get",
"the",
"set",
"of",
"keys",
"currently",
"in",
"this",
"{"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/KeyValueBag.java#L154-L166 | test | Gets the keys value. | Of course, here is the Java code you requested:
```java
public java.util.Collection<String> getKeys()
{
int numKeys = getNumKeys();
java.util.List<String> retval = new java.util.ArrayList<String>(numKeys);
for(int i = 0; i < getNumKeys(); i++)
{
String key = getKey(i);
if (key != nul... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java | ObjectFactory.createMieteinnahmenSoll | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "mieteinnahmen_soll")
@XmlJavaTypeAdapter(Adapter7 .class)
public JAXBElement<BigDecimal> createMieteinnahmenSoll(BigDecimal value) {
return new JAXBElement<BigDecimal>(_MieteinnahmenSoll_QNAME, BigDecimal.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "mieteinnahmen_soll")
@XmlJavaTypeAdapter(Adapter7 .class)
public JAXBElement<BigDecimal> createMieteinnahmenSoll(BigDecimal value) {
return new JAXBElement<BigDecimal>(_MieteinnahmenSoll_QNAME, BigDecimal.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immoxml.de\"",
",",
"name",
"=",
"\"mieteinnahmen_soll\"",
")",
"@",
"XmlJavaTypeAdapter",
"(",
"Adapter7",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"BigDecimal",
">",
"createMieteinnahmenSoll",
"(",
... | Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"BigDecimal",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L1369-L1373 | test | Create an instance of a Mieteinnahmen_Soll value. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "mieteinnahmen_soll")
@XmlJavaTypeAdapter(Adapter7 .class)
public JAXBElement<BigDecimal> createMieteinnahmenSoll(BigDecimal value) {
return new JAXBElement<BigDecimal>(_MieteinnahmenSoll... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/encryption/OEncryptionFactory.java | OEncryptionFactory.register | public void register(final OEncryption iEncryption) {
try {
final String name = iEncryption.name();
if (instances.containsKey(name))
throw new IllegalArgumentException("Encryption with name '" + name + "' was already registered");
if (classes.containsKey(name))
throw new IllegalA... | java | public void register(final OEncryption iEncryption) {
try {
final String name = iEncryption.name();
if (instances.containsKey(name))
throw new IllegalArgumentException("Encryption with name '" + name + "' was already registered");
if (classes.containsKey(name))
throw new IllegalA... | [
"public",
"void",
"register",
"(",
"final",
"OEncryption",
"iEncryption",
")",
"{",
"try",
"{",
"final",
"String",
"name",
"=",
"iEncryption",
".",
"name",
"(",
")",
";",
"if",
"(",
"instances",
".",
"containsKey",
"(",
"name",
")",
")",
"throw",
"new",
... | Registers a stateful implementations, a new instance will be created for each storage.
@param iEncryption
Encryption instance | [
"Registers",
"a",
"stateful",
"implementations",
"a",
"new",
"instance",
"will",
"be",
"created",
"for",
"each",
"storage",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/encryption/OEncryptionFactory.java#L87-L101 | test | Register an encryption algorithm. | Of course, here is the Java code you requested:
```java
public void register(final OEncryption iEncryption) {
try {
final String name = iEncryption.name();
if (instances.containsKey(name))
throw new IllegalArgumentException("Encryption with name '" + name + "' was already registered");
... |
streamsets/datacollector | jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcMicrosoftRecordReader.java | JdbcMicrosoftRecordReader.getOperationFromRecord | @Override
@VisibleForTesting
int getOperationFromRecord(
Record record,
int defaultOpCode,
UnsupportedOperationAction unsupportedAction,
List<OnRecordErrorException> errorRecords ) {
int opCode = -1; // -1 is invalid and not used in OperationType.
String op = null;
try {
/... | java | @Override
@VisibleForTesting
int getOperationFromRecord(
Record record,
int defaultOpCode,
UnsupportedOperationAction unsupportedAction,
List<OnRecordErrorException> errorRecords ) {
int opCode = -1; // -1 is invalid and not used in OperationType.
String op = null;
try {
/... | [
"@",
"Override",
"@",
"VisibleForTesting",
"int",
"getOperationFromRecord",
"(",
"Record",
"record",
",",
"int",
"defaultOpCode",
",",
"UnsupportedOperationAction",
"unsupportedAction",
",",
"List",
"<",
"OnRecordErrorException",
">",
"errorRecords",
")",
"{",
"int",
... | Get an operation code from record.
First, look for sdc.operation.code from record header.
If not set, look for "__$operation" in record. It is a specific field that MS SQL CDC origin set.
If either of them is set, check if the value is supported operation.
If not supported, let it handle by UnsupportedAction
check if ... | [
"Get",
"an",
"operation",
"code",
"from",
"record",
".",
"First",
"look",
"for",
"sdc",
".",
"operation",
".",
"code",
"from",
"record",
"header",
".",
"If",
"not",
"set",
"look",
"for",
"__$operation",
"in",
"record",
".",
"It",
"is",
"a",
"specific",
... | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcMicrosoftRecordReader.java#L46-L95 | test | Get the operation code from the record. | Of course, here is the Java code you requested:
```java
@Override
@VisibleForTesting
int getOperationFromRecord(
Record record,
int defaultOpCode,
UnsupportedOperationAction unsupportedAction,
List<OnRecordErrorException> errorRecords ) {
int opCode = -1; // -1 is invalid and not used ... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/core/OutputStreamAppender.java | OutputStreamAppender.closeOutputStream | protected void closeOutputStream() {
if (this.outputStream != null) {
try {
// before closing we have to output out layout's footer
encoderClose();
this.outputStream.close();
this.outputStream = null;
} catch (IOException e) {
addStatus(new ErrorStatus(
... | java | protected void closeOutputStream() {
if (this.outputStream != null) {
try {
// before closing we have to output out layout's footer
encoderClose();
this.outputStream.close();
this.outputStream = null;
} catch (IOException e) {
addStatus(new ErrorStatus(
... | [
"protected",
"void",
"closeOutputStream",
"(",
")",
"{",
"if",
"(",
"this",
".",
"outputStream",
"!=",
"null",
")",
"{",
"try",
"{",
"// before closing we have to output out layout's footer",
"encoderClose",
"(",
")",
";",
"this",
".",
"outputStream",
".",
"close"... | Close the underlying {@link OutputStream}. | [
"Close",
"the",
"underlying",
"{"
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/OutputStreamAppender.java#L130-L142 | test | Close the output stream for this appender. | Of course, here is the Java code you requested:
```java
protected void closeOutputStream() {
if (this.outputStream != null) {
try {
// before closing we have to output out layout's footer
encoderClose();
this.outputStream.close();
this.outputStream = null;
} catch (IOExc... |
orientechnologies/orientdb | server/src/main/java/com/orientechnologies/orient/server/security/authenticator/OSystemUserAuthenticator.java | OSystemUserAuthenticator.authenticate | public String authenticate(final String username, final String password) {
String principal = null;
try {
if (getServer() != null) {
// dbName parameter is null because we don't need to filter any roles for this.
OUser user = getServer().getSecurity().getSystemUser(username, null);
... | java | public String authenticate(final String username, final String password) {
String principal = null;
try {
if (getServer() != null) {
// dbName parameter is null because we don't need to filter any roles for this.
OUser user = getServer().getSecurity().getSystemUser(username, null);
... | [
"public",
"String",
"authenticate",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"{",
"String",
"principal",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"getServer",
"(",
")",
"!=",
"null",
")",
"{",
"// dbName parameter is null ... | This will authenticate username using the system database. | [
"This",
"will",
"authenticate",
"username",
"using",
"the",
"system",
"database",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/security/authenticator/OSystemUserAuthenticator.java#L64-L82 | test | Authenticate method. | Of course, here is the Java code you requested:
```java
public String authenticate(final String username, final String password) {
String principal = null;
try {
if (getServer() != null) {
// dbName parameter is null because we don't need to filter any roles for this.
OUser user = getSer... |
real-logic/aeron | aeron-samples/src/main/java/io/aeron/samples/SamplesUtil.java | SamplesUtil.printRate | public static void printRate(
final double messagesPerSec,
final double bytesPerSec,
final long totalMessages,
final long totalBytes)
{
System.out.println(String.format(
"%.02g msgs/sec, %.02g payload bytes/sec, totals %d messages %d MB",
messagesPerSe... | java | public static void printRate(
final double messagesPerSec,
final double bytesPerSec,
final long totalMessages,
final long totalBytes)
{
System.out.println(String.format(
"%.02g msgs/sec, %.02g payload bytes/sec, totals %d messages %d MB",
messagesPerSe... | [
"public",
"static",
"void",
"printRate",
"(",
"final",
"double",
"messagesPerSec",
",",
"final",
"double",
"bytesPerSec",
",",
"final",
"long",
"totalMessages",
",",
"final",
"long",
"totalBytes",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"String",
... | Print the rates to stdout
@param messagesPerSec being reported
@param bytesPerSec being reported
@param totalMessages being reported
@param totalBytes being reported | [
"Print",
"the",
"rates",
"to",
"stdout"
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-samples/src/main/java/io/aeron/samples/SamplesUtil.java#L153-L162 | test | Print the rate of a single record. | Of course, here is the Java code you requested:
```java
public static void printRate(
final double messagesPerSec,
final double bytesPerSec,
final long totalMessages,
final long totalBytes)
{
System.out.println(String.format(
"%.02g msgs/sec, %.02g payload bytes/... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java | ObjectFactory.createLaufzeit | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "laufzeit")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createLaufzeit(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Laufzeit_QNAME, BigDecimal.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "laufzeit")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createLaufzeit(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Laufzeit_QNAME, BigDecimal.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immoxml.de\"",
",",
"name",
"=",
"\"laufzeit\"",
")",
"@",
"XmlJavaTypeAdapter",
"(",
"Adapter2",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"BigDecimal",
">",
"createLaufzeit",
"(",
"BigDecimal",
"... | Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"BigDecimal",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L2270-L2274 | test | Create an instance of laufzeit. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "laufzeit")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createLaufzeit(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Laufzeit_QNAME, BigDecimal.class, nu... |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/ImplicitLocalViewProcessor.java | ImplicitLocalViewProcessor.filterInterfaces | private List<Class<?>> filterInterfaces(List<Class<?>> interfaces) {
if (interfaces == null) {
return null;
}
List<Class<?>> filteredInterfaces = new ArrayList<Class<?>>();
for (Class<?> intf : interfaces) {
if (intf.equals(java.io.Serializable.class)
... | java | private List<Class<?>> filterInterfaces(List<Class<?>> interfaces) {
if (interfaces == null) {
return null;
}
List<Class<?>> filteredInterfaces = new ArrayList<Class<?>>();
for (Class<?> intf : interfaces) {
if (intf.equals(java.io.Serializable.class)
... | [
"private",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"filterInterfaces",
"(",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"interfaces",
")",
"{",
"if",
"(",
"interfaces",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"Class",
"<",
... | Returns a filtered list for the passed <code>interfaces</code> list, excluding the
{@link java.io.Serializable}, {@link java.io.Externalizable} and any interfaces belonging to <code>javax.ejb</code>
package.
@param interfaces The list of interfaces
@return | [
"Returns",
"a",
"filtered",
"list",
"for",
"the",
"passed",
"<code",
">",
"interfaces<",
"/",
"code",
">",
"list",
"excluding",
"the",
"{",
"@link",
"java",
".",
"io",
".",
"Serializable",
"}",
"{",
"@link",
"java",
".",
"io",
".",
"Externalizable",
"}",... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/ImplicitLocalViewProcessor.java#L159-L173 | test | Filter the interfaces list. | Of course, here is the Java code you requested:
```java
private List<Class<?>> filterInterfaces(List<Class<?>> interfaces) {
if (interfaces == null) {
return null;
}
List<Class<?>> filteredInterfaces = new ArrayList<Class<?>>();
for (Class<?> intf : interfaces) {
... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/Attribute.java | Attribute.computeAttributesSize | final int computeAttributesSize(
final SymbolTable symbolTable,
final byte[] code,
final int codeLength,
final int maxStack,
final int maxLocals) {
final ClassWriter classWriter = symbolTable.classWriter;
int size = 0;
Attribute attribute = this;
while (attribute != null) {... | java | final int computeAttributesSize(
final SymbolTable symbolTable,
final byte[] code,
final int codeLength,
final int maxStack,
final int maxLocals) {
final ClassWriter classWriter = symbolTable.classWriter;
int size = 0;
Attribute attribute = this;
while (attribute != null) {... | [
"final",
"int",
"computeAttributesSize",
"(",
"final",
"SymbolTable",
"symbolTable",
",",
"final",
"byte",
"[",
"]",
"code",
",",
"final",
"int",
"codeLength",
",",
"final",
"int",
"maxStack",
",",
"final",
"int",
"maxLocals",
")",
"{",
"final",
"ClassWriter",... | Returns the total size in bytes of all the attributes in the attribute list that begins with
this attribute. This size includes the 6 header bytes (attribute_name_index and
attribute_length) per attribute. Also adds the attribute type names to the constant pool.
@param symbolTable where the constants used in the attri... | [
"Returns",
"the",
"total",
"size",
"in",
"bytes",
"of",
"all",
"the",
"attributes",
"in",
"the",
"attribute",
"list",
"that",
"begins",
"with",
"this",
"attribute",
".",
"This",
"size",
"includes",
"the",
"6",
"header",
"bytes",
"(",
"attribute_name_index",
... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Attribute.java#L213-L228 | test | Compute the size of the attributes. | Of course, here is the Java code you requested:
```java
final int computeAttributesSize(
final SymbolTable symbolTable,
final byte[] code,
final int codeLength,
final int maxStack,
final int maxLocals) {
final ClassWriter classWriter = symbolTable.classWriter;
int size = 0;
At... |
sharneng/gm4java | src/main/java/org/gm4java/im4java/GMBatchCommand.java | GMBatchCommand.run | @Override
protected int run(@Nonnull LinkedList<String> pArgs) throws Exception {
int rc;
try {
String result = executor.execute(pArgs);
if (outputConsumer != null && result != null) outputConsumer.consumeOutput(stringToStream(result));
rc = 0;
} catch (G... | java | @Override
protected int run(@Nonnull LinkedList<String> pArgs) throws Exception {
int rc;
try {
String result = executor.execute(pArgs);
if (outputConsumer != null && result != null) outputConsumer.consumeOutput(stringToStream(result));
rc = 0;
} catch (G... | [
"@",
"Override",
"protected",
"int",
"run",
"(",
"@",
"Nonnull",
"LinkedList",
"<",
"String",
">",
"pArgs",
")",
"throws",
"Exception",
"{",
"int",
"rc",
";",
"try",
"{",
"String",
"result",
"=",
"executor",
".",
"execute",
"(",
"pArgs",
")",
";",
"if"... | {@inheritDoc}
This implementation uses {@link GMExecutor} to execute the command. | [
"{",
"@inheritDoc",
"}"
] | 92f3f3b64a45f312ef6978f2367263ec64ff0c04 | https://github.com/sharneng/gm4java/blob/92f3f3b64a45f312ef6978f2367263ec64ff0c04/src/main/java/org/gm4java/im4java/GMBatchCommand.java#L80-L95 | test | Execute the command. | Of course, here is the Java code you requested:
```java
@Override
protected int run(@Nonnull LinkedList<String> pArgs) throws Exception {
int rc;
try {
String result = executor.execute(pArgs);
if (outputConsumer != null && result != null) outputConsumer.consumeOutput(string... |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java | ObjectFactory.createApiSuchfelderTypApiSuchfeld1 | @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "ApiSuchfeld1", scope = ApiSuchfelderTyp.class)
public JAXBElement<String> createApiSuchfelderTypApiSuchfeld1(String value) {
return new JAXBElement<String>(_ApiSuchfelderTypApiSuchfeld1_QNAME, String.class, ApiSuchfeld... | java | @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "ApiSuchfeld1", scope = ApiSuchfelderTyp.class)
public JAXBElement<String> createApiSuchfelderTypApiSuchfeld1(String value) {
return new JAXBElement<String>(_ApiSuchfelderTypApiSuchfeld1_QNAME, String.class, ApiSuchfeld... | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immobilienscout24.de/immobilientransfer\"",
",",
"name",
"=",
"\"ApiSuchfeld1\"",
",",
"scope",
"=",
"ApiSuchfelderTyp",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"String",
">",
"createApiSuchfelderTypApiS... | Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"String",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java#L1386-L1389 | test | Create an instance of a ApiSuchfelderTyp object. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "ApiSuchfeld1", scope = ApiSuchfelderTyp.class)
public JAXBElement<String> createApiSuchfelderTypApiSuchfeld1(String value) {
return new JAXBElement<String>(_ApiS... |
RestComm/jain-slee | container/usage/src/main/java/org/mobicents/slee/container/management/jmx/ServiceUsageMBeanImpl.java | ServiceUsageMBeanImpl.getSbbUsageMBean | public ObjectName getSbbUsageMBean(SbbID sbbId)
throws NullPointerException, UnrecognizedSbbException,
InvalidArgumentException, ManagementException {
try {
return _getSbbUsageMBean(sbbId, null);
} catch (UnrecognizedUsageParameterSetNameException e) {
throw new ManagementException(
"default... | java | public ObjectName getSbbUsageMBean(SbbID sbbId)
throws NullPointerException, UnrecognizedSbbException,
InvalidArgumentException, ManagementException {
try {
return _getSbbUsageMBean(sbbId, null);
} catch (UnrecognizedUsageParameterSetNameException e) {
throw new ManagementException(
"default... | [
"public",
"ObjectName",
"getSbbUsageMBean",
"(",
"SbbID",
"sbbId",
")",
"throws",
"NullPointerException",
",",
"UnrecognizedSbbException",
",",
"InvalidArgumentException",
",",
"ManagementException",
"{",
"try",
"{",
"return",
"_getSbbUsageMBean",
"(",
"sbbId",
",",
"nu... | /*
(non-Javadoc)
@see javax.slee.management.ServiceUsageMBean#getSbbUsageMBean(javax.slee.SbbID) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/usage/src/main/java/org/mobicents/slee/container/management/jmx/ServiceUsageMBeanImpl.java#L498-L507 | test | Returns the ObjectName of the managed MBean that owns the specified SBB. | Of course, here is the Java code you requested:
```java
public ObjectName getSbbUsageMBean(SbbID sbbId)
throws NullPointerException, UnrecognizedSbbException,
InvalidArgumentException, ManagementException {
try {
return _getSbbUsageMBean(sbbId, null);
} catch (UnrecognizedUsageParameterSetNameExcepti... |
jcodec/jcodec | src/main/java/org/jcodec/codecs/h264/H264Utils.java | H264Utils.joinNALUnits | public static ByteBuffer joinNALUnits(List<ByteBuffer> nalUnits) {
int size = 0;
for (ByteBuffer nal : nalUnits) {
size += 4 + nal.remaining();
}
ByteBuffer allocate = ByteBuffer.allocate(size);
joinNALUnitsToBuffer(nalUnits, allocate);
return allocate;
} | java | public static ByteBuffer joinNALUnits(List<ByteBuffer> nalUnits) {
int size = 0;
for (ByteBuffer nal : nalUnits) {
size += 4 + nal.remaining();
}
ByteBuffer allocate = ByteBuffer.allocate(size);
joinNALUnitsToBuffer(nalUnits, allocate);
return allocate;
} | [
"public",
"static",
"ByteBuffer",
"joinNALUnits",
"(",
"List",
"<",
"ByteBuffer",
">",
"nalUnits",
")",
"{",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"ByteBuffer",
"nal",
":",
"nalUnits",
")",
"{",
"size",
"+=",
"4",
"+",
"nal",
".",
"remaining",
"(",... | Joins buffers containing individual NAL units into a single AnnexB
delimited buffer. Each NAL unit will be separated with 00 00 00 01
markers. Allocates a new byte buffer and writes data into it.
@param nalUnits
@param out | [
"Joins",
"buffers",
"containing",
"individual",
"NAL",
"units",
"into",
"a",
"single",
"AnnexB",
"delimited",
"buffer",
".",
"Each",
"NAL",
"unit",
"will",
"be",
"separated",
"with",
"00",
"00",
"00",
"01",
"markers",
".",
"Allocates",
"a",
"new",
"byte",
... | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/H264Utils.java#L612-L620 | test | Join a list of ByteBuffer objects into a single ByteBuffer object. | Of course, here is the Java code you requested:
```java
public static ByteBuffer joinNALUnits(List<ByteBuffer> nalUnits) {
int size = 0;
for (ByteBuffer nal : nalUnits) {
size += 4 + nal.remaining();
}
ByteBuffer allocate = ByteBuffer.allocate(size);
joinNALUnitsToBu... |
hawkular/hawkular-metrics | containers/hawkular-openshift-security-filter/src/main/java/org/hawkular/openshift/auth/TokenAuthenticator.java | TokenAuthenticator.sendAuthenticationRequest | private void sendAuthenticationRequest(HttpServerExchange serverExchange, PooledConnection connection) {
AuthContext context = serverExchange.getAttachment(AUTH_CONTEXT_KEY);
String verb = getVerb(serverExchange);
String resource;
// if we are not dealing with a query
if (!isQue... | java | private void sendAuthenticationRequest(HttpServerExchange serverExchange, PooledConnection connection) {
AuthContext context = serverExchange.getAttachment(AUTH_CONTEXT_KEY);
String verb = getVerb(serverExchange);
String resource;
// if we are not dealing with a query
if (!isQue... | [
"private",
"void",
"sendAuthenticationRequest",
"(",
"HttpServerExchange",
"serverExchange",
",",
"PooledConnection",
"connection",
")",
"{",
"AuthContext",
"context",
"=",
"serverExchange",
".",
"getAttachment",
"(",
"AUTH_CONTEXT_KEY",
")",
";",
"String",
"verb",
"=",... | Executed when a pooled connection is acquired. | [
"Executed",
"when",
"a",
"pooled",
"connection",
"is",
"acquired",
"."
] | 6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c | https://github.com/hawkular/hawkular-metrics/blob/6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c/containers/hawkular-openshift-security-filter/src/main/java/org/hawkular/openshift/auth/TokenAuthenticator.java#L238-L260 | test | Send authentication request. | Of course, here is the Java code you requested:
```java
private void sendAuthenticationRequest(HttpServerExchange serverExchange, PooledConnection connection) {
AuthContext context = serverExchange.getAttachment(AUTH_CONTEXT_KEY);
String verb = getVerb(serverExchange);
String resource;
... |
RestComm/jain-slee | container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/SbbEntityImpl.java | SbbEntityImpl.setCMPField | public void setCMPField(String cmpFieldName, Object cmpFieldValue) {
if (log.isDebugEnabled()) {
log.debug("Sbb entity "+getSbbEntityId()+" setting cmp field "+cmpFieldName+" to value "+cmpFieldValue);
}
sleeContainer.getTransactionManager().mandateTransaction();
cacheData.setCmpField(cmpFieldName, cm... | java | public void setCMPField(String cmpFieldName, Object cmpFieldValue) {
if (log.isDebugEnabled()) {
log.debug("Sbb entity "+getSbbEntityId()+" setting cmp field "+cmpFieldName+" to value "+cmpFieldValue);
}
sleeContainer.getTransactionManager().mandateTransaction();
cacheData.setCmpField(cmpFieldName, cm... | [
"public",
"void",
"setCMPField",
"(",
"String",
"cmpFieldName",
",",
"Object",
"cmpFieldValue",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Sbb entity \"",
"+",
"getSbbEntityId",
"(",
")",
"+",
"\" se... | /*
(non-Javadoc)
@see org.mobicents.slee.container.sbbentity.SbbEntity#setCMPField(java.lang.String, java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/SbbEntityImpl.java#L142-L148 | test | Sets the value of the specified cmp field. | Of course, here is the Java code you requested:
```java
public void setCMPField(String cmpFieldName, Object cmpFieldValue) {
if (log.isDebugEnabled()) {
log.debug("Sbb entity "+getSbbEntityId()+" setting cmp field "+cmpFieldName+" to value "+cmpFieldValue);
}
sleeContainer.getTransactionManager().mandateTrans... |
Unidata/thredds | opendap/src/main/java/opendap/dap/DConnect2.java | DConnect2.getData | public DataDDS getData(String CE, StatusUI statusUI) throws MalformedURLException, IOException,
ParseException, DDSException, DAP2Exception
{
return getData(CE, statusUI, new DefaultFactory());
} | java | public DataDDS getData(String CE, StatusUI statusUI) throws MalformedURLException, IOException,
ParseException, DDSException, DAP2Exception
{
return getData(CE, statusUI, new DefaultFactory());
} | [
"public",
"DataDDS",
"getData",
"(",
"String",
"CE",
",",
"StatusUI",
"statusUI",
")",
"throws",
"MalformedURLException",
",",
"IOException",
",",
"ParseException",
",",
"DDSException",
",",
"DAP2Exception",
"{",
"return",
"getData",
"(",
"CE",
",",
"statusUI",
... | Returns the `Data object' from the dataset referenced by this object's
URL given the constraint expression CE. Note that the Data object is
really just a DDS object with data bound to the variables. The DDS will
probably contain fewer variables (and those might have different
types) than in the DDS returned by getDDS()... | [
"Returns",
"the",
"Data",
"object",
"from",
"the",
"dataset",
"referenced",
"by",
"this",
"object",
"s",
"URL",
"given",
"the",
"constraint",
"expression",
"CE",
".",
"Note",
"that",
"the",
"Data",
"object",
"is",
"really",
"just",
"a",
"DDS",
"object",
"w... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DConnect2.java#L1209-L1214 | test | Get a DataDDS object from a CBE. | Of course, here is the Java code you requested:
```java
public DataDDS getData(String CE, StatusUI statusUI) throws MalformedURLException, IOException,
ParseException, DDSException, DAP2Exception
{
return getData(CE, statusUI, new DefaultFactory());
}
```
Hope this helps! |
ebourgeois/protobuf-serializer | src/main/java/ca/jeb/protobuf/internal/ProtobufSerializerUtils.java | ProtobufSerializerUtils.getProtobufClassFromPojoAnno | public static final Class<? extends GeneratedMessage> getProtobufClassFromPojoAnno(Class<?> clazz)
{
final ProtobufEntity annotation = getProtobufEntity(clazz);
final Class<? extends GeneratedMessage> gpbClazz = (Class<? extends GeneratedMessage>)annotation.value();
if (gpbClazz == null)
{
retur... | java | public static final Class<? extends GeneratedMessage> getProtobufClassFromPojoAnno(Class<?> clazz)
{
final ProtobufEntity annotation = getProtobufEntity(clazz);
final Class<? extends GeneratedMessage> gpbClazz = (Class<? extends GeneratedMessage>)annotation.value();
if (gpbClazz == null)
{
retur... | [
"public",
"static",
"final",
"Class",
"<",
"?",
"extends",
"GeneratedMessage",
">",
"getProtobufClassFromPojoAnno",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"final",
"ProtobufEntity",
"annotation",
"=",
"getProtobufEntity",
"(",
"clazz",
")",
";",
"final"... | Return the Protobuf Class based on the pojo class, i.e. grab the value from the ProtobufEntity annotation.
@param clazz - any Class
@return Class<? extends GeneratedMessage> | [
"Return",
"the",
"Protobuf",
"Class",
"based",
"on",
"the",
"pojo",
"class",
"i",
".",
"e",
".",
"grab",
"the",
"value",
"from",
"the",
"ProtobufEntity",
"annotation",
"."
] | c87fe6e5ebe6f0e77bf61f1bb661db5a7a5f9d8e | https://github.com/ebourgeois/protobuf-serializer/blob/c87fe6e5ebe6f0e77bf61f1bb661db5a7a5f9d8e/src/main/java/ca/jeb/protobuf/internal/ProtobufSerializerUtils.java#L131-L140 | test | Get Protobuf class from ProtobufEntity annotation | Of course, here is the Java code you requested:
```java
public static final Class<? extends GeneratedMessage> getProtobufClassFromPojoAnno(Class<?> clazz)
{
final ProtobufEntity annotation = getProtobufEntity(clazz);
final Class<? extends GeneratedMessage> gpbClazz = (Class<? extends GeneratedMessage>)annota... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.elementAtOrError | @CheckReturnValue
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> elementAtOrError(long index) {
if (index < 0) {
throw new IndexOutOfBoundsException("index >= 0 required but it was " + index);
}
return R... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> elementAtOrError(long index) {
if (index < 0) {
throw new IndexOutOfBoundsException("index >= 0 required but it was " + index);
}
return R... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"UNBOUNDED_IN",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Single",
"<",
"T",
">",
"elementAtOrError",
"(",
"long",
"index",
")",
... | Returns a Single that emits the item found at a specified index in a sequence of emissions from
this Flowable or signals a {@link NoSuchElementException} if this Flowable has fewer elements than index.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/elementAtOrDef... | [
"Returns",
"a",
"Single",
"that",
"emits",
"the",
"item",
"found",
"at",
"a",
"specified",
"index",
"in",
"a",
"sequence",
"of",
"emissions",
"from",
"this",
"Flowable",
"or",
"signals",
"a",
"{",
"@link",
"NoSuchElementException",
"}",
"if",
"this",
"Flowab... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L9472-L9480 | test | Gets the element at the specified index or error. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> elementAtOrError(long index) {
if (index < 0) {
throw new IndexOutOfBoundsException("index >= 0 r... |
rupertlssmith/lojix | debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingKeyCombinationBuilder.java | SwingKeyCombinationBuilder.modifiersToString | private String modifiersToString(int modifiers)
{
String result = "";
if ((modifiers & InputEvent.SHIFT_MASK) != 0)
{
result += "shift ";
}
if ((modifiers & InputEvent.CTRL_MASK) != 0)
{
result += "ctrl ";
}
if ((modifiers & ... | java | private String modifiersToString(int modifiers)
{
String result = "";
if ((modifiers & InputEvent.SHIFT_MASK) != 0)
{
result += "shift ";
}
if ((modifiers & InputEvent.CTRL_MASK) != 0)
{
result += "ctrl ";
}
if ((modifiers & ... | [
"private",
"String",
"modifiersToString",
"(",
"int",
"modifiers",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"if",
"(",
"(",
"modifiers",
"&",
"InputEvent",
".",
"SHIFT_MASK",
")",
"!=",
"0",
")",
"{",
"result",
"+=",
"\"shift \"",
";",
"}",
"if",
... | Converts the modifiers to a specification string for KeyStroke.
@param modifiers The modifiers.
@return A fragment of the key specification string used by KeyStroke. | [
"Converts",
"the",
"modifiers",
"to",
"a",
"specification",
"string",
"for",
"KeyStroke",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingKeyCombinationBuilder.java#L98-L128 | test | Method to get the string representation of the modifiers. | Of course, here is the Java code you requested:
```java
private String modifiersToString(int modifiers)
{
String result = "";
if ((modifiers & InputEvent.SHIFT_MASK) != 0)
{
result += "shift ";
}
if ((modifiers & InputEvent.CTRL_MASK) != 0)
{
... |
Unidata/thredds | tdcommon/src/main/java/thredds/server/catalog/DataRootPathMatcher.java | DataRootPathMatcher.put | private boolean put(DataRootExt dateRootExt) {
map.put(dateRootExt.getPath(), dateRootExt);
return treeSet.add(dateRootExt.getPath());
} | java | private boolean put(DataRootExt dateRootExt) {
map.put(dateRootExt.getPath(), dateRootExt);
return treeSet.add(dateRootExt.getPath());
} | [
"private",
"boolean",
"put",
"(",
"DataRootExt",
"dateRootExt",
")",
"{",
"map",
".",
"put",
"(",
"dateRootExt",
".",
"getPath",
"(",
")",
",",
"dateRootExt",
")",
";",
"return",
"treeSet",
".",
"add",
"(",
"dateRootExt",
".",
"getPath",
"(",
")",
")",
... | Add a dataRootExt to in-memory tree.
@return true if not already exist | [
"Add",
"a",
"dataRootExt",
"to",
"in",
"-",
"memory",
"tree",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tdcommon/src/main/java/thredds/server/catalog/DataRootPathMatcher.java#L62-L65 | test | Put a data root ext into the map and add it to the treeSet. | Of course, here is the Java code you requested:
```java
private boolean put(DataRootExt dateRootExt) {
map.put(dateRootExt.getPath(), dateRootExt);
return treeSet.add(dateRootExt.getPath());
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java | ObjectFactory.createGrundstueckEmpfohleneNutzungKleingewerbe | @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Kleingewerbe", scope = GrundstueckEmpfohleneNutzung.class)
public JAXBElement<Object> createGrundstueckEmpfohleneNutzungKleingewerbe(Object value) {
return new JAXBElement<Object>(_GrundstueckEmpfohleneNutzungKleingewe... | java | @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Kleingewerbe", scope = GrundstueckEmpfohleneNutzung.class)
public JAXBElement<Object> createGrundstueckEmpfohleneNutzungKleingewerbe(Object value) {
return new JAXBElement<Object>(_GrundstueckEmpfohleneNutzungKleingewe... | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immobilienscout24.de/immobilientransfer\"",
",",
"name",
"=",
"\"Kleingewerbe\"",
",",
"scope",
"=",
"GrundstueckEmpfohleneNutzung",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"Object",
">",
"createGrundstu... | Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"Object",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java#L1089-L1092 | test | Create an instance of an JAXBElement that will return a new JAXBElement instance. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Kleingewerbe", scope = GrundstueckEmpfohleneNutzung.class)
public JAXBElement<Object> createGrundstueckEmpfohleneNutzungKleingewerbe(Object value) {
return new J... |
streamsets/datacollector | jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcMultiRowRecordWriter.java | JdbcMultiRowRecordWriter.processQueue | private void processQueue(
LinkedList<Record> queue,
List<OnRecordErrorException> errorRecords,
Connection connection,
int maxRowsPerBatch,
int opCode
) throws StageException {
if (queue.isEmpty()) {
return;
}
int rowCount = 0;
// Assume that columns are all same f... | java | private void processQueue(
LinkedList<Record> queue,
List<OnRecordErrorException> errorRecords,
Connection connection,
int maxRowsPerBatch,
int opCode
) throws StageException {
if (queue.isEmpty()) {
return;
}
int rowCount = 0;
// Assume that columns are all same f... | [
"private",
"void",
"processQueue",
"(",
"LinkedList",
"<",
"Record",
">",
"queue",
",",
"List",
"<",
"OnRecordErrorException",
">",
"errorRecords",
",",
"Connection",
"connection",
",",
"int",
"maxRowsPerBatch",
",",
"int",
"opCode",
")",
"throws",
"StageException... | Process all records in queue. All records have same operation to same table.
Generate a query and set parameters from each record. INSERT and DELETE can be multi-row operation
but UPDATE is single-row operation.
If maxStatement
@param errorRecords
@param connection
@param maxRowsPerBatch
@param opCode
@param queue
@ret... | [
"Process",
"all",
"records",
"in",
"queue",
".",
"All",
"records",
"have",
"same",
"operation",
"to",
"same",
"table",
".",
"Generate",
"a",
"query",
"and",
"set",
"parameters",
"from",
"each",
"record",
".",
"INSERT",
"and",
"DELETE",
"can",
"be",
"multi"... | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcMultiRowRecordWriter.java#L192-L291 | test | Process the queue of records. | Of course, here is the Java code you requested:
```java
private void processQueue(
LinkedList<Record> queue,
List<OnRecordErrorException> errorRecords,
Connection connection,
int maxRowsPerBatch,
int opCode
) throws StageException {
if (queue.isEmpty()) {
return;
}
in... |
oblac/jodd | jodd-core/src/main/java/jodd/util/StringUtil.java | StringUtil.cutSurrounding | public static String cutSurrounding(final String string, final String prefix, final String suffix) {
int start = 0;
int end = string.length();
if (string.startsWith(prefix)) {
start = prefix.length();
}
if (string.endsWith(suffix)) {
end -= suffix.length();
}
if (end <= start) {
return StringPo... | java | public static String cutSurrounding(final String string, final String prefix, final String suffix) {
int start = 0;
int end = string.length();
if (string.startsWith(prefix)) {
start = prefix.length();
}
if (string.endsWith(suffix)) {
end -= suffix.length();
}
if (end <= start) {
return StringPo... | [
"public",
"static",
"String",
"cutSurrounding",
"(",
"final",
"String",
"string",
",",
"final",
"String",
"prefix",
",",
"final",
"String",
"suffix",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"string",
".",
"length",
"(",
")",
";",
"i... | Removes surrounding prefix and suffixes. | [
"Removes",
"surrounding",
"prefix",
"and",
"suffixes",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/StringUtil.java#L2416-L2432 | test | Cut the given string by removing the surrounding characters. | Of course, here is the Java code you requested:
```java
public static String cutSurrounding(final String string, final String prefix, final String suffix) {
int start = 0;
int end = string.length();
if (string.startsWith(prefix)) {
start = prefix.length();
}
if (string.endsWith(suffix)) {
end -= suffi... |
CAFapi/caf-common | util-naming/src/main/java/com/hpe/caf/naming/Name.java | Name.getIndex | public String getIndex(final int index)
{
if (index < 0 || index >= components.size()) {
throw new IllegalArgumentException("Index out of bounds");
}
return components.get(index);
} | java | public String getIndex(final int index)
{
if (index < 0 || index >= components.size()) {
throw new IllegalArgumentException("Index out of bounds");
}
return components.get(index);
} | [
"public",
"String",
"getIndex",
"(",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"components",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Index out of bounds\"",
")",
";",
... | Get the components of the Name at the specified numeric index
@param index the index of the token to return, starting from 0
@return the requested Name component
@throws IllegalArgumentException if you request an index that does not exist | [
"Get",
"the",
"components",
"of",
"the",
"Name",
"at",
"the",
"specified",
"numeric",
"index"
] | c9e617cd0b39e19d9480653f8c82efee53dee885 | https://github.com/CAFapi/caf-common/blob/c9e617cd0b39e19d9480653f8c82efee53dee885/util-naming/src/main/java/com/hpe/caf/naming/Name.java#L70-L76 | test | Gets the index of theCTYPE. | Of course, here is the Java code you requested:
```java
public String getIndex(final int index)
{
if (index < 0 || index >= components.size()) {
throw new IllegalArgumentException("Index out of bounds");
}
return components.get(index);
}
```
Hope this helps! |
real-logic/aeron | aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java | AeronArchive.listRecordingSubscriptions | public int listRecordingSubscriptions(
final int pseudoIndex,
final int subscriptionCount,
final String channelFragment,
final int streamId,
final boolean applyStreamId,
final RecordingSubscriptionDescriptorConsumer consumer)
{
lock.lock();
try
... | java | public int listRecordingSubscriptions(
final int pseudoIndex,
final int subscriptionCount,
final String channelFragment,
final int streamId,
final boolean applyStreamId,
final RecordingSubscriptionDescriptorConsumer consumer)
{
lock.lock();
try
... | [
"public",
"int",
"listRecordingSubscriptions",
"(",
"final",
"int",
"pseudoIndex",
",",
"final",
"int",
"subscriptionCount",
",",
"final",
"String",
"channelFragment",
",",
"final",
"int",
"streamId",
",",
"final",
"boolean",
"applyStreamId",
",",
"final",
"Recordin... | List active recording subscriptions in the archive. These are the result of requesting one of
{@link #startRecording(String, int, SourceLocation)} or a
{@link #extendRecording(long, String, int, SourceLocation)}. The returned subscription id can be used for
passing to {@link #stopRecording(long)}.
@param pseudoIndex ... | [
"List",
"active",
"recording",
"subscriptions",
"in",
"the",
"archive",
".",
"These",
"are",
"the",
"result",
"of",
"requesting",
"one",
"of",
"{",
"@link",
"#startRecording",
"(",
"String",
"int",
"SourceLocation",
")",
"}",
"or",
"a",
"{",
"@link",
"#exten... | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java#L1031-L1064 | test | List recording subscriptions. | Of course, here is the Java code you requested:
```java
public int listRecordingSubscriptions(
final int pseudoIndex,
final int subscriptionCount,
final String channelFragment,
final int streamId,
final boolean applyStreamId,
final RecordingSubscriptionDescriptorConsumer... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/service/CellHelper.java | CellHelper.getPoiCellWithRowColFromCurrentPage | public final Cell getPoiCellWithRowColFromCurrentPage(
final int rowIndex, final int colIndex) {
return CellUtility.getPoiCellWithRowColFromCurrentPage(rowIndex,
colIndex, parent.getWb());
} | java | public final Cell getPoiCellWithRowColFromCurrentPage(
final int rowIndex, final int colIndex) {
return CellUtility.getPoiCellWithRowColFromCurrentPage(rowIndex,
colIndex, parent.getWb());
} | [
"public",
"final",
"Cell",
"getPoiCellWithRowColFromCurrentPage",
"(",
"final",
"int",
"rowIndex",
",",
"final",
"int",
"colIndex",
")",
"{",
"return",
"CellUtility",
".",
"getPoiCellWithRowColFromCurrentPage",
"(",
"rowIndex",
",",
"colIndex",
",",
"parent",
".",
"... | Gets the poi cell with row col from current page.
@param rowIndex
the row index
@param colIndex
the col index
@return the poi cell with row col from current page | [
"Gets",
"the",
"poi",
"cell",
"with",
"row",
"col",
"from",
"current",
"page",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/service/CellHelper.java#L115-L119 | test | Gets the poi cell with row and column from the current page. | Of course, here is the Java code you requested:
```java
public final Cell getPoiCellWithRowColFromCurrentPage(
final int rowIndex, final int colIndex) {
return CellUtility.getPoiCellWithRowColFromCurrentPage(rowIndex,
colIndex, parent.getWb());
}
```
Hope this helps! |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java | OSelectExecutionPlanner.commonFactor | private List<IndexSearchDescriptor> commonFactor(List<IndexSearchDescriptor> indexSearchDescriptors) {
//index, key condition, additional filter (to aggregate in OR)
Map<OIndex, Map<IndexCondPair, OOrBlock>> aggregation = new HashMap<>();
for (IndexSearchDescriptor item : indexSearchDescriptors) {
Map... | java | private List<IndexSearchDescriptor> commonFactor(List<IndexSearchDescriptor> indexSearchDescriptors) {
//index, key condition, additional filter (to aggregate in OR)
Map<OIndex, Map<IndexCondPair, OOrBlock>> aggregation = new HashMap<>();
for (IndexSearchDescriptor item : indexSearchDescriptors) {
Map... | [
"private",
"List",
"<",
"IndexSearchDescriptor",
">",
"commonFactor",
"(",
"List",
"<",
"IndexSearchDescriptor",
">",
"indexSearchDescriptors",
")",
"{",
"//index, key condition, additional filter (to aggregate in OR)",
"Map",
"<",
"OIndex",
",",
"Map",
"<",
"IndexCondPair"... | aggregates multiple index conditions that refer to the same key search
@param indexSearchDescriptors
@return | [
"aggregates",
"multiple",
"index",
"conditions",
"that",
"refer",
"to",
"the",
"same",
"key",
"search"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java#L2565-L2591 | test | Compute the common factor for the given list of index search descriptors. | Of course, here is the Java code you requested:
```java
private List<IndexSearchDescriptor> commonFactor(List<IndexSearchDescriptor> indexSearchDescriptors) {
//index, key condition, additional filter (to aggregate in OR)
Map<OIndex, Map<IndexCondPair, OOrBlock>> aggregation = new HashMap<>();
for (IndexSe... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java | ObjectFactory.createObjektbeschreibung | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "objektbeschreibung")
public JAXBElement<String> createObjektbeschreibung(String value) {
return new JAXBElement<String>(_Objektbeschreibung_QNAME, String.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "objektbeschreibung")
public JAXBElement<String> createObjektbeschreibung(String value) {
return new JAXBElement<String>(_Objektbeschreibung_QNAME, String.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immoxml.de\"",
",",
"name",
"=",
"\"objektbeschreibung\"",
")",
"public",
"JAXBElement",
"<",
"String",
">",
"createObjektbeschreibung",
"(",
"String",
"value",
")",
"{",
"return",
"new",
"JAXBElement",
"<"... | Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"String",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L2085-L2088 | test | Create an instance of an Objektbeschreibung in einen Tagende Methode. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "objektbeschreibung")
public JAXBElement<String> createObjektbeschreibung(String value) {
return new JAXBElement<String>(_Objektbeschreibung_QNAME, String.class, null, value);
}
```
Hope... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.sample | @CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Flowable<T> sample(long period, TimeUnit unit) {
return sample(period, unit, Schedulers.computation());
} | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Flowable<T> sample(long period, TimeUnit unit) {
return sample(period, unit, Schedulers.computation());
} | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"ERROR",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"COMPUTATION",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"sample",
"(",
"long",
"period",
",",
"TimeU... | Returns a Flowable that emits the most recently emitted item (if any) emitted by the source Publisher
within periodic time intervals.
<p>
<img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.png" alt="">
<dl>
<dt><b>Backpressure:</b></dt>
<dd>This operator does not ... | [
"Returns",
"a",
"Flowable",
"that",
"emits",
"the",
"most",
"recently",
"emitted",
"item",
"(",
"if",
"any",
")",
"emitted",
"by",
"the",
"source",
"Publisher",
"within",
"periodic",
"time",
"intervals",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L13615-L13620 | test | Sample a sequence of tokens from the source source. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.ERROR)
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Flowable<T> sample(long period, TimeUnit unit) {
return sample(period, unit, Schedulers.computation());
}
```
Hope... |
real-logic/aeron | aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java | AeronArchive.checkForErrorResponse | public void checkForErrorResponse()
{
lock.lock();
try
{
ensureOpen();
if (controlResponsePoller.poll() != 0 && controlResponsePoller.isPollComplete())
{
if (controlResponsePoller.controlSessionId() == controlSessionId &&
... | java | public void checkForErrorResponse()
{
lock.lock();
try
{
ensureOpen();
if (controlResponsePoller.poll() != 0 && controlResponsePoller.isPollComplete())
{
if (controlResponsePoller.controlSessionId() == controlSessionId &&
... | [
"public",
"void",
"checkForErrorResponse",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"ensureOpen",
"(",
")",
";",
"if",
"(",
"controlResponsePoller",
".",
"poll",
"(",
")",
"!=",
"0",
"&&",
"controlResponsePoller",
".",
"isPollComplete... | Check if an error has been returned for the control session and throw a {@link ArchiveException} if
{@link Context#errorHandler(ErrorHandler)} is not set.
<p>
To check for an error response without raising an exception then try {@link #pollForErrorResponse()}.
@see #pollForErrorResponse() | [
"Check",
"if",
"an",
"error",
"has",
"been",
"returned",
"for",
"the",
"control",
"session",
"and",
"throw",
"a",
"{",
"@link",
"ArchiveException",
"}",
"if",
"{",
"@link",
"Context#errorHandler",
"(",
"ErrorHandler",
")",
"}",
"is",
"not",
"set",
".",
"<p... | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java#L355-L386 | test | Check for error. | Of course, here is the Java code you requested:
```java
public void checkForErrorResponse()
{
lock.lock();
try
{
ensureOpen();
if (controlResponsePoller.poll() != 0 && controlResponsePoller.isPollComplete())
{
if (controlResponsePoller.co... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/ChartUtility.java | ChartUtility.getAnchorAssociateChartId | private static String getAnchorAssociateChartId(
final CTTwoCellAnchor ctanchor) {
if (ctanchor.getGraphicFrame() == null) {
return null;
}
Node parentNode = ctanchor.getGraphicFrame().getGraphic()
.getGraphicData().getDomNode();
NodeL... | java | private static String getAnchorAssociateChartId(
final CTTwoCellAnchor ctanchor) {
if (ctanchor.getGraphicFrame() == null) {
return null;
}
Node parentNode = ctanchor.getGraphicFrame().getGraphic()
.getGraphicData().getDomNode();
NodeL... | [
"private",
"static",
"String",
"getAnchorAssociateChartId",
"(",
"final",
"CTTwoCellAnchor",
"ctanchor",
")",
"{",
"if",
"(",
"ctanchor",
".",
"getGraphicFrame",
"(",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Node",
"parentNode",
"=",
"ctanchor... | Gets the anchor associate chart id.
@param ctanchor
the ctanchor
@return the anchor associate chart id | [
"Gets",
"the",
"anchor",
"associate",
"chart",
"id",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ChartUtility.java#L279-L303 | test | Gets the chart id from the CTTwoCellAnchor object. | Of course, here is the Java code you requested:
```java
private static String getAnchorAssociateChartId(
final CTTwoCellAnchor ctanchor) {
if (ctanchor.getGraphicFrame() == null) {
return null;
}
Node parentNode = ctanchor.getGraphicFrame().getGraphic()
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java | OSessionStoragePerformanceStatistic.incrementPageAccessOnCacheLevel | public void incrementPageAccessOnCacheLevel(boolean cacheHit) {
performanceCountersHolder.cacheAccessCount++;
if (cacheHit)
performanceCountersHolder.cacheHit++;
for (Component component : componentsStack) {
final String componentName = component.name;
PerformanceCountersHolder cHolder =... | java | public void incrementPageAccessOnCacheLevel(boolean cacheHit) {
performanceCountersHolder.cacheAccessCount++;
if (cacheHit)
performanceCountersHolder.cacheHit++;
for (Component component : componentsStack) {
final String componentName = component.name;
PerformanceCountersHolder cHolder =... | [
"public",
"void",
"incrementPageAccessOnCacheLevel",
"(",
"boolean",
"cacheHit",
")",
"{",
"performanceCountersHolder",
".",
"cacheAccessCount",
"++",
";",
"if",
"(",
"cacheHit",
")",
"performanceCountersHolder",
".",
"cacheHit",
"++",
";",
"for",
"(",
"Component",
... | Increments counter of page accesses from cache.
<p>
If you wish to gather statistic for current durable component please call
{@link #startComponentOperation(String, ComponentType)} method before the call and {@link #completeComponentOperation()} after
the call. | [
"Increments",
"counter",
"of",
"page",
"accesses",
"from",
"cache",
".",
"<p",
">",
"If",
"you",
"wish",
"to",
"gather",
"statistic",
"for",
"current",
"durable",
"component",
"please",
"call",
"{"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java#L599-L616 | test | Increment the page access count on cache level. | Of course, here is the Java code you requested:
```java
public void incrementPageAccessOnCacheLevel(boolean cacheHit) {
performanceCountersHolder.cacheAccessCount++;
if (cacheHit)
performanceCountersHolder.cacheHit++;
for (Component component : componentsStack) {
final String componentName = c... |
rackerlabs/blueflood | blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/PreaggregateConversions.java | PreaggregateConversions.resolveNumber | public static Number resolveNumber(Number n) {
if (n instanceof LazilyParsedNumber) {
try {
return n.longValue();
} catch (NumberFormatException ex) {
return n.doubleValue();
}
} else {
// already resolved.
retur... | java | public static Number resolveNumber(Number n) {
if (n instanceof LazilyParsedNumber) {
try {
return n.longValue();
} catch (NumberFormatException ex) {
return n.doubleValue();
}
} else {
// already resolved.
retur... | [
"public",
"static",
"Number",
"resolveNumber",
"(",
"Number",
"n",
")",
"{",
"if",
"(",
"n",
"instanceof",
"LazilyParsedNumber",
")",
"{",
"try",
"{",
"return",
"n",
".",
"longValue",
"(",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"ex",
")",
... | resolve a number to a Long or double. | [
"resolve",
"a",
"number",
"to",
"a",
"Long",
"or",
"double",
"."
] | 4722a3449b1a7f8e88889ea8c340c6f24396b5b0 | https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/PreaggregateConversions.java#L132-L143 | test | Resolves a number to a Crazilianianianianianianianianianianianianzu. | Of course, here is the Java code you requested:
```java
public static Number resolveNumber(Number n) {
if (n instanceof LazilyParsedNumber) {
try {
return n.longValue();
} catch (NumberFormatException ex) {
return n.doubleValue();
}
} ... |
rupertlssmith/lojix | debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingMainWindow.java | SwingMainWindow.showMainWindow | public void showMainWindow()
{
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setMinimumSize(new Dimension(800, 600));
frame.setPreferredSize(new Dimension(1000, 800));
layout = new DesktopAppLayout();
frame.getContentPane().setLayo... | java | public void showMainWindow()
{
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setMinimumSize(new Dimension(800, 600));
frame.setPreferredSize(new Dimension(1000, 800));
layout = new DesktopAppLayout();
frame.getContentPane().setLayo... | [
"public",
"void",
"showMainWindow",
"(",
")",
"{",
"frame",
"=",
"new",
"JFrame",
"(",
")",
";",
"frame",
".",
"setDefaultCloseOperation",
"(",
"JFrame",
".",
"EXIT_ON_CLOSE",
")",
";",
"frame",
".",
"setMinimumSize",
"(",
"new",
"Dimension",
"(",
"800",
"... | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingMainWindow.java#L77-L91 | test | Show the main window. | Of course, here is the Java code you requested:
```java
public void showMainWindow()
{
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setMinimumSize(new Dimension(800, 600));
frame.setPreferredSize(new Dimension(1000, 800));
layout = new D... |
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java | src/main/java/org/teachingextensions/logo/Turtle.java | Turtle.move | public void move(Number amount)
{
double max = MAX_MOVE_AMOUNT;
Saver<Double> s = penDown ? new Mover(new Point(getX(), getY())) : new EmptyMover();
animate(amount.doubleValue(), max, s);
} | java | public void move(Number amount)
{
double max = MAX_MOVE_AMOUNT;
Saver<Double> s = penDown ? new Mover(new Point(getX(), getY())) : new EmptyMover();
animate(amount.doubleValue(), max, s);
} | [
"public",
"void",
"move",
"(",
"Number",
"amount",
")",
"{",
"double",
"max",
"=",
"MAX_MOVE_AMOUNT",
";",
"Saver",
"<",
"Double",
">",
"s",
"=",
"penDown",
"?",
"new",
"Mover",
"(",
"new",
"Point",
"(",
"getX",
"(",
")",
",",
"getY",
"(",
")",
")"... | Sets the distance that a turtle instance moves in pixels
<p><b>Example:</b> {@code myTurtle.move(100)}</p>
@param amount
The distance that your turtle moves in pixels. Negative numbers will move your turtle backwards | [
"Sets",
"the",
"distance",
"that",
"a",
"turtle",
"instance",
"moves",
"in",
"pixels",
"<p",
">",
"<b",
">",
"Example",
":",
"<",
"/",
"b",
">",
"{",
"@code",
"myTurtle",
".",
"move",
"(",
"100",
")",
"}",
"<",
"/",
"p",
">"
] | 516fee15e537ecdb3f4dcbe3695c5cfde7e930da | https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/Turtle.java#L185-L190 | test | Move the segment by the specified amount. | Of course, here is the Java code you requested:
```java
public void move(Number amount)
{
double max = MAX_MOVE_AMOUNT;
Saver<Double> s = penDown ? new Mover(new Point(getX(), getY())) : new EmptyMover();
animate(amount.doubleValue(), max, s);
}
```
Hope this helps! |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/ReflectionUtils.java | ReflectionUtils.findMatchingSetters | public static Set<Class> findMatchingSetters(Class obClass, String propertyName)
{
/*log.fine("private Set<Class> findMatchingSetters(Object ob, String propertyName): called");*/
Set<Class> types = new HashSet<Class>();
// Convert the first letter of the property name to upper case to match... | java | public static Set<Class> findMatchingSetters(Class obClass, String propertyName)
{
/*log.fine("private Set<Class> findMatchingSetters(Object ob, String propertyName): called");*/
Set<Class> types = new HashSet<Class>();
// Convert the first letter of the property name to upper case to match... | [
"public",
"static",
"Set",
"<",
"Class",
">",
"findMatchingSetters",
"(",
"Class",
"obClass",
",",
"String",
"propertyName",
")",
"{",
"/*log.fine(\"private Set<Class> findMatchingSetters(Object ob, String propertyName): called\");*/",
"Set",
"<",
"Class",
">",
"types",
"="... | Finds the argument types of all setter methods on a bean for a given property name. For a method to be a setter
method it must have a void return type, be public and accept only a single argument. Its name must be 'set'
followed by the property name.
@param obClass The class to find all setter methods matching a... | [
"Finds",
"the",
"argument",
"types",
"of",
"all",
"setter",
"methods",
"on",
"a",
"bean",
"for",
"a",
"given",
"property",
"name",
".",
"For",
"a",
"method",
"to",
"be",
"a",
"setter",
"method",
"it",
"must",
"have",
"a",
"void",
"return",
"type",
"be"... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/ReflectionUtils.java#L366-L399 | test | Find the matching setters for the given property name. | Of course, here is the Java code you requested:
```java
public static Set<Class> findMatchingSetters(Class obClass, String propertyName)
{
/*log.fine("private Set<Class> findMatchingSetters(Object ob, String propertyName): called");*/
Set<Class> types = new HashSet<Class>();
// Convert the... |
Unidata/thredds | httpservices/src/main/java/ucar/httpservices/HTTPAuthUtil.java | HTTPAuthUtil.authscopeUpgrade | static AuthScope
authscopeUpgrade(AuthScope ss, AuthScope ms)
{
assert (HTTPAuthUtil.authscopeCompatible(ss, ms));
String sss = ss.getScheme().toLowerCase();
String mss = ms.getScheme().toLowerCase();
String upgrade = sss;
if(sss.startsWith("http") && mss.startsWith("http... | java | static AuthScope
authscopeUpgrade(AuthScope ss, AuthScope ms)
{
assert (HTTPAuthUtil.authscopeCompatible(ss, ms));
String sss = ss.getScheme().toLowerCase();
String mss = ms.getScheme().toLowerCase();
String upgrade = sss;
if(sss.startsWith("http") && mss.startsWith("http... | [
"static",
"AuthScope",
"authscopeUpgrade",
"(",
"AuthScope",
"ss",
",",
"AuthScope",
"ms",
")",
"{",
"assert",
"(",
"HTTPAuthUtil",
".",
"authscopeCompatible",
"(",
"ss",
",",
"ms",
")",
")",
";",
"String",
"sss",
"=",
"ss",
".",
"getScheme",
"(",
")",
"... | Given a session url AuthScope and a Method url AuthScope,
return a new AuthScope that is the upgrade/merge of the other two.
Here, upgrade changes the scheme (only) to move http -> https.
Assumes authscopeCompatible() is true.
@param ss Session authScope
@param ms Method authScope
@return upgraded AuthScope. | [
"Given",
"a",
"session",
"url",
"AuthScope",
"and",
"a",
"Method",
"url",
"AuthScope",
"return",
"a",
"new",
"AuthScope",
"that",
"is",
"the",
"upgrade",
"/",
"merge",
"of",
"the",
"other",
"two",
".",
"Here",
"upgrade",
"changes",
"the",
"scheme",
"(",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/httpservices/src/main/java/ucar/httpservices/HTTPAuthUtil.java#L75-L88 | test | Upgrade an authscope to a single one. | Of course, here is the Java code you requested:
```java
static AuthScope
authscopeUpgrade(AuthScope ss, AuthScope ms)
{
assert (HTTPAuthUtil.authscopeCompatible(ss, ms));
String sss = ss.getScheme().toLowerCase();
String mss = ms.getScheme().toLowerCase();
String upgrade = sss;
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/security/OSecurityManager.java | OSecurityManager.checkPassword | public boolean checkPassword(final String iPassword, final String iHash) {
if (iHash.startsWith(HASH_ALGORITHM_PREFIX)) {
final String s = iHash.substring(HASH_ALGORITHM_PREFIX.length());
return createSHA256(iPassword).equals(s);
} else if (iHash.startsWith(PBKDF2_ALGORITHM_PREFIX)) {
f... | java | public boolean checkPassword(final String iPassword, final String iHash) {
if (iHash.startsWith(HASH_ALGORITHM_PREFIX)) {
final String s = iHash.substring(HASH_ALGORITHM_PREFIX.length());
return createSHA256(iPassword).equals(s);
} else if (iHash.startsWith(PBKDF2_ALGORITHM_PREFIX)) {
f... | [
"public",
"boolean",
"checkPassword",
"(",
"final",
"String",
"iPassword",
",",
"final",
"String",
"iHash",
")",
"{",
"if",
"(",
"iHash",
".",
"startsWith",
"(",
"HASH_ALGORITHM_PREFIX",
")",
")",
"{",
"final",
"String",
"s",
"=",
"iHash",
".",
"substring",
... | Checks if an hash string matches a password, based on the algorithm found on hash string.
@param iHash
Hash string. Can contain the algorithm as prefix in the format <code>{ALGORITHM}-HASH</code>.
@param iPassword
@return | [
"Checks",
"if",
"an",
"hash",
"string",
"matches",
"a",
"password",
"based",
"on",
"the",
"algorithm",
"found",
"on",
"hash",
"string",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/security/OSecurityManager.java#L97-L115 | test | Check the password against the hash. | Of course, here is the Java code you requested:
```java
public boolean checkPassword(final String iPassword, final String iHash) {
if (iHash.startsWith(HASH_ALGORITHM_PREFIX)) {
final String s = iHash.substring(HASH_ALGORITHM_PREFIX.length());
return createSHA256(iPassword).equals(s);
} else ... |
robeio/robe | robe-servlet/src/main/java/io/robe/servlet/WrapperServlet.java | WrapperServlet.dispatch | private final void dispatch(Method call, UnitOfWork uow, HttpServletRequest req, HttpServletResponse resp) {
if (uow == null) {
try {
ResourceServlet servlet = GuiceBundle.getInjector().getInstance(servletClass);
call.invoke(servlet, req, resp);
} catch (E... | java | private final void dispatch(Method call, UnitOfWork uow, HttpServletRequest req, HttpServletResponse resp) {
if (uow == null) {
try {
ResourceServlet servlet = GuiceBundle.getInjector().getInstance(servletClass);
call.invoke(servlet, req, resp);
} catch (E... | [
"private",
"final",
"void",
"dispatch",
"(",
"Method",
"call",
",",
"UnitOfWork",
"uow",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"{",
"if",
"(",
"uow",
"==",
"null",
")",
"{",
"try",
"{",
"ResourceServlet",
"servlet",
"=",
... | Executes the desired method call with a new instance of the {@link ResourceServlet} implementation.
Transaction management is done here.
@param call
@param uow
@param req
@param resp | [
"Executes",
"the",
"desired",
"method",
"call",
"with",
"a",
"new",
"instance",
"of",
"the",
"{",
"@link",
"ResourceServlet",
"}",
"implementation",
".",
"Transaction",
"management",
"is",
"done",
"here",
"."
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-servlet/src/main/java/io/robe/servlet/WrapperServlet.java#L119-L147 | test | Dispatch a method to the application. | Of course, here is the Java code you requested:
```java
private final void dispatch(Method call, UnitOfWork uow, HttpServletRequest req, HttpServletResponse resp) {
if (uow == null) {
try {
ResourceServlet servlet = GuiceBundle.getInjector().getInstance(servletClass);
... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/LambertAzimuthalEqualArea.java | LambertAzimuthalEqualArea.latLonToProj | public float[][] latLonToProj(float[][] from, float[][] to, int latIndex,
int lonIndex) {
int cnt = from[0].length;
float[] fromLatA = from[latIndex];
float[] fromLonA = from[lonIndex];
float[] resultXA = to[INDEX_X];
float[] resultYA = to[INDEX_Y];
double ... | java | public float[][] latLonToProj(float[][] from, float[][] to, int latIndex,
int lonIndex) {
int cnt = from[0].length;
float[] fromLatA = from[latIndex];
float[] fromLonA = from[lonIndex];
float[] resultXA = to[INDEX_X];
float[] resultYA = to[INDEX_Y];
double ... | [
"public",
"float",
"[",
"]",
"[",
"]",
"latLonToProj",
"(",
"float",
"[",
"]",
"[",
"]",
"from",
",",
"float",
"[",
"]",
"[",
"]",
"to",
",",
"int",
"latIndex",
",",
"int",
"lonIndex",
")",
"{",
"int",
"cnt",
"=",
"from",
"[",
"0",
"]",
".",
... | Convert lat/lon coordinates to projection coordinates.
@param from array of lat/lon coordinates: from[2][n],
where from[0][i], from[1][i] is the (lat,lon)
coordinate of the ith point
@param to resulting array of projection coordinates,
where to[0][i], to[1][i] is the (x,y) coordinate
of the ith point
@param ... | [
"Convert",
"lat",
"/",
"lon",
"coordinates",
"to",
"projection",
"coordinates",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/LambertAzimuthalEqualArea.java#L420-L451 | test | Converts a set of latitude and longitude coordinates into a set of homography coordinates. | Of course, here is the Java code you requested:
```java
public float[][] latLonToProj(float[][] from, float[][] to, int latIndex,
int lonIndex) {
int cnt = from[0].length;
float[] fromLatA = from[latIndex];
float[] fromLonA = from[lonIndex];
float[] resultXA = to[IN... |
playframework/playframework | documentation/manual/working/javaGuide/main/xml/code/javaguide/xml/JavaXmlRequests.java | JavaXmlRequests.sayHelloBP | @BodyParser.Of(BodyParser.Xml.class)
public Result sayHelloBP(Http.Request request) {
Document dom = request.body().asXml();
if (dom == null) {
return badRequest("Expecting Xml data");
} else {
String name = XPath.selectText("//name", dom);
if (name == null) {
return badRequest("... | java | @BodyParser.Of(BodyParser.Xml.class)
public Result sayHelloBP(Http.Request request) {
Document dom = request.body().asXml();
if (dom == null) {
return badRequest("Expecting Xml data");
} else {
String name = XPath.selectText("//name", dom);
if (name == null) {
return badRequest("... | [
"@",
"BodyParser",
".",
"Of",
"(",
"BodyParser",
".",
"Xml",
".",
"class",
")",
"public",
"Result",
"sayHelloBP",
"(",
"Http",
".",
"Request",
"request",
")",
"{",
"Document",
"dom",
"=",
"request",
".",
"body",
"(",
")",
".",
"asXml",
"(",
")",
";",... | #xml-hello-bodyparser | [
"#xml",
"-",
"hello",
"-",
"bodyparser"
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/documentation/manual/working/javaGuide/main/xml/code/javaguide/xml/JavaXmlRequests.java#L32-L45 | test | Say Hello BP | Of course, here is the Java code you requested:
```java
@BodyParser.Of(BodyParser.Xml.class)
public Result sayHelloBP(Http.Request request) {
Document dom = request.body().asXml();
if (dom == null) {
return badRequest("Expecting Xml data");
} else {
String name = XPath.selectText("//name", do... |
real-logic/aeron | aeron-client/src/main/java/io/aeron/logbuffer/TermBlockScanner.java | TermBlockScanner.scan | public static int scan(final UnsafeBuffer termBuffer, final int termOffset, final int limitOffset)
{
int offset = termOffset;
while (offset < limitOffset)
{
final int frameLength = frameLengthVolatile(termBuffer, offset);
if (frameLength <= 0)
{
... | java | public static int scan(final UnsafeBuffer termBuffer, final int termOffset, final int limitOffset)
{
int offset = termOffset;
while (offset < limitOffset)
{
final int frameLength = frameLengthVolatile(termBuffer, offset);
if (frameLength <= 0)
{
... | [
"public",
"static",
"int",
"scan",
"(",
"final",
"UnsafeBuffer",
"termBuffer",
",",
"final",
"int",
"termOffset",
",",
"final",
"int",
"limitOffset",
")",
"{",
"int",
"offset",
"=",
"termOffset",
";",
"while",
"(",
"offset",
"<",
"limitOffset",
")",
"{",
"... | Scan a term buffer for a block of message fragments from an offset up to a limitOffset.
<p>
A scan will terminate if a padding frame is encountered. If first frame in a scan is padding then a block
for the padding is notified. If the padding comes after the first frame in a scan then the scan terminates
at the offset t... | [
"Scan",
"a",
"term",
"buffer",
"for",
"a",
"block",
"of",
"message",
"fragments",
"from",
"an",
"offset",
"up",
"to",
"a",
"limitOffset",
".",
"<p",
">",
"A",
"scan",
"will",
"terminate",
"if",
"a",
"padding",
"frame",
"is",
"encountered",
".",
"If",
"... | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/logbuffer/TermBlockScanner.java#L45-L78 | test | Scans the buffer for a sequence of bytes starting at the given offset. | Of course, here is the Java code you requested:
```java
public static int scan(final UnsafeBuffer termBuffer, final int termOffset, final int limitOffset)
{
int offset = termOffset;
while (offset < limitOffset)
{
final int frameLength = frameLengthVolatile(termBuffer, offset);
... |
google/openrtb | openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbJsonFactory.java | OpenRtbJsonFactory.register | public final <T> OpenRtbJsonFactory register(OpenRtbJsonExtWriter<T> extWriter,
Class<T> extKlass, Class<? extends Message> msgKlass, String fieldName) {
Map<String, Map<String, OpenRtbJsonExtWriter<?>>> mapMsg = extWriters.get(msgKlass.getName());
if (mapMsg == null) {
extWriters.put(msgKlass.getNa... | java | public final <T> OpenRtbJsonFactory register(OpenRtbJsonExtWriter<T> extWriter,
Class<T> extKlass, Class<? extends Message> msgKlass, String fieldName) {
Map<String, Map<String, OpenRtbJsonExtWriter<?>>> mapMsg = extWriters.get(msgKlass.getName());
if (mapMsg == null) {
extWriters.put(msgKlass.getNa... | [
"public",
"final",
"<",
"T",
">",
"OpenRtbJsonFactory",
"register",
"(",
"OpenRtbJsonExtWriter",
"<",
"T",
">",
"extWriter",
",",
"Class",
"<",
"T",
">",
"extKlass",
",",
"Class",
"<",
"?",
"extends",
"Message",
">",
"msgKlass",
",",
"String",
"fieldName",
... | Register an extension writer, bound to a specific field name. This writer will be
used in preference to a non-field-specific writer that may exist for the same class.
@param extWriter code to serialize some {@code extKlass}'s properties
@param extKlass class of extension message, e.g. {@code MyImp.class}
@param msgKla... | [
"Register",
"an",
"extension",
"writer",
"bound",
"to",
"a",
"specific",
"field",
"name",
".",
"This",
"writer",
"will",
"be",
"used",
"in",
"preference",
"to",
"a",
"non",
"-",
"field",
"-",
"specific",
"writer",
"that",
"may",
"exist",
"for",
"the",
"s... | 384ed8dde6bd16ac2faab9afbe5b33367836fdec | https://github.com/google/openrtb/blob/384ed8dde6bd16ac2faab9afbe5b33367836fdec/openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbJsonFactory.java#L168-L180 | test | Registers an OpenRtbJsonExtWriter with the given class and field name. | Of course, here is the Java code you requested:
```java
public final <T> OpenRtbJsonFactory register(OpenRtbJsonExtWriter<T> extWriter,
Class<T> extKlass, Class<? extends Message> msgKlass, String fieldName) {
Map<String, Map<String, OpenRtbJsonExtWriter<?>>> mapMsg = extWriters.get(msgKlass.getName());
... |
orientechnologies/orientdb | graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java | OrientVertex.getEdges | @Override
public Iterable<Edge> getEdges(final Direction iDirection, final String... iLabels) {
return getEdges(null, iDirection, iLabels);
} | java | @Override
public Iterable<Edge> getEdges(final Direction iDirection, final String... iLabels) {
return getEdges(null, iDirection, iLabels);
} | [
"@",
"Override",
"public",
"Iterable",
"<",
"Edge",
">",
"getEdges",
"(",
"final",
"Direction",
"iDirection",
",",
"final",
"String",
"...",
"iLabels",
")",
"{",
"return",
"getEdges",
"(",
"null",
",",
"iDirection",
",",
"iLabels",
")",
";",
"}"
] | Returns the edges connected to the current Vertex. If you are interested on just counting the edges use @countEdges that it's
more efficient for this use case.
@param iDirection The direction between OUT, IN or BOTH
@param iLabels Optional labels as Strings to consider
@return | [
"Returns",
"the",
"edges",
"connected",
"to",
"the",
"current",
"Vertex",
".",
"If",
"you",
"are",
"interested",
"on",
"just",
"counting",
"the",
"edges",
"use",
"@countEdges",
"that",
"it",
"s",
"more",
"efficient",
"for",
"this",
"use",
"case",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java#L821-L824 | test | Returns an iterable of edges in the node with the specified labels. | Of course, here is the Java code you requested:
```java
@Override
public Iterable<Edge> getEdges(final Direction iDirection, final String... iLabels) {
return getEdges(null, iDirection, iLabels);
}
```
Hope this helps! |
GojaFramework/goja | goja-web/src/main/java/goja/mvc/datatables/DTDao.java | DTDao.paginate | public static Page<Record> paginate(String sqlPaginatePrefix,
DTCriterias criterias,
List<Object> params) {
SqlNode sqlNode = SqlKit.sqlNode(sqlPaginatePrefix + ".paginate");
Preconditions.checkNotNull(sqlNode, "[" + sqlPagi... | java | public static Page<Record> paginate(String sqlPaginatePrefix,
DTCriterias criterias,
List<Object> params) {
SqlNode sqlNode = SqlKit.sqlNode(sqlPaginatePrefix + ".paginate");
Preconditions.checkNotNull(sqlNode, "[" + sqlPagi... | [
"public",
"static",
"Page",
"<",
"Record",
">",
"paginate",
"(",
"String",
"sqlPaginatePrefix",
",",
"DTCriterias",
"criterias",
",",
"List",
"<",
"Object",
">",
"params",
")",
"{",
"SqlNode",
"sqlNode",
"=",
"SqlKit",
".",
"sqlNode",
"(",
"sqlPaginatePrefix",... | Paging retrieve, default sorted by id, you need to specify the datatables request parameters.
@param sqlPaginatePrefix 分页搜索前缀
@param criterias required parameter
@return Paging data. | [
"Paging",
"retrieve",
"default",
"sorted",
"by",
"id",
"you",
"need",
"to",
"specify",
"the",
"datatables",
"request",
"parameters",
"."
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/mvc/datatables/DTDao.java#L58-L64 | test | Paginate a page of records. | Of course, here is the Java code you requested:
```java
public static Page<Record> paginate(String sqlPaginatePrefix,
DTCriterias criterias,
List<Object> params) {
SqlNode sqlNode = SqlKit.sqlNode(sqlPaginatePrefix + ".paginate");
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/conv/Jason2Convention.java | Jason2Convention.getAxisType | protected AxisType getAxisType(NetcdfDataset ncDataset,
VariableEnhanced v) {
String name = v.getShortName();
if (name.equals("time")) {
return AxisType.Time;
}
if (name.equals("lat")) {
return AxisType.Lat;
}
... | java | protected AxisType getAxisType(NetcdfDataset ncDataset,
VariableEnhanced v) {
String name = v.getShortName();
if (name.equals("time")) {
return AxisType.Time;
}
if (name.equals("lat")) {
return AxisType.Lat;
}
... | [
"protected",
"AxisType",
"getAxisType",
"(",
"NetcdfDataset",
"ncDataset",
",",
"VariableEnhanced",
"v",
")",
"{",
"String",
"name",
"=",
"v",
".",
"getShortName",
"(",
")",
";",
"if",
"(",
"name",
".",
"equals",
"(",
"\"time\"",
")",
")",
"{",
"return",
... | _more_
@param ncDataset _more_
@param v _more_
@return _more_ | [
"_more_"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/conv/Jason2Convention.java#L60-L78 | test | Gets the axis type from the variable enhanced. | Of course, here is the Java code you requested:
```java
protected AxisType getAxisType(NetcdfDataset ncDataset,
VariableEnhanced v) {
String name = v.getShortName();
if (name.equals("time")) {
return AxisType.Time;
}
if (name.equals("... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.maxPooling2d | public SDVariable maxPooling2d(SDVariable[] inputs, Pooling2DConfig pooling2DConfig) {
return maxPooling2d(null, inputs, pooling2DConfig);
} | java | public SDVariable maxPooling2d(SDVariable[] inputs, Pooling2DConfig pooling2DConfig) {
return maxPooling2d(null, inputs, pooling2DConfig);
} | [
"public",
"SDVariable",
"maxPooling2d",
"(",
"SDVariable",
"[",
"]",
"inputs",
",",
"Pooling2DConfig",
"pooling2DConfig",
")",
"{",
"return",
"maxPooling2d",
"(",
"null",
",",
"inputs",
",",
"pooling2DConfig",
")",
";",
"}"
] | Max pooling 2d operation.
@param inputs the inputs to max pooling 2d
@param pooling2DConfig the configuration
@return | [
"Max",
"pooling",
"2d",
"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#L1704-L1706 | test | Max pooling 2d operation | Of course, here is the Java code you requested:
```java
public SDVariable maxPooling2d(SDVariable[] inputs, Pooling2DConfig pooling2DConfig) {
return maxPooling2d(null, inputs, pooling2DConfig);
}
```
Hope this helps! |
wro4j/wro4j | wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/emberjs/EmberJs.java | EmberJs.compile | @Override
public String compile(final String content, final String name) {
final String precompiledFunction = super.compile(content, "");
return String.format("(function() {Ember.TEMPLATES[%s] = Ember.Handlebars.template(%s)})();", name, precompiledFunction);
} | java | @Override
public String compile(final String content, final String name) {
final String precompiledFunction = super.compile(content, "");
return String.format("(function() {Ember.TEMPLATES[%s] = Ember.Handlebars.template(%s)})();", name, precompiledFunction);
} | [
"@",
"Override",
"public",
"String",
"compile",
"(",
"final",
"String",
"content",
",",
"final",
"String",
"name",
")",
"{",
"final",
"String",
"precompiledFunction",
"=",
"super",
".",
"compile",
"(",
"content",
",",
"\"\"",
")",
";",
"return",
"String",
... | visible for testing, the init of a HandlebarsJs template | [
"visible",
"for",
"testing",
"the",
"init",
"of",
"a",
"HandlebarsJs",
"template"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/emberjs/EmberJs.java#L30-L34 | test | Override compile to provide a precompiled template. | Of course, here is the Java code you requested:
```java
@Override
public String compile(final String content, final String name) {
final String precompiledFunction = super.compile(content, "");
return String.format("(function() {Ember.TEMPLATES[%s] = Ember.Handlebars.template(%s)})();", name, precompiledFunc... |
Unidata/thredds | cdm/src/main/java/ucar/ma2/Range.java | Range.compact | public Range compact() throws InvalidRangeException {
if (stride == 1) return this;
int first = first() / stride; // LOOK WTF ?
int last = first + length() - 1;
return new Range(name, first, last, 1);
} | java | public Range compact() throws InvalidRangeException {
if (stride == 1) return this;
int first = first() / stride; // LOOK WTF ?
int last = first + length() - 1;
return new Range(name, first, last, 1);
} | [
"public",
"Range",
"compact",
"(",
")",
"throws",
"InvalidRangeException",
"{",
"if",
"(",
"stride",
"==",
"1",
")",
"return",
"this",
";",
"int",
"first",
"=",
"first",
"(",
")",
"/",
"stride",
";",
"// LOOK WTF ?",
"int",
"last",
"=",
"first",
"+",
"... | Create a new Range by compacting this Range by removing the stride.
first = first/stride, last=last/stride, stride=1.
@return compacted Range
@throws InvalidRangeException elements must be nonnegative, 0 <= first <= last | [
"Create",
"a",
"new",
"Range",
"by",
"compacting",
"this",
"Range",
"by",
"removing",
"the",
"stride",
".",
"first",
"=",
"first",
"/",
"stride",
"last",
"=",
"last",
"/",
"stride",
"stride",
"=",
"1",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/Range.java#L265-L270 | test | Returns a new range that is compacted. | Of course, here is the Java code you requested:
```java
public Range compact() throws InvalidRangeException {
if (stride == 1) return this;
int first = first() / stride; // LOOK WTF ?
int last = first + length() - 1;
return new Range(name, first, last, 1);
}
```
Hope this helps! |
eiichiro/bootleg | src/main/java/org/eiichiro/bootleg/Types.java | Types.getElementType | public static Class<?> getElementType(Type type) {
if (isCollection(type)) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
return (Class<?>) parameterizedType.getActualTypeArguments()[0];
} else {
return Object.class;
}
} else if (i... | java | public static Class<?> getElementType(Type type) {
if (isCollection(type)) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
return (Class<?>) parameterizedType.getActualTypeArguments()[0];
} else {
return Object.class;
}
} else if (i... | [
"public",
"static",
"Class",
"<",
"?",
">",
"getElementType",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"isCollection",
"(",
"type",
")",
")",
"{",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
"ParameterizedType",
"parameterizedType",
"=",... | Returns the element type of the specified collection type.
The specified type must be collection or array. To make it sure, use
{@code #isCollection(Type)} method or {@code #isArray(Type)} method.
@param type Collection or array type.
@return The element type of the specified collection or array.
@throws IllegalArgume... | [
"Returns",
"the",
"element",
"type",
"of",
"the",
"specified",
"collection",
"type",
".",
"The",
"specified",
"type",
"must",
"be",
"collection",
"or",
"array",
".",
"To",
"make",
"it",
"sure",
"use",
"{",
"@code",
"#isCollection",
"(",
"Type",
")",
"}",
... | b98a108500597cb6185056be2eef7de5ba1963d2 | https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/Types.java#L303-L324 | test | Gets the element type. | Of course, here is the Java code you requested:
```java
public static Class<?> getElementType(Type type) {
if (isCollection(type)) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
return (Class<?>) parameterizedType.getActualTypeArguments()[0];
... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/locator/factory/InjectableUriLocatorFactoryDecorator.java | InjectableUriLocatorFactoryDecorator.locate | public InputStream locate(final String uri)
throws IOException {
final UriLocator locator = getInstance(uri);
if (locator == null) {
return getDecoratedObject().locate(uri);
}
return locator.locate(uri);
} | java | public InputStream locate(final String uri)
throws IOException {
final UriLocator locator = getInstance(uri);
if (locator == null) {
return getDecoratedObject().locate(uri);
}
return locator.locate(uri);
} | [
"public",
"InputStream",
"locate",
"(",
"final",
"String",
"uri",
")",
"throws",
"IOException",
"{",
"final",
"UriLocator",
"locator",
"=",
"getInstance",
"(",
"uri",
")",
";",
"if",
"(",
"locator",
"==",
"null",
")",
"{",
"return",
"getDecoratedObject",
"("... | This implementation shows the problem with current design of locator implementation. Needs to be changed. | [
"This",
"implementation",
"shows",
"the",
"problem",
"with",
"current",
"design",
"of",
"locator",
"implementation",
".",
"Needs",
"to",
"be",
"changed",
"."
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/locator/factory/InjectableUriLocatorFactoryDecorator.java#L35-L43 | test | Locate an input stream for a URI. | Of course, here is the Java code you requested:
```java
public InputStream locate(final String uri)
throws IOException {
final UriLocator locator = getInstance(uri);
if (locator == null) {
return getDecoratedObject().locate(uri);
}
return locator.locate(uri);
}
```
Hope this helps! |
objectify/objectify | src/main/java/com/googlecode/objectify/Key.java | Key.getKind | public static String getKind(final Class<?> clazz) {
final String kind = getKindRecursive(clazz);
if (kind == null)
return clazz.getSimpleName();
else
return kind;
} | java | public static String getKind(final Class<?> clazz) {
final String kind = getKindRecursive(clazz);
if (kind == null)
return clazz.getSimpleName();
else
return kind;
} | [
"public",
"static",
"String",
"getKind",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"final",
"String",
"kind",
"=",
"getKindRecursive",
"(",
"clazz",
")",
";",
"if",
"(",
"kind",
"==",
"null",
")",
"return",
"clazz",
".",
"getSimpleName",
... | <p>Determines the kind for a Class, as understood by the datastore. The first class in a
hierarchy that has @Entity defines the kind (either explicitly or as that class' simplename).</p>
<p>If no @Entity annotation is found, just uses the simplename as is.</p> | [
"<p",
">",
"Determines",
"the",
"kind",
"for",
"a",
"Class",
"as",
"understood",
"by",
"the",
"datastore",
".",
"The",
"first",
"class",
"in",
"a",
"hierarchy",
"that",
"has",
"@Entity",
"defines",
"the",
"kind",
"(",
"either",
"explicitly",
"or",
"as",
... | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/Key.java#L354-L360 | test | Gets the kind of the class. | Of course, here is the Java code you requested:
```java
public static String getKind(final Class<?> clazz) {
final String kind = getKindRecursive(clazz);
if (kind == null)
return clazz.getSimpleName();
else
return kind;
}
```
Hope this helps! |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.status | public static Result status(int status, JsonNode content, JsonEncoding encoding) {
if (content == null) {
throw new NullPointerException("Null content");
}
return status(status).sendJson(content, encoding);
} | java | public static Result status(int status, JsonNode content, JsonEncoding encoding) {
if (content == null) {
throw new NullPointerException("Null content");
}
return status(status).sendJson(content, encoding);
} | [
"public",
"static",
"Result",
"status",
"(",
"int",
"status",
",",
"JsonNode",
"content",
",",
"JsonEncoding",
"encoding",
")",
"{",
"if",
"(",
"content",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Null content\"",
")",
";",
"}",... | Generates a simple result with json content.
@param status the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)
@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",
"simple",
"result",
"with",
"json",
"content",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L110-L115 | test | Send a JSON response with the given status code and content. | Of course, here is the Java code you requested:
```java
public static Result status(int status, JsonNode content, JsonEncoding encoding) {
if (content == null) {
throw new NullPointerException("Null content");
}
return status(status).sendJson(content, encoding);
}
```
Hope this helps! |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.zip | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T, R> Observable<R> zip(Iterable<? extends ObservableSource<? extends T>> sources, Function<? super Object[], ? extends R> zipper) {
ObjectHelper.requireNonNull(zipper, "zipper is null");
ObjectHelper.requireNonNull(source... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T, R> Observable<R> zip(Iterable<? extends ObservableSource<? extends T>> sources, Function<? super Object[], ? extends R> zipper) {
ObjectHelper.requireNonNull(zipper, "zipper is null");
ObjectHelper.requireNonNull(source... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
",",
"R",
">",
"Observable",
"<",
"R",
">",
"zip",
"(",
"Iterable",
"<",
"?",
"extends",
"ObservableSource",
"<",
"?",
"extends",
"T"... | Returns an Observable that emits the results of a specified combiner function applied to combinations of
items emitted, in sequence, by an Iterable of other ObservableSources.
<p>
{@code zip} applies this function in strict sequence, so the first item emitted by the new ObservableSource
will be the result of the functi... | [
"Returns",
"an",
"Observable",
"that",
"emits",
"the",
"results",
"of",
"a",
"specified",
"combiner",
"function",
"applied",
"to",
"combinations",
"of",
"items",
"emitted",
"in",
"sequence",
"by",
"an",
"Iterable",
"of",
"other",
"ObservableSources",
".",
"<p",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L4137-L4143 | test | Zip an observable sequence of source observable objects into an observable sequence of results. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T, R> Observable<R> zip(Iterable<? extends ObservableSource<? extends T>> sources, Function<? super Object[], ? extends R> zipper) {
ObjectHelper.requireNonNull(zipper, "zip... |
RestComm/jain-slee | container/profiles/src/main/java/org/mobicents/slee/container/deployment/profile/jpa/JPAQueryBuilder.java | JPAQueryBuilder.replaceLast | private static String replaceLast(String sourceString, String toBeReplaced, String replacement)
{
StringBuilder x = new StringBuilder(sourceString);
int liof = x.lastIndexOf(toBeReplaced);
if(liof >= 0)
x.replace(liof, liof+4, replacement);
return new String(x);
} | java | private static String replaceLast(String sourceString, String toBeReplaced, String replacement)
{
StringBuilder x = new StringBuilder(sourceString);
int liof = x.lastIndexOf(toBeReplaced);
if(liof >= 0)
x.replace(liof, liof+4, replacement);
return new String(x);
} | [
"private",
"static",
"String",
"replaceLast",
"(",
"String",
"sourceString",
",",
"String",
"toBeReplaced",
",",
"String",
"replacement",
")",
"{",
"StringBuilder",
"x",
"=",
"new",
"StringBuilder",
"(",
"sourceString",
")",
";",
"int",
"liof",
"=",
"x",
".",
... | ###################### | [
"######################"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/deployment/profile/jpa/JPAQueryBuilder.java#L431-L440 | test | Replaces the last substring of sourceString with toBeReplaced with replacement | Of course, here is the Java code you requested:
```java
private static String replaceLast(String sourceString, String toBeReplaced, String replacement)
{
StringBuilder x = new StringBuilder(sourceString);
int liof = x.lastIndexOf(toBeReplaced);
if(liof >= 0)
x.replace(liof, liof+4, replace... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/csiv2/CSIv2Util.java | CSIv2Util.createSecurityTaggedComponent | public static TaggedComponent createSecurityTaggedComponent(IORSecurityConfigMetaData metadata, Codec codec,
int sslPort, ORB orb) {
if (metadata == null) {
IIOPLogger.ROOT_LOGGER.debug("Method createSecurityTaggedComponent() called wit... | java | public static TaggedComponent createSecurityTaggedComponent(IORSecurityConfigMetaData metadata, Codec codec,
int sslPort, ORB orb) {
if (metadata == null) {
IIOPLogger.ROOT_LOGGER.debug("Method createSecurityTaggedComponent() called wit... | [
"public",
"static",
"TaggedComponent",
"createSecurityTaggedComponent",
"(",
"IORSecurityConfigMetaData",
"metadata",
",",
"Codec",
"codec",
",",
"int",
"sslPort",
",",
"ORB",
"orb",
")",
"{",
"if",
"(",
"metadata",
"==",
"null",
")",
"{",
"IIOPLogger",
".",
"RO... | <p>
Return a top-level {@code IOP:TaggedComponent} to be stuffed into an IOR, containing a {@code org.omg.CSIIOP}.
{@code CompoundSecMechList}, tagged as {@code TAG_CSI_SEC_MECH_LIST}. Only one such component can exist inside
an IOR.
</p>
<p>
Should be called with non-null metadata, in which case we probably don't want... | [
"<p",
">",
"Return",
"a",
"top",
"-",
"level",
"{",
"@code",
"IOP",
":",
"TaggedComponent",
"}",
"to",
"be",
"stuffed",
"into",
"an",
"IOR",
"containing",
"a",
"{",
"@code",
"org",
".",
"omg",
".",
"CSIIOP",
"}",
".",
"{",
"@code",
"CompoundSecMechList... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/csiv2/CSIv2Util.java#L172-L197 | test | Create a TaggedComponent from the IORSecurityConfigMetaData. | Of course, here is the Java code you requested:
```java
public static TaggedComponent createSecurityTaggedComponent(IORSecurityConfigMetaData metadata, Codec codec,
int sslPort, ORB orb) {
if (metadata == null) {
IIOPLogger.ROOT_LOGGER... |
jboss/jboss-common-core | src/main/java/org/jboss/util/xml/catalog/Resolver.java | Resolver.resolveExternalPublic | protected String resolveExternalPublic(String publicId, String resolver)
throws MalformedURLException, IOException {
Resolver r = queryResolver(resolver, "fpi2l", publicId, null);
if (r != null) {
return r.resolvePublic(publicId, null);
} else {
return null;
}
} | java | protected String resolveExternalPublic(String publicId, String resolver)
throws MalformedURLException, IOException {
Resolver r = queryResolver(resolver, "fpi2l", publicId, null);
if (r != null) {
return r.resolvePublic(publicId, null);
} else {
return null;
}
} | [
"protected",
"String",
"resolveExternalPublic",
"(",
"String",
"publicId",
",",
"String",
"resolver",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"Resolver",
"r",
"=",
"queryResolver",
"(",
"resolver",
",",
"\"fpi2l\"",
",",
"publicId",
",",
"... | Query an external RFC2483 resolver for a public identifier.
@param publicId The system ID to locate.
@param resolver The name of the resolver to use.
@throws MalformedURLException
@throws IOException
@return The system identifier to use for the systemId. | [
"Query",
"an",
"external",
"RFC2483",
"resolver",
"for",
"a",
"public",
"identifier",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Resolver.java#L342-L350 | test | Resolve an external public id. | Of course, here is the Java code you requested:
```java
protected String resolveExternalPublic(String publicId, String resolver)
throws MalformedURLException, IOException {
Resolver r = queryResolver(resolver, "fpi2l", publicId, null);
if (r != null) {
return r.resolvePublic(publicId, null);
} else {
ret... |
1337joe/cubesensors-for-java | src/main/java/com/w3asel/cubesensors/api/v1/CubeSensorsApiV1.java | CubeSensorsApiV1.getSpan | public List<State> getSpan(final String uid, final ZonedDateTime start, final ZonedDateTime end, final Integer resolution) {
final String queryUrl = RESOURCES_ROOT + DEVICES_PATH + uid + "/span";
LOGGER.trace("Querying: {}", queryUrl);
final OAuthRequest request = new OAuthRequest(Verb.GET, queryUrl);
req... | java | public List<State> getSpan(final String uid, final ZonedDateTime start, final ZonedDateTime end, final Integer resolution) {
final String queryUrl = RESOURCES_ROOT + DEVICES_PATH + uid + "/span";
LOGGER.trace("Querying: {}", queryUrl);
final OAuthRequest request = new OAuthRequest(Verb.GET, queryUrl);
req... | [
"public",
"List",
"<",
"State",
">",
"getSpan",
"(",
"final",
"String",
"uid",
",",
"final",
"ZonedDateTime",
"start",
",",
"final",
"ZonedDateTime",
"end",
",",
"final",
"Integer",
"resolution",
")",
"{",
"final",
"String",
"queryUrl",
"=",
"RESOURCES_ROOT",
... | Queries for a list of states over the time span specified. Leaving a field {@code null} will default to the API defaults.
@param uid
the UID of the device to request data for
@param start
the query start time
@param end
the query end time
@param resolution
the resolution in minutes
@return a list of all states returne... | [
"Queries",
"for",
"a",
"list",
"of",
"states",
"over",
"the",
"time",
"span",
"specified",
".",
"Leaving",
"a",
"field",
"{",
"@code",
"null",
"}",
"will",
"default",
"to",
"the",
"API",
"defaults",
"."
] | f3ba432d36b744e68b916682d7ef24afaff447f8 | https://github.com/1337joe/cubesensors-for-java/blob/f3ba432d36b744e68b916682d7ef24afaff447f8/src/main/java/com/w3asel/cubesensors/api/v1/CubeSensorsApiV1.java#L245-L285 | test | Gets the span of the device. | Of course, here is the Java code you requested:
```java
public List<State> getSpan(final String uid, final ZonedDateTime start, final ZonedDateTime end, final Integer resolution) {
final String queryUrl = RESOURCES_ROOT + DEVICES_PATH + uid + "/span";
LOGGER.trace("Querying: {}", queryUrl);
final OAuthReque... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/image/ScalablePicture.java | ScalablePicture.createScaledPictureInThread | public void createScaledPictureInThread(int priority) {
setStatus(SCALING, "Scaling picture.");
ScaleThread t = new ScaleThread(this);
t.setPriority(priority);
t.start();
} | java | public void createScaledPictureInThread(int priority) {
setStatus(SCALING, "Scaling picture.");
ScaleThread t = new ScaleThread(this);
t.setPriority(priority);
t.start();
} | [
"public",
"void",
"createScaledPictureInThread",
"(",
"int",
"priority",
")",
"{",
"setStatus",
"(",
"SCALING",
",",
"\"Scaling picture.\"",
")",
";",
"ScaleThread",
"t",
"=",
"new",
"ScaleThread",
"(",
"this",
")",
";",
"t",
".",
"setPriority",
"(",
"priority... | method that creates the scaled image in the background in it's own thread.
@param priority The priority this image takes relative to the others. | [
"method",
"that",
"creates",
"the",
"scaled",
"image",
"in",
"the",
"background",
"in",
"it",
"s",
"own",
"thread",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/image/ScalablePicture.java#L362-L367 | test | Creates a ScaleThread and starts it. | Of course, here is the Java code you requested:
```java
public void createScaledPictureInThread(int priority) {
setStatus(SCALING, "Scaling picture.");
ScaleThread t = new ScaleThread(this);
t.setPriority(priority);
t.start();
}
```
Hope this helps! |
Unidata/thredds | udunits/src/main/java/ucar/units/PrefixDBImpl.java | PrefixDBImpl.addSymbol | public void addSymbol(final String symbol, final double value)
throws PrefixExistsException {
final Prefix prefix = new PrefixSymbol(symbol, value);
symbolSet.add(prefix);
valueMap.put(new Double(value), prefix);
} | java | public void addSymbol(final String symbol, final double value)
throws PrefixExistsException {
final Prefix prefix = new PrefixSymbol(symbol, value);
symbolSet.add(prefix);
valueMap.put(new Double(value), prefix);
} | [
"public",
"void",
"addSymbol",
"(",
"final",
"String",
"symbol",
",",
"final",
"double",
"value",
")",
"throws",
"PrefixExistsException",
"{",
"final",
"Prefix",
"prefix",
"=",
"new",
"PrefixSymbol",
"(",
"symbol",
",",
"value",
")",
";",
"symbolSet",
".",
"... | Adds a prefix symbol to the database.
@param symbol
The symbol of the prefix to be added.
@param value
The value of the prefix.
@throws PrefixExistsException
Another prefix with the same symbol or value already exists
in the database. | [
"Adds",
"a",
"prefix",
"symbol",
"to",
"the",
"database",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/PrefixDBImpl.java#L83-L88 | test | Add a symbol to the prefix set. | Of course, here is the Java code you requested:
```java
public void addSymbol(final String symbol, final double value)
throws PrefixExistsException {
final Prefix prefix = new PrefixSymbol(symbol, value);
symbolSet.add(prefix);
valueMap.put(new Double(value), prefix);
}
```
Hope this helps! |
wildfly/wildfly | jpa/hibernate4_3/src/main/java/org/jboss/as/jpa/hibernate4/management/QueryName.java | QueryName.displayable | private String displayable(String query) {
if (query == null ||
query.length() == 0) {
return query;
}
StringBuilder buff = new StringBuilder(query);
// handle two character transforms first
subst(buff, SQL_NE, NOT_EQUAL__);
subst(buff, NE_BANG, ... | java | private String displayable(String query) {
if (query == null ||
query.length() == 0) {
return query;
}
StringBuilder buff = new StringBuilder(query);
// handle two character transforms first
subst(buff, SQL_NE, NOT_EQUAL__);
subst(buff, NE_BANG, ... | [
"private",
"String",
"displayable",
"(",
"String",
"query",
")",
"{",
"if",
"(",
"query",
"==",
"null",
"||",
"query",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"query",
";",
"}",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",... | transform a Hibernate HQL query into something that can be displayed/used for management operations
@param query
@return | [
"transform",
"a",
"Hibernate",
"HQL",
"query",
"into",
"something",
"that",
"can",
"be",
"displayed",
"/",
"used",
"for",
"management",
"operations"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/hibernate4_3/src/main/java/org/jboss/as/jpa/hibernate4/management/QueryName.java#L156-L198 | test | Display a string in the format that is suitable for use in a SQL statement. | Of course, here is the Java code you requested:
```java
private String displayable(String query) {
if (query == null ||
query.length() == 0) {
return query;
}
StringBuilder buff = new StringBuilder(query);
// handle two character transforms first
subst(... |
akquinet/chameRIA | chameria-webview-factory/src/main/java/de/akquinet/chameria/webview/WebViewFactory.java | WebViewFactory.start | @Validate
public void start() {
QApplication.invokeLater(new Runnable() {
public void run() {
configureApplication();
m_logger.info("Creating a web ui...");
synchronized (WebViewFactory.this) {
m_browser = new WebWindow(m_url, ... | java | @Validate
public void start() {
QApplication.invokeLater(new Runnable() {
public void run() {
configureApplication();
m_logger.info("Creating a web ui...");
synchronized (WebViewFactory.this) {
m_browser = new WebWindow(m_url, ... | [
"@",
"Validate",
"public",
"void",
"start",
"(",
")",
"{",
"QApplication",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"configureApplication",
"(",
")",
";",
"m_logger",
".",
"info",
"(",
"\"Creating... | Starts the browser and loads the
set url in the web view. | [
"Starts",
"the",
"browser",
"and",
"loads",
"the",
"set",
"url",
"in",
"the",
"web",
"view",
"."
] | a5c154e0d0f70f24381db93d57b70364e6c2db0b | https://github.com/akquinet/chameRIA/blob/a5c154e0d0f70f24381db93d57b70364e6c2db0b/chameria-webview-factory/src/main/java/de/akquinet/chameria/webview/WebViewFactory.java#L313-L328 | test | Start the application. | Of course, here is the Java code you requested:
```java
@Validate
public void start() {
QApplication.invokeLater(new Runnable() {
public void run() {
configureApplication();
m_logger.info("Creating a web ui...");
synchronized (WebViewFactory.this... |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/builder/RequestSpecBuilder.java | RequestSpecBuilder.addMultiPart | public RequestSpecBuilder addMultiPart(String controlName, String fileName, InputStream stream) {
spec.multiPart(controlName, fileName, stream);
return this;
} | java | public RequestSpecBuilder addMultiPart(String controlName, String fileName, InputStream stream) {
spec.multiPart(controlName, fileName, stream);
return this;
} | [
"public",
"RequestSpecBuilder",
"addMultiPart",
"(",
"String",
"controlName",
",",
"String",
"fileName",
",",
"InputStream",
"stream",
")",
"{",
"spec",
".",
"multiPart",
"(",
"controlName",
",",
"fileName",
",",
"stream",
")",
";",
"return",
"this",
";",
"}"
... | Specify an inputstream to upload to the server using multi-part form data.
It will use the content-type <tt>application/octet-stream</tt>. If this is not what you want please use an overloaded method.
@param controlName Defines the control name of the body part. In HTML this is the attribute name of the input tag.
@pa... | [
"Specify",
"an",
"inputstream",
"to",
"upload",
"to",
"the",
"server",
"using",
"multi",
"-",
"part",
"form",
"data",
".",
"It",
"will",
"use",
"the",
"content",
"-",
"type",
"<tt",
">",
"application",
"/",
"octet",
"-",
"stream<",
"/",
"tt",
">",
".",... | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/builder/RequestSpecBuilder.java#L804-L807 | test | Add a multi - part request. | Of course, here is the Java code you requested:
```java
public RequestSpecBuilder addMultiPart(String controlName, String fileName, InputStream stream) {
spec.multiPart(controlName, fileName, stream);
return this;
}
```
Hope this helps! |
streamsets/datacollector | hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveMetastoreUtil.java | HiveMetastoreUtil.isSchemaChangeRecord | public static boolean isSchemaChangeRecord(Record metadataRecord) {
return MetadataRecordType.TABLE.name().equals(metadataRecord.get(SEP + METADATA_RECORD_TYPE).getValueAsString());
} | java | public static boolean isSchemaChangeRecord(Record metadataRecord) {
return MetadataRecordType.TABLE.name().equals(metadataRecord.get(SEP + METADATA_RECORD_TYPE).getValueAsString());
} | [
"public",
"static",
"boolean",
"isSchemaChangeRecord",
"(",
"Record",
"metadataRecord",
")",
"{",
"return",
"MetadataRecordType",
".",
"TABLE",
".",
"name",
"(",
")",
".",
"equals",
"(",
"metadataRecord",
".",
"get",
"(",
"SEP",
"+",
"METADATA_RECORD_TYPE",
")",... | Returns true if this is a TABLE metadata request (new or changed table).
@param metadataRecord the metadata record
@return boolean true or false indicating whether this metadata record is schema change / partition roll record. | [
"Returns",
"true",
"if",
"this",
"is",
"a",
"TABLE",
"metadata",
"request",
"(",
"new",
"or",
"changed",
"table",
")",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveMetastoreUtil.java#L365-L367 | test | Checks if the given record is a schema change record. | Of course, here is the Java code you requested:
```java
public static boolean isSchemaChangeRecord(Record metadataRecord) {
return MetadataRecordType.TABLE.name().equals(metadataRecord.get(SEP + METADATA_RECORD_TYPE).getValueAsString());
}
```
Hope this helps! |
fizzed/jne | src/main/java/com/fizzed/jne/JNE.java | JNE.requireFile | synchronized static public File requireFile(String name, Options options) throws IOException {
File file = findFile(name, options);
if (file == null) {
throw new ResourceNotFoundException("Resource file " + name + " not found");
}
return file;
} | java | synchronized static public File requireFile(String name, Options options) throws IOException {
File file = findFile(name, options);
if (file == null) {
throw new ResourceNotFoundException("Resource file " + name + " not found");
}
return file;
} | [
"synchronized",
"static",
"public",
"File",
"requireFile",
"(",
"String",
"name",
",",
"Options",
"options",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"findFile",
"(",
"name",
",",
"options",
")",
";",
"if",
"(",
"file",
"==",
"null",
")",
... | Same as findFile but throws an exception if the file was not found. | [
"Same",
"as",
"findFile",
"but",
"throws",
"an",
"exception",
"if",
"the",
"file",
"was",
"not",
"found",
"."
] | 783226a1fb002d304d22f841870c5c73575fc994 | https://github.com/fizzed/jne/blob/783226a1fb002d304d22f841870c5c73575fc994/src/main/java/com/fizzed/jne/JNE.java#L351-L357 | test | Require a file. | Of course, here is the Java code you requested:
```java
synchronized static public File requireFile(String name, Options options) throws IOException {
File file = findFile(name, options);
if (file == null) {
throw new ResourceNotFoundException("Resource file " + name + " not found");
... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/geoloc/Rubberband.java | Rubberband.stretch | public void stretch(Point p) {
lastPt.x = stretchedPt.x;
lastPt.y = stretchedPt.y;
stretchedPt.x = p.x;
stretchedPt.y = p.y;
Graphics2D g = (Graphics2D) component.getGraphics();
if(g != null) {
try {
g.setXORMode(component.getBackground());
if(firstStretch == true)
... | java | public void stretch(Point p) {
lastPt.x = stretchedPt.x;
lastPt.y = stretchedPt.y;
stretchedPt.x = p.x;
stretchedPt.y = p.y;
Graphics2D g = (Graphics2D) component.getGraphics();
if(g != null) {
try {
g.setXORMode(component.getBackground());
if(firstStretch == true)
... | [
"public",
"void",
"stretch",
"(",
"Point",
"p",
")",
"{",
"lastPt",
".",
"x",
"=",
"stretchedPt",
".",
"x",
";",
"lastPt",
".",
"y",
"=",
"stretchedPt",
".",
"y",
";",
"stretchedPt",
".",
"x",
"=",
"p",
".",
"x",
";",
"stretchedPt",
".",
"y",
"="... | Erase the last rectangle and draw a new one from the anchor point to this point. | [
"Erase",
"the",
"last",
"rectangle",
"and",
"draw",
"a",
"new",
"one",
"from",
"the",
"anchor",
"point",
"to",
"this",
"point",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/geoloc/Rubberband.java#L87-L107 | test | Stretch the component. | Of course, here is the Java code you requested:
```java
public void stretch(Point p) {
lastPt.x = stretchedPt.x;
lastPt.y = stretchedPt.y;
stretchedPt.x = p.x;
stretchedPt.y = p.y;
Graphics2D g = (Graphics2D) component.getGraphics();
if(g != null) {
try {
g.setXORMode(com... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMCompiledClause.java | WAMCompiledClause.addInstructionsAndThisToParent | private void addInstructionsAndThisToParent(SizeableList<WAMInstruction> instructions)
{
if (!addedToParent)
{
parent.addInstructions(this, instructions);
addedToParent = true;
}
else
{
parent.addInstructions(instructions);
}
} | java | private void addInstructionsAndThisToParent(SizeableList<WAMInstruction> instructions)
{
if (!addedToParent)
{
parent.addInstructions(this, instructions);
addedToParent = true;
}
else
{
parent.addInstructions(instructions);
}
} | [
"private",
"void",
"addInstructionsAndThisToParent",
"(",
"SizeableList",
"<",
"WAMInstruction",
">",
"instructions",
")",
"{",
"if",
"(",
"!",
"addedToParent",
")",
"{",
"parent",
".",
"addInstructions",
"(",
"this",
",",
"instructions",
")",
";",
"addedToParent"... | Adds some instructions to the parent predicate, and also adds this as a clause on the parent, if it has not
already been added.
@param instructions The instructions to add. | [
"Adds",
"some",
"instructions",
"to",
"the",
"parent",
"predicate",
"and",
"also",
"adds",
"this",
"as",
"a",
"clause",
"on",
"the",
"parent",
"if",
"it",
"has",
"not",
"already",
"been",
"added",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMCompiledClause.java#L101-L112 | test | Add the given list of WAM instructions to the parent. | Of course, here is the Java code you requested:
```java
private void addInstructionsAndThisToParent(SizeableList<WAMInstruction> instructions)
{
if (!addedToParent)
{
parent.addInstructions(this, instructions);
addedToParent = true;
}
else
{
... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_7.java | OpenImmo_1_2_7.upgradeFromPreviousVersion | @Override
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_7);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.upgradeSummemietenettoElements(doc.getDocument());
} catch (Exception ex) {
... | java | @Override
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_7);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.upgradeSummemietenettoElements(doc.getDocument());
} catch (Exception ex) {
... | [
"@",
"Override",
"public",
"void",
"upgradeFromPreviousVersion",
"(",
"OpenImmoDocument",
"doc",
")",
"{",
"doc",
".",
"setDocumentVersion",
"(",
"OpenImmoVersion",
".",
"V1_2_7",
")",
";",
"if",
"(",
"doc",
"instanceof",
"OpenImmoTransferDocument",
")",
"{",
"try... | Upgrade an OpenImmo document from version 1.2.6 to 1.2.7.
@param doc OpenImmo document in version 1.2.6 | [
"Upgrade",
"an",
"OpenImmo",
"document",
"from",
"version",
"1",
".",
"2",
".",
"6",
"to",
"1",
".",
"2",
".",
"7",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_7.java#L117-L136 | test | Upgrade from previous version of the document. | Of course, here is the Java code you requested:
```java
@Override
public void upgradeFromPreviousVersion(OpenImmoDocument doc) {
doc.setDocumentVersion(OpenImmoVersion.V1_2_7);
if (doc instanceof OpenImmoTransferDocument) {
try {
this.upgradeSummemietenettoElements(doc.... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/sat/GEOSTransform.java | GEOSTransform.scanGeomToSweepAngleAxis | public static String scanGeomToSweepAngleAxis(String scanGeometry) {
String sweepAngleAxis = "y";
if (scanGeometry.equals(GOES)) {
sweepAngleAxis = "x";
}
return sweepAngleAxis;
} | java | public static String scanGeomToSweepAngleAxis(String scanGeometry) {
String sweepAngleAxis = "y";
if (scanGeometry.equals(GOES)) {
sweepAngleAxis = "x";
}
return sweepAngleAxis;
} | [
"public",
"static",
"String",
"scanGeomToSweepAngleAxis",
"(",
"String",
"scanGeometry",
")",
"{",
"String",
"sweepAngleAxis",
"=",
"\"y\"",
";",
"if",
"(",
"scanGeometry",
".",
"equals",
"(",
"GOES",
")",
")",
"{",
"sweepAngleAxis",
"=",
"\"x\"",
";",
"}",
... | Find sweep_angle_axis associated with a scan geometry
@param scanGeometry scanning geometry (GOES or GEOS)
@return sweep_angle_axis (x or y) | [
"Find",
"sweep_angle_axis",
"associated",
"with",
"a",
"scan",
"geometry"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/sat/GEOSTransform.java#L348-L356 | test | Convert a scan geometry to sweep angle axis | Of course, here is the Java code you requested:
```java
public static String scanGeomToSweepAngleAxis(String scanGeometry) {
String sweepAngleAxis = "y";
if (scanGeometry.equals(GOES)) {
sweepAngleAxis = "x";
}
return sweepAngleAxis;
}
```
Hope this helps! |
ReactiveX/RxJava | src/main/java/io/reactivex/Single.java | Single.toCompletable | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@Deprecated
public final Completable toCompletable() {
return RxJavaPlugins.onAssembly(new CompletableFromSingle<T>(this));
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@Deprecated
public final Completable toCompletable() {
return RxJavaPlugins.onAssembly(new CompletableFromSingle<T>(this));
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"@",
"Deprecated",
"public",
"final",
"Completable",
"toCompletable",
"(",
")",
"{",
"return",
"RxJavaPlugins",
".",
"onAssembly",
"(",
"new",
"CompletableFromSingle",
"<",
... | Returns a {@link Completable} that discards result of the {@link Single}
and calls {@code onComplete} when this source {@link Single} calls
{@code onSuccess}. Error terminal event is propagated.
<p>
<img width="640" height="436" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.toCompletable.... | [
"Returns",
"a",
"{",
"@link",
"Completable",
"}",
"that",
"discards",
"result",
"of",
"the",
"{",
"@link",
"Single",
"}",
"and",
"calls",
"{",
"@code",
"onComplete",
"}",
"when",
"this",
"source",
"{",
"@link",
"Single",
"}",
"calls",
"{",
"@code",
"onSu... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L3895-L3900 | test | Converts a sequence of tokens to an Completable. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@Deprecated
public final Completable toCompletable() {
return RxJavaPlugins.onAssembly(new CompletableFromSingle<T>(this));
}
```
Hope this helps! |
streamsets/datacollector | hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveMetastoreUtil.java | HiveMetastoreUtil.generateInnerFieldFromTheList | private static <T> Field generateInnerFieldFromTheList(
LinkedHashMap<String, T> original,
String innerPairFirstFieldName,
String innerPairSecondFieldName,
boolean isSecondFieldHiveType
) throws HiveStageCheckedException {
List<Field> columnList = new LinkedList<>();
for(Map.Entry<Stri... | java | private static <T> Field generateInnerFieldFromTheList(
LinkedHashMap<String, T> original,
String innerPairFirstFieldName,
String innerPairSecondFieldName,
boolean isSecondFieldHiveType
) throws HiveStageCheckedException {
List<Field> columnList = new LinkedList<>();
for(Map.Entry<Stri... | [
"private",
"static",
"<",
"T",
">",
"Field",
"generateInnerFieldFromTheList",
"(",
"LinkedHashMap",
"<",
"String",
",",
"T",
">",
"original",
",",
"String",
"innerPairFirstFieldName",
",",
"String",
"innerPairSecondFieldName",
",",
"boolean",
"isSecondFieldHiveType",
... | Opposite operation of extractInnerMapFromTheList.
It takes LinkedHashMap and generate a Field that contains the list.
This is to send metadata record to HMS target.
This function is called to for partition type list and partition value list. | [
"Opposite",
"operation",
"of",
"extractInnerMapFromTheList",
".",
"It",
"takes",
"LinkedHashMap",
"and",
"generate",
"a",
"Field",
"that",
"contains",
"the",
"list",
".",
"This",
"is",
"to",
"send",
"metadata",
"record",
"to",
"HMS",
"target",
".",
"This",
"fu... | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveMetastoreUtil.java#L240-L262 | test | Generate the inner field from the list of fields. | Of course, here is the Java code you requested:
```java
private static <T> Field generateInnerFieldFromTheList(
LinkedHashMap<String, T> original,
String innerPairFirstFieldName,
String innerPairSecondFieldName,
boolean isSecondFieldHiveType
) throws HiveStageCheckedException {
List<Field... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/core/util/OptionHelper.java | OptionHelper.getSystemProperty | public static String getSystemProperty(String key) {
try {
String prop = System.getProperty(key);
return (prop == null) ? getAndroidSystemProperty(key) : prop;
} catch (SecurityException e) {
return null;
}
} | java | public static String getSystemProperty(String key) {
try {
String prop = System.getProperty(key);
return (prop == null) ? getAndroidSystemProperty(key) : prop;
} catch (SecurityException e) {
return null;
}
} | [
"public",
"static",
"String",
"getSystemProperty",
"(",
"String",
"key",
")",
"{",
"try",
"{",
"String",
"prop",
"=",
"System",
".",
"getProperty",
"(",
"key",
")",
";",
"return",
"(",
"prop",
"==",
"null",
")",
"?",
"getAndroidSystemProperty",
"(",
"key",... | Very similar to <code>System.getProperty</code> except that the
{@link SecurityException} is absorbed. Also checks Android
system properties as a fallback.
@param key The key to search for.
@return the string value of the system property. | [
"Very",
"similar",
"to",
"<code",
">",
"System",
".",
"getProperty<",
"/",
"code",
">",
"except",
"that",
"the",
"{",
"@link",
"SecurityException",
"}",
"is",
"absorbed",
".",
"Also",
"checks",
"Android",
"system",
"properties",
"as",
"a",
"fallback",
"."
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/util/OptionHelper.java#L206-L213 | test | Get the value of a system property. | Of course, here is the Java code you requested:
```java
public static String getSystemProperty(String key) {
try {
String prop = System.getProperty(key);
return (prop == null) ? getAndroidSystemProperty(key) : prop;
} catch (SecurityException e) {
return null;
}
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/ChartUtility.java | ChartUtility.setUpChartData | public static void setUpChartData(final ChartData chartData,
final CTChart ctChart, final ThemesTable themeTable,
final ChartObject ctObj) {
Object chartObj = null;
@SuppressWarnings("rawtypes")
List plotCharts = ctObj.getChartListFromCtChart(ctChart);
/... | java | public static void setUpChartData(final ChartData chartData,
final CTChart ctChart, final ThemesTable themeTable,
final ChartObject ctObj) {
Object chartObj = null;
@SuppressWarnings("rawtypes")
List plotCharts = ctObj.getChartListFromCtChart(ctChart);
/... | [
"public",
"static",
"void",
"setUpChartData",
"(",
"final",
"ChartData",
"chartData",
",",
"final",
"CTChart",
"ctChart",
",",
"final",
"ThemesTable",
"themeTable",
",",
"final",
"ChartObject",
"ctObj",
")",
"{",
"Object",
"chartObj",
"=",
"null",
";",
"@",
"S... | build chartData for line chart. chartData include categoryList and
seriesList which used for generate jfreechart.
@param chartData
chart data.
@param ctChart
ct chart.
@param themeTable
themeTable used for get color with theme name.
@param ctObj
ct object. | [
"build",
"chartData",
"for",
"line",
"chart",
".",
"chartData",
"include",
"categoryList",
"and",
"seriesList",
"which",
"used",
"for",
"generate",
"jfreechart",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ChartUtility.java#L185-L206 | test | Sets up the ChartData object. | Of course, here is the Java code you requested:
```java
public static void setUpChartData(final ChartData chartData,
final CTChart ctChart, final ThemesTable themeTable,
final ChartObject ctObj) {
Object chartObj = null;
@SuppressWarnings("rawtypes")
List plotChar... |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/component/singleton/EJBReadWriteLock.java | EJBReadWriteLock.incReadLockCount | private void incReadLockCount() {
Integer current = readLockCount.get();
int next;
if (current == null)
next = 1;
else
next = current.intValue() + 1;
readLockCount.set(new Integer(next));
} | java | private void incReadLockCount() {
Integer current = readLockCount.get();
int next;
if (current == null)
next = 1;
else
next = current.intValue() + 1;
readLockCount.set(new Integer(next));
} | [
"private",
"void",
"incReadLockCount",
"(",
")",
"{",
"Integer",
"current",
"=",
"readLockCount",
".",
"get",
"(",
")",
";",
"int",
"next",
";",
"if",
"(",
"current",
"==",
"null",
")",
"next",
"=",
"1",
";",
"else",
"next",
"=",
"current",
".",
"int... | Increments the read lock count held by the thread | [
"Increments",
"the",
"read",
"lock",
"count",
"held",
"by",
"the",
"thread"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/component/singleton/EJBReadWriteLock.java#L253-L261 | test | Increment the number of read locks. | Of course, here is the Java code you requested:
```java
private void incReadLockCount() {
Integer current = readLockCount.get();
int next;
if (current == null)
next = 1;
else
next = current.intValue() + 1;
readLockCount.set(new Integer(next));
}
```
... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm/AsmUtil.java | AsmUtil.intValue | public static void intValue(final MethodVisitor mv) {
mv.visitTypeInsn(CHECKCAST, SIGNATURE_JAVA_LANG_INTEGER);
mv.visitMethodInsn(INVOKEVIRTUAL, SIGNATURE_JAVA_LANG_INTEGER, "intValue", "()I", false);
} | java | public static void intValue(final MethodVisitor mv) {
mv.visitTypeInsn(CHECKCAST, SIGNATURE_JAVA_LANG_INTEGER);
mv.visitMethodInsn(INVOKEVIRTUAL, SIGNATURE_JAVA_LANG_INTEGER, "intValue", "()I", false);
} | [
"public",
"static",
"void",
"intValue",
"(",
"final",
"MethodVisitor",
"mv",
")",
"{",
"mv",
".",
"visitTypeInsn",
"(",
"CHECKCAST",
",",
"SIGNATURE_JAVA_LANG_INTEGER",
")",
";",
"mv",
".",
"visitMethodInsn",
"(",
"INVOKEVIRTUAL",
",",
"SIGNATURE_JAVA_LANG_INTEGER",... | Converts <code>Integer</code> object to an <code>int</code>. | [
"Converts",
"<code",
">",
"Integer<",
"/",
"code",
">",
"object",
"to",
"an",
"<code",
">",
"int<",
"/",
"code",
">",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm/AsmUtil.java#L318-L321 | test | Generates the instruction to convert an int to an int. | Of course, here is the Java code you requested:
```java
public static void intValue(final MethodVisitor mv) {
mv.visitTypeInsn(CHECKCAST, SIGNATURE_JAVA_LANG_INTEGER);
mv.visitMethodInsn(INVOKEVIRTUAL, SIGNATURE_JAVA_LANG_INTEGER, "intValue", "()I", false);
}
```
Hope this helps! |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java | OptimizeInstructions.apply | public void apply(WAMInstruction next)
{
shift(next);
// Anonymous or singleton variable optimizations.
if ((UnifyVar == next.getMnemonic()) && isVoidVariable(next))
{
if (state != State.UVE)
{
voidCount = 0;
}
discard... | java | public void apply(WAMInstruction next)
{
shift(next);
// Anonymous or singleton variable optimizations.
if ((UnifyVar == next.getMnemonic()) && isVoidVariable(next))
{
if (state != State.UVE)
{
voidCount = 0;
}
discard... | [
"public",
"void",
"apply",
"(",
"WAMInstruction",
"next",
")",
"{",
"shift",
"(",
"next",
")",
";",
"// Anonymous or singleton variable optimizations.",
"if",
"(",
"(",
"UnifyVar",
"==",
"next",
".",
"getMnemonic",
"(",
")",
")",
"&&",
"isVoidVariable",
"(",
"... | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java#L103-L239 | test | Apply the CRS to a CRS image. | Of course, here is the Java code you requested:
```java
public void apply(WAMInstruction next)
{
shift(next);
// Anonymous or singleton variable optimizations.
if ((UnifyVar == next.getMnemonic()) && isVoidVariable(next))
{
if (state != State.UVE)
{
... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/sqlutil/sqlnative/SQLColumn.java | SQLColumn.toJsonObject | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Name...
if(this.getColumnName() != null)
{
returnVal.put(JSONMapping.COLUMN_NAME,
this.getColumnName());
}
//Ind... | java | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Name...
if(this.getColumnName() != null)
{
returnVal.put(JSONMapping.COLUMN_NAME,
this.getColumnName());
}
//Ind... | [
"@",
"Override",
"public",
"JSONObject",
"toJsonObject",
"(",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"returnVal",
"=",
"super",
".",
"toJsonObject",
"(",
")",
";",
"//Name...",
"if",
"(",
"this",
".",
"getColumnName",
"(",
")",
"!=",
"null",
")",... | Conversion to {@code JSONObject} from Java Object.
@return {@code JSONObject} representation of {@code UserQuery}
@throws JSONException If there is a problem with the JSON Body.
@see ABaseFluidJSONObject#toJsonObject() | [
"Conversion",
"to",
"{",
"@code",
"JSONObject",
"}",
"from",
"Java",
"Object",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/sqlutil/sqlnative/SQLColumn.java#L137-L171 | test | Returns the JSONObject representation of the object. | Of course, here is the Java code you requested:
```java
@Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Name...
if(this.getColumnName() != null)
{
returnVal.put(JSONMapping.COLUMN_NAME,
... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/role/RoleToFormFieldToFormDefinition.java | RoleToFormFieldToFormDefinition.toJsonObject | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Can Create...
if(this.isCanCreateAndModify() != null)
{
returnVal.put(JSONMapping.CAN_CREATE_AND_MODIFY,
this.isCanCreateAndModify().bool... | java | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Can Create...
if(this.isCanCreateAndModify() != null)
{
returnVal.put(JSONMapping.CAN_CREATE_AND_MODIFY,
this.isCanCreateAndModify().bool... | [
"@",
"Override",
"public",
"JSONObject",
"toJsonObject",
"(",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"returnVal",
"=",
"super",
".",
"toJsonObject",
"(",
")",
";",
"//Can Create...",
"if",
"(",
"this",
".",
"isCanCreateAndModify",
"(",
")",
"!=",
"... | Conversion to {@code JSONObject} from Java Object.
@return {@code JSONObject} representation of {@code RoleToFormFieldToFormDefinition}
@throws JSONException If there is a problem with the JSON Body.
@see ABaseFluidJSONObject#toJsonObject() | [
"Conversion",
"to",
"{",
"@code",
"JSONObject",
"}",
"from",
"Java",
"Object",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/role/RoleToFormFieldToFormDefinition.java#L192-L219 | test | Override toJsonObject to return a JSONObject with the details of the Crazilian application. | Of course, here is the Java code you requested:
```java
@Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Can Create...
if(this.isCanCreateAndModify() != null)
{
returnVal.put(JSONMapping.CAN_CREATE_AND_MOD... |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/config/XmlConfig.java | XmlConfig.features | public XmlConfig features(Map<String, Boolean> features) {
return new XmlConfig(features, declaredNamespaces, properties, validating, namespaceAware, allowDocTypeDeclaration, true);
} | java | public XmlConfig features(Map<String, Boolean> features) {
return new XmlConfig(features, declaredNamespaces, properties, validating, namespaceAware, allowDocTypeDeclaration, true);
} | [
"public",
"XmlConfig",
"features",
"(",
"Map",
"<",
"String",
",",
"Boolean",
">",
"features",
")",
"{",
"return",
"new",
"XmlConfig",
"(",
"features",
",",
"declaredNamespaces",
",",
"properties",
",",
"validating",
",",
"namespaceAware",
",",
"allowDocTypeDecl... | Specify features that will be used when parsing XML.
@param features A map containing features that will be used by the underlying {@link groovy.util.XmlSlurper}.
@return
@see org.xml.sax.XMLReader#setFeature(java.lang.String, boolean) | [
"Specify",
"features",
"that",
"will",
"be",
"used",
"when",
"parsing",
"XML",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/config/XmlConfig.java#L86-L88 | test | Sets features for this configuration. | Of course, here is the Java code you requested:
```java
public XmlConfig features(Map<String, Boolean> features) {
return new XmlConfig(features, declaredNamespaces, properties, validating, namespaceAware, allowDocTypeDeclaration, true);
}
```
Hope this helps! |
subchen/jetbrick-all-1x | jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java | StringUtils.defaultIfNull | public static String defaultIfNull(final String s, final String defaultStr) {
return s == null ? defaultStr : s;
} | java | public static String defaultIfNull(final String s, final String defaultStr) {
return s == null ? defaultStr : s;
} | [
"public",
"static",
"String",
"defaultIfNull",
"(",
"final",
"String",
"s",
",",
"final",
"String",
"defaultStr",
")",
"{",
"return",
"s",
"==",
"null",
"?",
"defaultStr",
":",
"s",
";",
"}"
] | <p>
Returns either the passed in String, or if the String is {@code null},
the value of {@code defaultStr}.
</p>
<pre>
StringUtils.defaultIfNull(null, "NULL") = "NULL"
StringUtils.defaultIfNull("", "NULL") = ""
StringUtils.defaultIfNull("bat", "NULL") = "bat"
</pre> | [
"<p",
">",
"Returns",
"either",
"the",
"passed",
"in",
"String",
"or",
"if",
"the",
"String",
"is",
"{",
"@code",
"null",
"}",
"the",
"value",
"of",
"{",
"@code",
"defaultStr",
"}",
".",
"<",
"/",
"p",
">"
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java#L215-L217 | test | Default if null. | Of course, here is the Java code you requested:
```java
public static String defaultIfNull(final String s, final String defaultStr) {
return s == null ? defaultStr : s;
}
```
Hope this helps! |
GlenKPeterson/Paguro | src/main/java/org/organicdesign/fp/collections/Cowry.java | Cowry.insertIntoArrayAt | public static <T> T[] insertIntoArrayAt(T item, T[] items, int idx, Class<T> tClass) {
// Make an array that's one bigger. It's too bad that the JVM bothers to
// initialize this with nulls.
@SuppressWarnings("unchecked")
T[] newItems = (T[]) ((tClass == null) ? new Object[items.length ... | java | public static <T> T[] insertIntoArrayAt(T item, T[] items, int idx, Class<T> tClass) {
// Make an array that's one bigger. It's too bad that the JVM bothers to
// initialize this with nulls.
@SuppressWarnings("unchecked")
T[] newItems = (T[]) ((tClass == null) ? new Object[items.length ... | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"insertIntoArrayAt",
"(",
"T",
"item",
",",
"T",
"[",
"]",
"items",
",",
"int",
"idx",
",",
"Class",
"<",
"T",
">",
"tClass",
")",
"{",
"// Make an array that's one bigger. It's too bad that the JVM bothers to... | Returns a new array one longer than the given one, with the specified item inserted at the specified index.
@param item The item to insert
@param items The original array (will not be modified)
@param idx the index to insert the item at.
@param tClass The runtime class to store in the new array (or null for an Object a... | [
"Returns",
"a",
"new",
"array",
"one",
"longer",
"than",
"the",
"given",
"one",
"with",
"the",
"specified",
"item",
"inserted",
"at",
"the",
"specified",
"index",
"."
] | eac0d64b2eb9496967334f635cdb270cffb2197b | https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/Cowry.java#L91-L114 | test | Inserts the item into the array at the given index. | Of course, here is the Java code you requested:
```java
public static <T> T[] insertIntoArrayAt(T item, T[] items, int idx, Class<T> tClass) {
// Make an array that's one bigger. It's too bad that the JVM bothers to
// initialize this with nulls.
@SuppressWarnings("unchecked")
T[] newI... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/vertical/VerticalTransformSubset.java | VerticalTransformSubset.getCoordinateArray1D | public D1 getCoordinateArray1D(int timeIndex, int xIndex, int yIndex)
throws IOException, InvalidRangeException {
ArrayDouble.D3 data = original.getCoordinateArray(timeIndex);
int[] origin = new int[3];
int[] shape = new int[3];
shape[0] = subsetList.get(0).length();... | java | public D1 getCoordinateArray1D(int timeIndex, int xIndex, int yIndex)
throws IOException, InvalidRangeException {
ArrayDouble.D3 data = original.getCoordinateArray(timeIndex);
int[] origin = new int[3];
int[] shape = new int[3];
shape[0] = subsetList.get(0).length();... | [
"public",
"D1",
"getCoordinateArray1D",
"(",
"int",
"timeIndex",
",",
"int",
"xIndex",
",",
"int",
"yIndex",
")",
"throws",
"IOException",
",",
"InvalidRangeException",
"{",
"ArrayDouble",
".",
"D3",
"data",
"=",
"original",
".",
"getCoordinateArray",
"(",
"time... | Get the 1D vertical coordinate array for this time step and point
@param timeIndex the time index. Ignored if !isTimeDependent().
@param xIndex the x index
@param yIndex the y index
@return vertical coordinate array
@throws java.io.IOException problem reading data
@throws ucar.ma2.InvalidRangeException _more_ | [
"Get",
"the",
"1D",
"vertical",
"coordinate",
"array",
"for",
"this",
"time",
"step",
"and",
"point"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/vertical/VerticalTransformSubset.java#L72-L98 | test | Gets the coordinate array from the original file. | Of course, here is the Java code you requested:
```java
public D1 getCoordinateArray1D(int timeIndex, int xIndex, int yIndex)
throws IOException, InvalidRangeException {
ArrayDouble.D3 data = original.getCoordinateArray(timeIndex);
int[] origin = new int[3];
int[] shape = new in... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/LazyPagingList.java | LazyPagingList.cacheBlock | public List<T> cacheBlock(int block)
{
/*log.fine("public List<T> cacheBlock(int block): called");*/
// Get the new block.
List<T> blockList = getBlock(block * blockSize, blockSize);
// Cache it.
blockMap.put(block, blockList);
/*log.fine("Cached block " + block + "... | java | public List<T> cacheBlock(int block)
{
/*log.fine("public List<T> cacheBlock(int block): called");*/
// Get the new block.
List<T> blockList = getBlock(block * blockSize, blockSize);
// Cache it.
blockMap.put(block, blockList);
/*log.fine("Cached block " + block + "... | [
"public",
"List",
"<",
"T",
">",
"cacheBlock",
"(",
"int",
"block",
")",
"{",
"/*log.fine(\"public List<T> cacheBlock(int block): called\");*/",
"// Get the new block.",
"List",
"<",
"T",
">",
"blockList",
"=",
"getBlock",
"(",
"block",
"*",
"blockSize",
",",
"block... | Fetches and caches the specified block.
@param block The block to cache.
@return The contents of the cached block. | [
"Fetches",
"and",
"caches",
"the",
"specified",
"block",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/LazyPagingList.java#L147-L159 | test | Cache a block of type T. | Of course, here is the Java code you requested:
```java
public List<T> cacheBlock(int block)
{
/*log.fine("public List<T> cacheBlock(int block): called");*/
// Get the new block.
List<T> blockList = getBlock(block * blockSize, blockSize);
// Cache it.
blockMap.put(block, b... |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/rpc/RpcServer.java | RpcServer.invokeWithFuture | public RpcResponseFuture invokeWithFuture(final String addr, final Object request,
final int timeoutMillis) throws RemotingException,
InterruptedException {
check();
return this.rpcRemotin... | java | public RpcResponseFuture invokeWithFuture(final String addr, final Object request,
final int timeoutMillis) throws RemotingException,
InterruptedException {
check();
return this.rpcRemotin... | [
"public",
"RpcResponseFuture",
"invokeWithFuture",
"(",
"final",
"String",
"addr",
",",
"final",
"Object",
"request",
",",
"final",
"int",
"timeoutMillis",
")",
"throws",
"RemotingException",
",",
"InterruptedException",
"{",
"check",
"(",
")",
";",
"return",
"thi... | Future invocation using a string address, address format example - 127.0.0.1:12200?key1=value1&key2=value2 <br>
You can get result use the returned {@link RpcResponseFuture}.
<p>
Notice:<br>
<ol>
<li><b>DO NOT modify the request object concurrently when this method is called.</b></li>
<li>When do invocation, use the st... | [
"Future",
"invocation",
"using",
"a",
"string",
"address",
"address",
"format",
"example",
"-",
"127",
".",
"0",
".",
"0",
".",
"1",
":",
"12200?key1",
"=",
"value1&key2",
"=",
"value2",
"<br",
">",
"You",
"can",
"get",
"result",
"use",
"the",
"returned"... | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcServer.java#L618-L623 | test | Invoke a request on a remote node. | Of course, here is the Java code you requested:
```java
public RpcResponseFuture invokeWithFuture(final String addr, final Object request,
final int timeoutMillis) throws RemotingException,
InterruptedEx... |
workplacesystems/utilsj | src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java | TransactionalBidiTreeMap.isLeftChild | private static <K,V> boolean isLeftChild(final Node<K,V> node, final int index) {
return (node == null)
? true
: ((node.getParent(index) == null)
? false
: (node == node.getParent(index).getLeft(index)));
} | java | private static <K,V> boolean isLeftChild(final Node<K,V> node, final int index) {
return (node == null)
? true
: ((node.getParent(index) == null)
? false
: (node == node.getParent(index).getLeft(index)));
} | [
"private",
"static",
"<",
"K",
",",
"V",
">",
"boolean",
"isLeftChild",
"(",
"final",
"Node",
"<",
"K",
",",
"V",
">",
"node",
",",
"final",
"int",
"index",
")",
"{",
"return",
"(",
"node",
"==",
"null",
")",
"?",
"true",
":",
"(",
"(",
"node",
... | is this node its parent's left child? mind you, the node, or
its parent, may not exist. no problem. if the node doesn't
exist ... it's its non-existent parent's left child. If the
node does exist but has no parent ... no, we're not the
non-existent parent's left child. Otherwise (both the specified
node AND its parent ... | [
"is",
"this",
"node",
"its",
"parent",
"s",
"left",
"child?",
"mind",
"you",
"the",
"node",
"or",
"its",
"parent",
"may",
"not",
"exist",
".",
"no",
"problem",
".",
"if",
"the",
"node",
"doesn",
"t",
"exist",
"...",
"it",
"s",
"its",
"non",
"-",
"e... | 1b638be51997eafac4d368c14f62a16624a08d3e | https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1335-L1342 | test | Checks if the node is the left child of the given index. | Of course, here is the Java code you requested:
```java
private static <K,V> boolean isLeftChild(final Node<K,V> node, final int index) {
return (node == null)
? true
: ((node.getParent(index) == null)
? false
: (node == node.getParent(in... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/access/DefaultWebInvocationPrivilegeEvaluator.java | DefaultWebInvocationPrivilegeEvaluator.isAllowed | public boolean isAllowed(String contextPath, String uri, String method,
Authentication authentication) {
Assert.notNull(uri, "uri parameter is required");
FilterInvocation fi = new FilterInvocation(contextPath, uri, method);
Collection<ConfigAttribute> attrs = securityInterceptor
.obtainSecurityMetadataSo... | java | public boolean isAllowed(String contextPath, String uri, String method,
Authentication authentication) {
Assert.notNull(uri, "uri parameter is required");
FilterInvocation fi = new FilterInvocation(contextPath, uri, method);
Collection<ConfigAttribute> attrs = securityInterceptor
.obtainSecurityMetadataSo... | [
"public",
"boolean",
"isAllowed",
"(",
"String",
"contextPath",
",",
"String",
"uri",
",",
"String",
"method",
",",
"Authentication",
"authentication",
")",
"{",
"Assert",
".",
"notNull",
"(",
"uri",
",",
"\"uri parameter is required\"",
")",
";",
"FilterInvocatio... | Determines whether the user represented by the supplied <tt>Authentication</tt>
object is allowed to invoke the supplied URI, with the given .
<p>
Note the default implementation of <tt>FilterInvocationSecurityMetadataSource</tt>
disregards the <code>contextPath</code> when evaluating which secure object
metadata appli... | [
"Determines",
"whether",
"the",
"user",
"represented",
"by",
"the",
"supplied",
"<tt",
">",
"Authentication<",
"/",
"tt",
">",
"object",
"is",
"allowed",
"to",
"invoke",
"the",
"supplied",
"URI",
"with",
"the",
"given",
".",
"<p",
">",
"Note",
"the",
"defa... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/access/DefaultWebInvocationPrivilegeEvaluator.java#L97-L131 | test | Checks if the request is allowed for the given authentication. | Of course, here is the Java code you requested:
```java
public boolean isAllowed(String contextPath, String uri, String method,
Authentication authentication) {
Assert.notNull(uri, "uri parameter is required");
FilterInvocation fi = new FilterInvocation(contextPath, uri, method);
Collection<ConfigAttribute> ... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/ferry/JNILibraryLoader.java | JNILibraryLoader.getLibraryCandidates | List<String> getLibraryCandidates(String aLibraryName, Long aMajorVersion)
{
final List<String> retval = new LinkedList<String>();
// Note: when done each of these variables must be set to a non-null, non
// empty string array
final String[] prefixes;
final String[] suffixes;
final String[] pr... | java | List<String> getLibraryCandidates(String aLibraryName, Long aMajorVersion)
{
final List<String> retval = new LinkedList<String>();
// Note: when done each of these variables must be set to a non-null, non
// empty string array
final String[] prefixes;
final String[] suffixes;
final String[] pr... | [
"List",
"<",
"String",
">",
"getLibraryCandidates",
"(",
"String",
"aLibraryName",
",",
"Long",
"aMajorVersion",
")",
"{",
"final",
"List",
"<",
"String",
">",
"retval",
"=",
"new",
"LinkedList",
"<",
"String",
">",
"(",
")",
";",
"// Note: when done each of t... | For a given library, and the OS we're running on, this method generates a
list of potential absolute file paths that
{@link #loadCandidateLibrary(String, Long, String[])} should attempt (in
order) to load. This method will not check for existence and readability of
the file we're attempting to load.
@param aLibraryNam... | [
"For",
"a",
"given",
"library",
"and",
"the",
"OS",
"we",
"re",
"running",
"on",
"this",
"method",
"generates",
"a",
"list",
"of",
"potential",
"absolute",
"file",
"paths",
"that",
"{",
"@link",
"#loadCandidateLibrary",
"(",
"String",
"Long",
"String",
"[]",... | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/JNILibraryLoader.java#L405-L516 | test | Returns a list of candidate libraries for a given library name and major version. | Of course, here is the Java code you requested:
```java
List<String> getLibraryCandidates(String aLibraryName, Long aMajorVersion)
{
final List<String> retval = new LinkedList<String>();
// Note: when done each of these variables must be set to a non-null, non
// empty string array
final String[] pre... |
1337joe/cubesensors-for-java | src/main/java/com/w3asel/cubesensors/util/CubeSensorsUtils.java | CubeSensorsUtils.getAccessToken | public Token getAccessToken() {
Token accessToken = authPersistence.getToken();
if (isTokenValid(accessToken)) {
return accessToken;
}
// authorize
accessToken = authorize();
// save
authPersistence.saveToken(accessToken);
return accessToken;
} | java | public Token getAccessToken() {
Token accessToken = authPersistence.getToken();
if (isTokenValid(accessToken)) {
return accessToken;
}
// authorize
accessToken = authorize();
// save
authPersistence.saveToken(accessToken);
return accessToken;
} | [
"public",
"Token",
"getAccessToken",
"(",
")",
"{",
"Token",
"accessToken",
"=",
"authPersistence",
".",
"getToken",
"(",
")",
";",
"if",
"(",
"isTokenValid",
"(",
"accessToken",
")",
")",
"{",
"return",
"accessToken",
";",
"}",
"// authorize",
"accessToken",
... | Obtain an access token. If previously a token was created and persisted
will be returned after validation (a real call is made to validate).
<p>If no token previously persisted, the method will create a new token using
the authentication provider (AuthProvider)
@return the access token. | [
"Obtain",
"an",
"access",
"token",
".",
"If",
"previously",
"a",
"token",
"was",
"created",
"and",
"persisted",
"will",
"be",
"returned",
"after",
"validation",
"(",
"a",
"real",
"call",
"is",
"made",
"to",
"validate",
")",
".",
"<p",
">",
"If",
"no",
... | f3ba432d36b744e68b916682d7ef24afaff447f8 | https://github.com/1337joe/cubesensors-for-java/blob/f3ba432d36b744e68b916682d7ef24afaff447f8/src/main/java/com/w3asel/cubesensors/util/CubeSensorsUtils.java#L66-L81 | test | Get the token from the database. | Of course, here is the Java code you requested:
```java
public Token getAccessToken() {
Token accessToken = authPersistence.getToken();
if (isTokenValid(accessToken)) {
return accessToken;
}
// authorize
accessToken = authorize();
// save
authPersistence.saveToken(accessToken);
return accessT... |
haducloc/appslandia-common | src/main/java/com/appslandia/common/jdbc/ConnectionImpl.java | ConnectionImpl.close | @Override
public void close() throws java.sql.SQLException {
if (!this.conn.isClosed()) {
ConnectionImpl outer = this.outer;
this.conn.close();
this.outer = null;
CONNECTION_HOLDER.set(outer);
}
} | java | @Override
public void close() throws java.sql.SQLException {
if (!this.conn.isClosed()) {
ConnectionImpl outer = this.outer;
this.conn.close();
this.outer = null;
CONNECTION_HOLDER.set(outer);
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"java",
".",
"sql",
".",
"SQLException",
"{",
"if",
"(",
"!",
"this",
".",
"conn",
".",
"isClosed",
"(",
")",
")",
"{",
"ConnectionImpl",
"outer",
"=",
"this",
".",
"outer",
";",
"this",... | AutoCloseable | [
"AutoCloseable"
] | 41dc9b0e1dd4fa86a9ad03627f70cbee61e74061 | https://github.com/haducloc/appslandia-common/blob/41dc9b0e1dd4fa86a9ad03627f70cbee61e74061/src/main/java/com/appslandia/common/jdbc/ConnectionImpl.java#L320-L329 | test | Closes the connection. | Of course, here is the Java code you requested:
```java
@Override
public void close() throws java.sql.SQLException {
if (!this.conn.isClosed()) {
ConnectionImpl outer = this.outer;
this.conn.close();
this.outer = null;
CONNECTION_HOLDER.set(outer);
}
}
```
Hope this helps! |
google/guice | core/src/com/google/inject/internal/ConstructorBindingImpl.java | ConstructorBindingImpl.getMethodInterceptors | @Override
public Map<Method, List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors() {
checkState(factory.constructorInjector != null, "Binding is not ready");
return factory.constructorInjector.getConstructionProxy().getMethodInterceptors();
} | java | @Override
public Map<Method, List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors() {
checkState(factory.constructorInjector != null, "Binding is not ready");
return factory.constructorInjector.getConstructionProxy().getMethodInterceptors();
} | [
"@",
"Override",
"public",
"Map",
"<",
"Method",
",",
"List",
"<",
"org",
".",
"aopalliance",
".",
"intercept",
".",
"MethodInterceptor",
">",
">",
"getMethodInterceptors",
"(",
")",
"{",
"checkState",
"(",
"factory",
".",
"constructorInjector",
"!=",
"null",
... | /*if[AOP] | [
"/",
"*",
"if",
"[",
"AOP",
"]"
] | a0552a16d813ead98fe73737fb001db336650251 | https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/ConstructorBindingImpl.java#L212-L216 | test | Gets the method interceptors. | Of course, here is the Java code you requested:
```java
@Override
public Map<Method, List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors() {
checkState(factory.constructorInjector != null, "Binding is not ready");
return factory.constructorInjector.getConstructionProxy().getMethodInterce... |
RestComm/jain-slee | api/jar/src/main/java/javax/slee/management/Alarm.java | Alarm.compareTo | public int compareTo(Object obj) {
if (obj == this) return 0;
if (!(obj instanceof Alarm)) throw new ClassCastException("Not a javax.slee.management.Alarm: " + obj);
Alarm that = (Alarm)obj;
// compare alarm identifiers
return this.alarmID.compareTo(that.alarmID);
} | java | public int compareTo(Object obj) {
if (obj == this) return 0;
if (!(obj instanceof Alarm)) throw new ClassCastException("Not a javax.slee.management.Alarm: " + obj);
Alarm that = (Alarm)obj;
// compare alarm identifiers
return this.alarmID.compareTo(that.alarmID);
} | [
"public",
"int",
"compareTo",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"this",
")",
"return",
"0",
";",
"if",
"(",
"!",
"(",
"obj",
"instanceof",
"Alarm",
")",
")",
"throw",
"new",
"ClassCastException",
"(",
"\"Not a javax.slee.management.Al... | Compare this alarm with the specified object for order.
Returns a negative integer, zero, or a positive integer if this object
is less than, equal to, or greater than the specified object.
<p>
Alarm ordering is determined by comparing unique the alarm identifier.
@param obj the object to compare this with.
@return a ne... | [
"Compare",
"this",
"alarm",
"with",
"the",
"specified",
"object",
"for",
"order",
".",
"Returns",
"a",
"negative",
"integer",
"zero",
"or",
"a",
"positive",
"integer",
"if",
"this",
"object",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"t... | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/management/Alarm.java#L253-L260 | test | Compares two alarm objects. | Of course, here is the Java code you requested:
```java
public int compareTo(Object obj) {
if (obj == this) return 0;
if (!(obj instanceof Alarm)) throw new ClassCastException("Not a javax.slee.management.Alarm: " + obj);
Alarm that = (Alarm)obj;
// compare alarm identifiers
re... |
oblac/jodd | jodd-http/src/main/java/jodd/http/HttpRequest.java | HttpRequest.queryString | public HttpRequest queryString(final String queryString, final boolean decode) {
this.query = HttpUtil.parseQuery(queryString, decode);
return this;
} | java | public HttpRequest queryString(final String queryString, final boolean decode) {
this.query = HttpUtil.parseQuery(queryString, decode);
return this;
} | [
"public",
"HttpRequest",
"queryString",
"(",
"final",
"String",
"queryString",
",",
"final",
"boolean",
"decode",
")",
"{",
"this",
".",
"query",
"=",
"HttpUtil",
".",
"parseQuery",
"(",
"queryString",
",",
"decode",
")",
";",
"return",
"this",
";",
"}"
] | Sets query from provided query string. Previous query values
are discarded. | [
"Sets",
"query",
"from",
"provided",
"query",
"string",
".",
"Previous",
"query",
"values",
"are",
"discarded",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpRequest.java#L469-L472 | test | Sets the query string. | Of course, here is the Java code you requested:
```java
public HttpRequest queryString(final String queryString, final boolean decode) {
this.query = HttpUtil.parseQuery(queryString, decode);
return this;
}
```
Hope this helps! |
stanfy/enroscar | net/src/main/java/com/stanfy/enroscar/rest/request/net/BaseRequestDescriptionConverter.java | BaseRequestDescriptionConverter.buildUri | protected Uri.Builder buildUri() {
final Uri.Builder builder = Uri.parse(requestDescription.getUrl()).buildUpon();
for (final Parameter p : requestDescription.getSimpleParameters().getChildren()) {
if (p instanceof ParameterValue) {
builder.appendQueryParameter(p.getName(), ((ParameterValue) p).ge... | java | protected Uri.Builder buildUri() {
final Uri.Builder builder = Uri.parse(requestDescription.getUrl()).buildUpon();
for (final Parameter p : requestDescription.getSimpleParameters().getChildren()) {
if (p instanceof ParameterValue) {
builder.appendQueryParameter(p.getName(), ((ParameterValue) p).ge... | [
"protected",
"Uri",
".",
"Builder",
"buildUri",
"(",
")",
"{",
"final",
"Uri",
".",
"Builder",
"builder",
"=",
"Uri",
".",
"parse",
"(",
"requestDescription",
".",
"getUrl",
"(",
")",
")",
".",
"buildUpon",
"(",
")",
";",
"for",
"(",
"final",
"Paramete... | Composes URI builder using {@link RequestDescription#getUrl()} and {@link RequestDescription#getSimpleParameters()}.
@return request URI builder | [
"Composes",
"URI",
"builder",
"using",
"{"
] | 0e64f3c309d62e359b55ddcba10e3cc592f5e083 | https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/net/src/main/java/com/stanfy/enroscar/rest/request/net/BaseRequestDescriptionConverter.java#L88-L96 | test | Build URI. | Of course, here is the Java code you requested:
```java
protected Uri.Builder buildUri() {
final Uri.Builder builder = Uri.parse(requestDescription.getUrl()).buildUpon();
for (final Parameter p : requestDescription.getSimpleParameters().getChildren()) {
if (p instanceof ParameterValue) {
builder.... |
streamsets/datacollector | basic-lib/src/main/java/com/streamsets/pipeline/stage/processor/aggregation/aggregator/Aggregators.java | Aggregators.createGroupBy | @SuppressWarnings("unchecked")
public <A extends SimpleAggregator, N extends Number> GroupByAggregator<A, N> createGroupBy(
String name, Class<? extends Aggregator> aKlass
) {
Utils.checkState(!started, "Already started");
GroupByAggregator<A, N> aggregator = new GroupByAggregator(name, aKlass, this);... | java | @SuppressWarnings("unchecked")
public <A extends SimpleAggregator, N extends Number> GroupByAggregator<A, N> createGroupBy(
String name, Class<? extends Aggregator> aKlass
) {
Utils.checkState(!started, "Already started");
GroupByAggregator<A, N> aggregator = new GroupByAggregator(name, aKlass, this);... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
"extends",
"SimpleAggregator",
",",
"N",
"extends",
"Number",
">",
"GroupByAggregator",
"<",
"A",
",",
"N",
">",
"createGroupBy",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
"extends"... | Creates a group-by Agregator.
@param name name of the group-by Aggregator.
@param aKlass simple aggregator class backing each group-by element.
@return a group-by aggregator. | [
"Creates",
"a",
"group",
"-",
"by",
"Agregator",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/basic-lib/src/main/java/com/streamsets/pipeline/stage/processor/aggregation/aggregator/Aggregators.java#L148-L157 | test | Create a new GroupByAggregator. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <A extends SimpleAggregator, N extends Number> GroupByAggregator<A, N> createGroupBy(
String name, Class<? extends Aggregator> aKlass
) {
Utils.checkState(!started, "Already started");
GroupByAggregator<A, N... |
spring-projects/spring-security | core/src/main/java/org/springframework/security/access/expression/method/ExpressionBasedAnnotationAttributeFactory.java | ExpressionBasedAnnotationAttributeFactory.getParser | private ExpressionParser getParser() {
if (this.parser != null) {
return this.parser;
}
synchronized (parserLock) {
this.parser = handler.getExpressionParser();
this.handler = null;
}
return this.parser;
} | java | private ExpressionParser getParser() {
if (this.parser != null) {
return this.parser;
}
synchronized (parserLock) {
this.parser = handler.getExpressionParser();
this.handler = null;
}
return this.parser;
} | [
"private",
"ExpressionParser",
"getParser",
"(",
")",
"{",
"if",
"(",
"this",
".",
"parser",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"parser",
";",
"}",
"synchronized",
"(",
"parserLock",
")",
"{",
"this",
".",
"parser",
"=",
"handler",
".",
"ge... | Delay the lookup of the {@link ExpressionParser} to prevent SEC-2136
@return | [
"Delay",
"the",
"lookup",
"of",
"the",
"{",
"@link",
"ExpressionParser",
"}",
"to",
"prevent",
"SEC",
"-",
"2136"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/access/expression/method/ExpressionBasedAnnotationAttributeFactory.java#L90-L99 | test | Gets the parser. | Of course, here is the Java code you requested:
```java
private ExpressionParser getParser() {
if (this.parser != null) {
return this.parser;
}
synchronized (parserLock) {
this.parser = handler.getExpressionParser();
this.handler = null;
}
return this.parser;
}
```
Hope this helps! |
wildfly/wildfly | weld/subsystem/src/main/java/org/jboss/as/weld/services/bootstrap/ProxyServicesImpl.java | ProxyServicesImpl.getModule | private Module getModule(Class<?> originalClass) {
if (originalClass.getName().startsWith("java")) {
return module;
} else {
Module definingModule = Module.forClass(originalClass);
Boolean hasWeldDependencies = processedStaticModules.get(definingModule.getIdentifier()... | java | private Module getModule(Class<?> originalClass) {
if (originalClass.getName().startsWith("java")) {
return module;
} else {
Module definingModule = Module.forClass(originalClass);
Boolean hasWeldDependencies = processedStaticModules.get(definingModule.getIdentifier()... | [
"private",
"Module",
"getModule",
"(",
"Class",
"<",
"?",
">",
"originalClass",
")",
"{",
"if",
"(",
"originalClass",
".",
"getName",
"(",
")",
".",
"startsWith",
"(",
"\"java\"",
")",
")",
"{",
"return",
"module",
";",
"}",
"else",
"{",
"Module",
"def... | This method corresponds to the original {@code _getClassLoader()} method and returns
{@link Module} based on original class. This module is then used when defining proxy classes.
Most likely we want to return a {@link Module} into which the originalClass belongs but in case such a module
doesn't know Weld dependencies... | [
"This",
"method",
"corresponds",
"to",
"the",
"original",
"{",
"@code",
"_getClassLoader",
"()",
"}",
"method",
"and",
"returns",
"{",
"@link",
"Module",
"}",
"based",
"on",
"original",
"class",
".",
"This",
"module",
"is",
"then",
"used",
"when",
"defining"... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/weld/subsystem/src/main/java/org/jboss/as/weld/services/bootstrap/ProxyServicesImpl.java#L144-L170 | test | Get the module for the given class. | Of course, here is the Java code you requested:
```java
private Module getModule(Class<?> originalClass) {
if (originalClass.getName().startsWith("java")) {
return module;
} else {
Module definingModule = Module.forClass(originalClass);
Boolean hasWeldDependencies = ... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/conv/AWIPSsatConvention.java | AWIPSsatConvention.getAxisType | protected AxisType getAxisType( NetcdfDataset ds, VariableEnhanced ve) {
Variable v = (Variable) ve;
String vname = v.getShortName();
String units = v.getUnitsString();
if (units.equalsIgnoreCase(CDM.LON_UNITS))
return AxisType.Lon;
if (units.equalsIgnoreCase(CDM.LAT_UNITS))
... | java | protected AxisType getAxisType( NetcdfDataset ds, VariableEnhanced ve) {
Variable v = (Variable) ve;
String vname = v.getShortName();
String units = v.getUnitsString();
if (units.equalsIgnoreCase(CDM.LON_UNITS))
return AxisType.Lon;
if (units.equalsIgnoreCase(CDM.LAT_UNITS))
... | [
"protected",
"AxisType",
"getAxisType",
"(",
"NetcdfDataset",
"ds",
",",
"VariableEnhanced",
"ve",
")",
"{",
"Variable",
"v",
"=",
"(",
"Variable",
")",
"ve",
";",
"String",
"vname",
"=",
"v",
".",
"getShortName",
"(",
")",
";",
"String",
"units",
"=",
"... | /////////////////////////////////////////////////////////////////////// | [
"///////////////////////////////////////////////////////////////////////"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/conv/AWIPSsatConvention.java#L115-L155 | test | Get the axis type from the VariableEnhanced object | Of course, here is the Java code you requested:
```java
protected AxisType getAxisType( NetcdfDataset ds, VariableEnhanced ve) {
Variable v = (Variable) ve;
String vname = v.getShortName();
String units = v.getUnitsString();
if (units.equalsIgnoreCase(CDM.LON_UNITS))
return AxisType.Lon;
... |
oblac/jodd | jodd-props/src/main/java/jodd/props/Props.java | Props.load | @SuppressWarnings("unchecked")
public Props load(final Map<?, ?> map, final String prefix) {
String realPrefix = prefix;
realPrefix += '.';
for (final Map.Entry entry : map.entrySet()) {
final String name = entry.getKey().toString();
final Object value = entry.getValue();
if (value == null) {
contin... | java | @SuppressWarnings("unchecked")
public Props load(final Map<?, ?> map, final String prefix) {
String realPrefix = prefix;
realPrefix += '.';
for (final Map.Entry entry : map.entrySet()) {
final String name = entry.getKey().toString();
final Object value = entry.getValue();
if (value == null) {
contin... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Props",
"load",
"(",
"final",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"final",
"String",
"prefix",
")",
"{",
"String",
"realPrefix",
"=",
"prefix",
";",
"realPrefix",
"+=",
"'",
"'",
";... | Loads base properties from java Map using provided prefix.
Null values are ignored. | [
"Loads",
"base",
"properties",
"from",
"java",
"Map",
"using",
"provided",
"prefix",
".",
"Null",
"values",
"are",
"ignored",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-props/src/main/java/jodd/props/Props.java#L306-L319 | test | Load properties from a map. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public Props load(final Map<?, ?> map, final String prefix) {
String realPrefix = prefix;
realPrefix += '.';
for (final Map.Entry entry : map.entrySet()) {
final String name = entry.getKey().toString();
final Object val... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flowitem/FlowItemClient.java | FlowItemClient.sendFlowItemOn | public FluidItem sendFlowItemOn(
FluidItem flowJobItemParam,
boolean allowCollaboratorToSendOnParam
) {
if (flowJobItemParam != null && this.serviceTicket != null) {
flowJobItemParam.setServiceTicket(this.serviceTicket);
}
try {
return new Fl... | java | public FluidItem sendFlowItemOn(
FluidItem flowJobItemParam,
boolean allowCollaboratorToSendOnParam
) {
if (flowJobItemParam != null && this.serviceTicket != null) {
flowJobItemParam.setServiceTicket(this.serviceTicket);
}
try {
return new Fl... | [
"public",
"FluidItem",
"sendFlowItemOn",
"(",
"FluidItem",
"flowJobItemParam",
",",
"boolean",
"allowCollaboratorToSendOnParam",
")",
"{",
"if",
"(",
"flowJobItemParam",
"!=",
"null",
"&&",
"this",
".",
"serviceTicket",
"!=",
"null",
")",
"{",
"flowJobItemParam",
".... | Send a workflow item currently in an {@code Assignment} step to
@param flowJobItemParam The Fluid Item to {@code "Send On"} in the workflow process.
@param allowCollaboratorToSendOnParam All a collaborator user to also send on.
@return The Fluid item that was sent on. | [
"Send",
"a",
"workflow",
"item",
"currently",
"in",
"an",
"{",
"@code",
"Assignment",
"}",
"step",
"to"
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flowitem/FlowItemClient.java#L165-L182 | test | Send a FluidItem on a FluidItem. | Of course, here is the Java code you requested:
```java
public FluidItem sendFlowItemOn(
FluidItem flowJobItemParam,
boolean allowCollaboratorToSendOnParam
) {
if (flowJobItemParam != null && this.serviceTicket != null) {
flowJobItemParam.setServiceTicket(this.serviceTi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.