id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
60,300 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java | TypeInfoCache.convertArrayToBaseOid | protected synchronized int convertArrayToBaseOid(int oid) {
Integer i = pgArrayToPgType.get(oid);
if (i == null) {
return oid;
}
return i;
} | java | protected synchronized int convertArrayToBaseOid(int oid) {
Integer i = pgArrayToPgType.get(oid);
if (i == null) {
return oid;
}
return i;
} | [
"protected",
"synchronized",
"int",
"convertArrayToBaseOid",
"(",
"int",
"oid",
")",
"{",
"Integer",
"i",
"=",
"pgArrayToPgType",
".",
"get",
"(",
"oid",
")",
";",
"if",
"(",
"i",
"==",
"null",
")",
"{",
"return",
"oid",
";",
"}",
"return",
"i",
";",
... | Return the oid of the array's base element if it's an array, if not return the provided oid.
This doesn't do any database lookups, so it's only useful for the originally provided type
mappings. This is fine for it's intended uses where we only have intimate knowledge of types
that are already known to the driver.
@par... | [
"Return",
"the",
"oid",
"of",
"the",
"array",
"s",
"base",
"element",
"if",
"it",
"s",
"an",
"array",
"if",
"not",
"return",
"the",
"provided",
"oid",
".",
"This",
"doesn",
"t",
"do",
"any",
"database",
"lookups",
"so",
"it",
"s",
"only",
"useful",
"... | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java#L454-L460 |
60,301 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java | TypeInfoCache.requiresQuotingSqlType | public boolean requiresQuotingSqlType(int sqlType) throws SQLException {
switch (sqlType) {
case Types.BIGINT:
case Types.DOUBLE:
case Types.FLOAT:
case Types.INTEGER:
case Types.REAL:
case Types.SMALLINT:
case Types.TINYINT:
case Types.NUMERIC:
case Types.DECIM... | java | public boolean requiresQuotingSqlType(int sqlType) throws SQLException {
switch (sqlType) {
case Types.BIGINT:
case Types.DOUBLE:
case Types.FLOAT:
case Types.INTEGER:
case Types.REAL:
case Types.SMALLINT:
case Types.TINYINT:
case Types.NUMERIC:
case Types.DECIM... | [
"public",
"boolean",
"requiresQuotingSqlType",
"(",
"int",
"sqlType",
")",
"throws",
"SQLException",
"{",
"switch",
"(",
"sqlType",
")",
"{",
"case",
"Types",
".",
"BIGINT",
":",
"case",
"Types",
".",
"DOUBLE",
":",
"case",
"Types",
".",
"FLOAT",
":",
"cas... | Returns true if particular sqlType requires quoting.
This method is used internally by the driver, so it might disappear without notice.
@param sqlType sql type as in java.sql.Types
@return true if the type requires quoting
@throws SQLException if something goes wrong | [
"Returns",
"true",
"if",
"particular",
"sqlType",
"requires",
"quoting",
".",
"This",
"method",
"is",
"used",
"internally",
"by",
"the",
"driver",
"so",
"it",
"might",
"disappear",
"without",
"notice",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java#L854-L868 |
60,302 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.hasMessagePending | public boolean hasMessagePending() throws IOException {
if (pgInput.available() > 0) {
return true;
}
// In certain cases, available returns 0, yet there are bytes
long now = System.currentTimeMillis();
if (now < nextStreamAvailableCheckTime && minStreamAvailableCheckDelay != 0) {
// Do ... | java | public boolean hasMessagePending() throws IOException {
if (pgInput.available() > 0) {
return true;
}
// In certain cases, available returns 0, yet there are bytes
long now = System.currentTimeMillis();
if (now < nextStreamAvailableCheckTime && minStreamAvailableCheckDelay != 0) {
// Do ... | [
"public",
"boolean",
"hasMessagePending",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pgInput",
".",
"available",
"(",
")",
">",
"0",
")",
"{",
"return",
"true",
";",
"}",
"// In certain cases, available returns 0, yet there are bytes",
"long",
"now",
"=",... | Check for pending backend messages without blocking. Might return false when there actually are
messages waiting, depending on the characteristics of the underlying socket. This is used to
detect asynchronous notifies from the backend, when available.
@return true if there is a pending backend message
@throws IOExcept... | [
"Check",
"for",
"pending",
"backend",
"messages",
"without",
"blocking",
".",
"Might",
"return",
"false",
"when",
"there",
"actually",
"are",
"messages",
"waiting",
"depending",
"on",
"the",
"characteristics",
"of",
"the",
"underlying",
"socket",
".",
"This",
"i... | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L117-L137 |
60,303 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.setEncoding | public void setEncoding(Encoding encoding) throws IOException {
if (this.encoding != null && this.encoding.name().equals(encoding.name())) {
return;
}
// Close down any old writer.
if (encodingWriter != null) {
encodingWriter.close();
}
this.encoding = encoding;
// Intercept fl... | java | public void setEncoding(Encoding encoding) throws IOException {
if (this.encoding != null && this.encoding.name().equals(encoding.name())) {
return;
}
// Close down any old writer.
if (encodingWriter != null) {
encodingWriter.close();
}
this.encoding = encoding;
// Intercept fl... | [
"public",
"void",
"setEncoding",
"(",
"Encoding",
"encoding",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"encoding",
"!=",
"null",
"&&",
"this",
".",
"encoding",
".",
"name",
"(",
")",
".",
"equals",
"(",
"encoding",
".",
"name",
"(",
"... | Change the encoding used by this connection.
@param encoding the new encoding to use
@throws IOException if something goes wrong | [
"Change",
"the",
"encoding",
"used",
"by",
"this",
"connection",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L177-L200 |
60,304 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.sendInteger4 | public void sendInteger4(int val) throws IOException {
int4Buf[0] = (byte) (val >>> 24);
int4Buf[1] = (byte) (val >>> 16);
int4Buf[2] = (byte) (val >>> 8);
int4Buf[3] = (byte) (val);
pgOutput.write(int4Buf);
} | java | public void sendInteger4(int val) throws IOException {
int4Buf[0] = (byte) (val >>> 24);
int4Buf[1] = (byte) (val >>> 16);
int4Buf[2] = (byte) (val >>> 8);
int4Buf[3] = (byte) (val);
pgOutput.write(int4Buf);
} | [
"public",
"void",
"sendInteger4",
"(",
"int",
"val",
")",
"throws",
"IOException",
"{",
"int4Buf",
"[",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"val",
">>>",
"24",
")",
";",
"int4Buf",
"[",
"1",
"]",
"=",
"(",
"byte",
")",
"(",
"val",
">>>",
"16",
... | Sends a 4-byte integer to the back end.
@param val the integer to be sent
@throws IOException if an I/O error occurs | [
"Sends",
"a",
"4",
"-",
"byte",
"integer",
"to",
"the",
"back",
"end",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L236-L242 |
60,305 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.receiveInteger4 | public int receiveInteger4() throws IOException {
if (pgInput.read(int4Buf) != 4) {
throw new EOFException();
}
return (int4Buf[0] & 0xFF) << 24 | (int4Buf[1] & 0xFF) << 16 | (int4Buf[2] & 0xFF) << 8
| int4Buf[3] & 0xFF;
} | java | public int receiveInteger4() throws IOException {
if (pgInput.read(int4Buf) != 4) {
throw new EOFException();
}
return (int4Buf[0] & 0xFF) << 24 | (int4Buf[1] & 0xFF) << 16 | (int4Buf[2] & 0xFF) << 8
| int4Buf[3] & 0xFF;
} | [
"public",
"int",
"receiveInteger4",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pgInput",
".",
"read",
"(",
"int4Buf",
")",
"!=",
"4",
")",
"{",
"throw",
"new",
"EOFException",
"(",
")",
";",
"}",
"return",
"(",
"int4Buf",
"[",
"0",
"]",
"&",... | Receives a four byte integer from the backend.
@return the integer received from the backend
@throws IOException if an I/O error occurs | [
"Receives",
"a",
"four",
"byte",
"integer",
"from",
"the",
"backend",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L334-L341 |
60,306 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.receiveString | public String receiveString(int len) throws IOException {
if (!pgInput.ensureBytes(len)) {
throw new EOFException();
}
String res = encoding.decode(pgInput.getBuffer(), pgInput.getIndex(), len);
pgInput.skip(len);
return res;
} | java | public String receiveString(int len) throws IOException {
if (!pgInput.ensureBytes(len)) {
throw new EOFException();
}
String res = encoding.decode(pgInput.getBuffer(), pgInput.getIndex(), len);
pgInput.skip(len);
return res;
} | [
"public",
"String",
"receiveString",
"(",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"pgInput",
".",
"ensureBytes",
"(",
"len",
")",
")",
"{",
"throw",
"new",
"EOFException",
"(",
")",
";",
"}",
"String",
"res",
"=",
"encoding",
"... | Receives a fixed-size string from the backend.
@param len the length of the string to receive, in bytes.
@return the decoded string
@throws IOException if something wrong happens | [
"Receives",
"a",
"fixed",
"-",
"size",
"string",
"from",
"the",
"backend",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L364-L372 |
60,307 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.receiveErrorString | public EncodingPredictor.DecodeResult receiveErrorString(int len) throws IOException {
if (!pgInput.ensureBytes(len)) {
throw new EOFException();
}
EncodingPredictor.DecodeResult res;
try {
String value = encoding.decode(pgInput.getBuffer(), pgInput.getIndex(), len);
// no autodetect ... | java | public EncodingPredictor.DecodeResult receiveErrorString(int len) throws IOException {
if (!pgInput.ensureBytes(len)) {
throw new EOFException();
}
EncodingPredictor.DecodeResult res;
try {
String value = encoding.decode(pgInput.getBuffer(), pgInput.getIndex(), len);
// no autodetect ... | [
"public",
"EncodingPredictor",
".",
"DecodeResult",
"receiveErrorString",
"(",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"pgInput",
".",
"ensureBytes",
"(",
"len",
")",
")",
"{",
"throw",
"new",
"EOFException",
"(",
")",
";",
"}",
"E... | Receives a fixed-size string from the backend, and tries to avoid "UTF-8 decode failed"
errors.
@param len the length of the string to receive, in bytes.
@return the decoded string
@throws IOException if something wrong happens | [
"Receives",
"a",
"fixed",
"-",
"size",
"string",
"from",
"the",
"backend",
"and",
"tries",
"to",
"avoid",
"UTF",
"-",
"8",
"decode",
"failed",
"errors",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L382-L402 |
60,308 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.receiveString | public String receiveString() throws IOException {
int len = pgInput.scanCStringLength();
String res = encoding.decode(pgInput.getBuffer(), pgInput.getIndex(), len - 1);
pgInput.skip(len);
return res;
} | java | public String receiveString() throws IOException {
int len = pgInput.scanCStringLength();
String res = encoding.decode(pgInput.getBuffer(), pgInput.getIndex(), len - 1);
pgInput.skip(len);
return res;
} | [
"public",
"String",
"receiveString",
"(",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"pgInput",
".",
"scanCStringLength",
"(",
")",
";",
"String",
"res",
"=",
"encoding",
".",
"decode",
"(",
"pgInput",
".",
"getBuffer",
"(",
")",
",",
"pgInput",... | Receives a null-terminated string from the backend. If we don't see a null, then we assume
something has gone wrong.
@return string from back end
@throws IOException if an I/O error occurs, or end of file | [
"Receives",
"a",
"null",
"-",
"terminated",
"string",
"from",
"the",
"backend",
".",
"If",
"we",
"don",
"t",
"see",
"a",
"null",
"then",
"we",
"assume",
"something",
"has",
"gone",
"wrong",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L411-L416 |
60,309 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.receiveTupleV3 | public byte[][] receiveTupleV3() throws IOException, OutOfMemoryError {
// TODO: use msgSize
int msgSize = receiveInteger4();
int nf = receiveInteger2();
byte[][] answer = new byte[nf][];
OutOfMemoryError oom = null;
for (int i = 0; i < nf; ++i) {
int size = receiveInteger4();
if (s... | java | public byte[][] receiveTupleV3() throws IOException, OutOfMemoryError {
// TODO: use msgSize
int msgSize = receiveInteger4();
int nf = receiveInteger2();
byte[][] answer = new byte[nf][];
OutOfMemoryError oom = null;
for (int i = 0; i < nf; ++i) {
int size = receiveInteger4();
if (s... | [
"public",
"byte",
"[",
"]",
"[",
"]",
"receiveTupleV3",
"(",
")",
"throws",
"IOException",
",",
"OutOfMemoryError",
"{",
"// TODO: use msgSize",
"int",
"msgSize",
"=",
"receiveInteger4",
"(",
")",
";",
"int",
"nf",
"=",
"receiveInteger2",
"(",
")",
";",
"byt... | Read a tuple from the back end. A tuple is a two dimensional array of bytes. This variant reads
the V3 protocol's tuple representation.
@return tuple from the back end
@throws IOException if a data I/O error occurs | [
"Read",
"a",
"tuple",
"from",
"the",
"back",
"end",
".",
"A",
"tuple",
"is",
"a",
"two",
"dimensional",
"array",
"of",
"bytes",
".",
"This",
"variant",
"reads",
"the",
"V3",
"protocol",
"s",
"tuple",
"representation",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L425-L450 |
60,310 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.receive | public void receive(byte[] buf, int off, int siz) throws IOException {
int s = 0;
while (s < siz) {
int w = pgInput.read(buf, off + s, siz - s);
if (w < 0) {
throw new EOFException();
}
s += w;
}
} | java | public void receive(byte[] buf, int off, int siz) throws IOException {
int s = 0;
while (s < siz) {
int w = pgInput.read(buf, off + s, siz - s);
if (w < 0) {
throw new EOFException();
}
s += w;
}
} | [
"public",
"void",
"receive",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
",",
"int",
"siz",
")",
"throws",
"IOException",
"{",
"int",
"s",
"=",
"0",
";",
"while",
"(",
"s",
"<",
"siz",
")",
"{",
"int",
"w",
"=",
"pgInput",
".",
"read",
"("... | Reads in a given number of bytes from the backend.
@param buf buffer to store result
@param off offset in buffer
@param siz number of bytes to read
@throws IOException if a data I/O error occurs | [
"Reads",
"in",
"a",
"given",
"number",
"of",
"bytes",
"from",
"the",
"backend",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L473-L483 |
60,311 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.sendStream | public void sendStream(InputStream inStream, int remaining) throws IOException {
int expectedLength = remaining;
if (streamBuffer == null) {
streamBuffer = new byte[8192];
}
while (remaining > 0) {
int count = (remaining > streamBuffer.length ? streamBuffer.length : remaining);
int re... | java | public void sendStream(InputStream inStream, int remaining) throws IOException {
int expectedLength = remaining;
if (streamBuffer == null) {
streamBuffer = new byte[8192];
}
while (remaining > 0) {
int count = (remaining > streamBuffer.length ? streamBuffer.length : remaining);
int re... | [
"public",
"void",
"sendStream",
"(",
"InputStream",
"inStream",
",",
"int",
"remaining",
")",
"throws",
"IOException",
"{",
"int",
"expectedLength",
"=",
"remaining",
";",
"if",
"(",
"streamBuffer",
"==",
"null",
")",
"{",
"streamBuffer",
"=",
"new",
"byte",
... | Copy data from an input stream to the connection.
@param inStream the stream to read data from
@param remaining the number of bytes to copy
@throws IOException if a data I/O error occurs | [
"Copy",
"data",
"from",
"an",
"input",
"stream",
"to",
"the",
"connection",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L499-L528 |
60,312 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.receiveEOF | public void receiveEOF() throws SQLException, IOException {
int c = pgInput.read();
if (c < 0) {
return;
}
throw new PSQLException(GT.tr("Expected an EOF from server, got: {0}", c),
PSQLState.COMMUNICATION_ERROR);
} | java | public void receiveEOF() throws SQLException, IOException {
int c = pgInput.read();
if (c < 0) {
return;
}
throw new PSQLException(GT.tr("Expected an EOF from server, got: {0}", c),
PSQLState.COMMUNICATION_ERROR);
} | [
"public",
"void",
"receiveEOF",
"(",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"int",
"c",
"=",
"pgInput",
".",
"read",
"(",
")",
";",
"if",
"(",
"c",
"<",
"0",
")",
"{",
"return",
";",
"}",
"throw",
"new",
"PSQLException",
"(",
"GT",
... | Consume an expected EOF from the backend.
@throws IOException if an I/O error occurs
@throws SQLException if we get something other than an EOF | [
"Consume",
"an",
"expected",
"EOF",
"from",
"the",
"backend",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L550-L557 |
60,313 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/hostchooser/GlobalHostStatusTracker.java | GlobalHostStatusTracker.reportHostStatus | public static void reportHostStatus(HostSpec hostSpec, HostStatus hostStatus) {
long now = currentTimeMillis();
synchronized (hostStatusMap) {
HostSpecStatus hostSpecStatus = hostStatusMap.get(hostSpec);
if (hostSpecStatus == null) {
hostSpecStatus = new HostSpecStatus(hostSpec);
hos... | java | public static void reportHostStatus(HostSpec hostSpec, HostStatus hostStatus) {
long now = currentTimeMillis();
synchronized (hostStatusMap) {
HostSpecStatus hostSpecStatus = hostStatusMap.get(hostSpec);
if (hostSpecStatus == null) {
hostSpecStatus = new HostSpecStatus(hostSpec);
hos... | [
"public",
"static",
"void",
"reportHostStatus",
"(",
"HostSpec",
"hostSpec",
",",
"HostStatus",
"hostStatus",
")",
"{",
"long",
"now",
"=",
"currentTimeMillis",
"(",
")",
";",
"synchronized",
"(",
"hostStatusMap",
")",
"{",
"HostSpecStatus",
"hostSpecStatus",
"=",... | Store the actual observed host status.
@param hostSpec The host whose status is known.
@param hostStatus Latest known status for the host. | [
"Store",
"the",
"actual",
"observed",
"host",
"status",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/hostchooser/GlobalHostStatusTracker.java#L30-L41 |
60,314 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/hostchooser/GlobalHostStatusTracker.java | GlobalHostStatusTracker.getCandidateHosts | static List<HostSpec> getCandidateHosts(HostSpec[] hostSpecs,
HostRequirement targetServerType, long hostRecheckMillis) {
List<HostSpec> candidates = new ArrayList<HostSpec>(hostSpecs.length);
long latestAllowedUpdate = currentTimeMillis() - hostRecheckMillis;
synchronized (hostStatusMap) {
for ... | java | static List<HostSpec> getCandidateHosts(HostSpec[] hostSpecs,
HostRequirement targetServerType, long hostRecheckMillis) {
List<HostSpec> candidates = new ArrayList<HostSpec>(hostSpecs.length);
long latestAllowedUpdate = currentTimeMillis() - hostRecheckMillis;
synchronized (hostStatusMap) {
for ... | [
"static",
"List",
"<",
"HostSpec",
">",
"getCandidateHosts",
"(",
"HostSpec",
"[",
"]",
"hostSpecs",
",",
"HostRequirement",
"targetServerType",
",",
"long",
"hostRecheckMillis",
")",
"{",
"List",
"<",
"HostSpec",
">",
"candidates",
"=",
"new",
"ArrayList",
"<",... | Returns a list of candidate hosts that have the required targetServerType.
@param hostSpecs The potential list of hosts.
@param targetServerType The required target server type.
@param hostRecheckMillis How stale information is allowed.
@return candidate hosts to connect to. | [
"Returns",
"a",
"list",
"of",
"candidate",
"hosts",
"that",
"have",
"the",
"required",
"targetServerType",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/hostchooser/GlobalHostStatusTracker.java#L51-L67 |
60,315 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/sspi/SSPIClient.java | SSPIClient.isSSPISupported | @Override
public boolean isSSPISupported() {
try {
/*
* SSPI is windows-only. Attempt to use JNA to identify the platform. If Waffle is missing we
* won't have JNA and this will throw a NoClassDefFoundError.
*/
if (!Platform.isWindows()) {
LOGGER.log(Level.FINE, "SSPI not ... | java | @Override
public boolean isSSPISupported() {
try {
/*
* SSPI is windows-only. Attempt to use JNA to identify the platform. If Waffle is missing we
* won't have JNA and this will throw a NoClassDefFoundError.
*/
if (!Platform.isWindows()) {
LOGGER.log(Level.FINE, "SSPI not ... | [
"@",
"Override",
"public",
"boolean",
"isSSPISupported",
"(",
")",
"{",
"try",
"{",
"/*\n * SSPI is windows-only. Attempt to use JNA to identify the platform. If Waffle is missing we\n * won't have JNA and this will throw a NoClassDefFoundError.\n */",
"if",
"(",
"!",
"... | Test whether we can attempt SSPI authentication. If false, do not attempt to call any other
SSPIClient methods.
@return true if it's safe to attempt SSPI authentication | [
"Test",
"whether",
"we",
"can",
"attempt",
"SSPI",
"authentication",
".",
"If",
"false",
"do",
"not",
"attempt",
"to",
"call",
"any",
"other",
"SSPIClient",
"methods",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/sspi/SSPIClient.java#L79-L100 |
60,316 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/sspi/SSPIClient.java | SSPIClient.continueSSPI | @Override
public void continueSSPI(int msgLength) throws SQLException, IOException {
if (sspiContext == null) {
throw new IllegalStateException("Cannot continue SSPI authentication that we didn't begin");
}
LOGGER.log(Level.FINEST, "Continuing SSPI negotiation");
/* Read the response token fr... | java | @Override
public void continueSSPI(int msgLength) throws SQLException, IOException {
if (sspiContext == null) {
throw new IllegalStateException("Cannot continue SSPI authentication that we didn't begin");
}
LOGGER.log(Level.FINEST, "Continuing SSPI negotiation");
/* Read the response token fr... | [
"@",
"Override",
"public",
"void",
"continueSSPI",
"(",
"int",
"msgLength",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"if",
"(",
"sspiContext",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot continue SSPI authentication... | Continue an existing authentication conversation with the back-end in resonse to an
authentication request of type AUTH_REQ_GSS_CONT.
@param msgLength Length of message to read, excluding length word and message type word
@throws SQLException if something wrong happens
@throws IOException if something wrong happens | [
"Continue",
"an",
"existing",
"authentication",
"conversation",
"with",
"the",
"back",
"-",
"end",
"in",
"resonse",
"to",
"an",
"authentication",
"request",
"of",
"type",
"AUTH_REQ_GSS_CONT",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/sspi/SSPIClient.java#L181-L209 |
60,317 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/sspi/SSPIClient.java | SSPIClient.dispose | @Override
public void dispose() {
if (sspiContext != null) {
sspiContext.dispose();
sspiContext = null;
}
if (clientCredentials != null) {
clientCredentials.dispose();
clientCredentials = null;
}
} | java | @Override
public void dispose() {
if (sspiContext != null) {
sspiContext.dispose();
sspiContext = null;
}
if (clientCredentials != null) {
clientCredentials.dispose();
clientCredentials = null;
}
} | [
"@",
"Override",
"public",
"void",
"dispose",
"(",
")",
"{",
"if",
"(",
"sspiContext",
"!=",
"null",
")",
"{",
"sspiContext",
".",
"dispose",
"(",
")",
";",
"sspiContext",
"=",
"null",
";",
"}",
"if",
"(",
"clientCredentials",
"!=",
"null",
")",
"{",
... | Clean up native win32 resources after completion or failure of SSPI authentication. This
SSPIClient instance becomes unusable after disposal. | [
"Clean",
"up",
"native",
"win32",
"resources",
"after",
"completion",
"or",
"failure",
"of",
"SSPI",
"authentication",
".",
"This",
"SSPIClient",
"instance",
"becomes",
"unusable",
"after",
"disposal",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/sspi/SSPIClient.java#L227-L237 |
60,318 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/ds/common/BaseDataSource.java | BaseDataSource.getConnection | public Connection getConnection(String user, String password) throws SQLException {
try {
Connection con = DriverManager.getConnection(getUrl(), user, password);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Created a {0} for {1} at {2}",
new Object[] {getDescription()... | java | public Connection getConnection(String user, String password) throws SQLException {
try {
Connection con = DriverManager.getConnection(getUrl(), user, password);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Created a {0} for {1} at {2}",
new Object[] {getDescription()... | [
"public",
"Connection",
"getConnection",
"(",
"String",
"user",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"Connection",
"con",
"=",
"DriverManager",
".",
"getConnection",
"(",
"getUrl",
"(",
")",
",",
"user",
",",
"password",
... | Gets a connection to the PostgreSQL database. The database is identified by the DataSource
properties serverName, databaseName, and portNumber. The user to connect as is identified by
the arguments user and password, which override the DataSource properties by the same name.
@param user user
@param password passwo... | [
"Gets",
"a",
"connection",
"to",
"the",
"PostgreSQL",
"database",
".",
"The",
"database",
"is",
"identified",
"by",
"the",
"DataSource",
"properties",
"serverName",
"databaseName",
"and",
"portNumber",
".",
"The",
"user",
"to",
"connect",
"as",
"is",
"identified... | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/common/BaseDataSource.java#L95-L108 |
60,319 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/geometric/PGpoint.java | PGpoint.toBytes | public void toBytes(byte[] b, int offset) {
ByteConverter.float8(b, offset, x);
ByteConverter.float8(b, offset + 8, y);
} | java | public void toBytes(byte[] b, int offset) {
ByteConverter.float8(b, offset, x);
ByteConverter.float8(b, offset + 8, y);
} | [
"public",
"void",
"toBytes",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
")",
"{",
"ByteConverter",
".",
"float8",
"(",
"b",
",",
"offset",
",",
"x",
")",
";",
"ByteConverter",
".",
"float8",
"(",
"b",
",",
"offset",
"+",
"8",
",",
"y",
")"... | Populate the byte array with PGpoint in the binary syntax expected by org.postgresql. | [
"Populate",
"the",
"byte",
"array",
"with",
"PGpoint",
"in",
"the",
"binary",
"syntax",
"expected",
"by",
"org",
".",
"postgresql",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/geometric/PGpoint.java#L121-L124 |
60,320 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/ssl/jdbc4/LibPQFactory.java | LibPQFactory.verifyHostName | @Deprecated
public static boolean verifyHostName(String hostname, String pattern) {
String canonicalHostname;
if (hostname.startsWith("[") && hostname.endsWith("]")) {
// IPv6 address like [2001:db8:0:1:1:1:1:1]
canonicalHostname = hostname.substring(1, hostname.length() - 1);
} else {
/... | java | @Deprecated
public static boolean verifyHostName(String hostname, String pattern) {
String canonicalHostname;
if (hostname.startsWith("[") && hostname.endsWith("]")) {
// IPv6 address like [2001:db8:0:1:1:1:1:1]
canonicalHostname = hostname.substring(1, hostname.length() - 1);
} else {
/... | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"verifyHostName",
"(",
"String",
"hostname",
",",
"String",
"pattern",
")",
"{",
"String",
"canonicalHostname",
";",
"if",
"(",
"hostname",
".",
"startsWith",
"(",
"\"[\"",
")",
"&&",
"hostname",
".",
"endsWith... | Verifies if given hostname matches pattern.
@deprecated use {@link PGjdbcHostnameVerifier}
@param hostname input hostname
@param pattern domain name pattern
@return true when domain matches pattern | [
"Verifies",
"if",
"given",
"hostname",
"matches",
"pattern",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ssl/jdbc4/LibPQFactory.java#L45-L61 |
60,321 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/geometric/PGpath.java | PGpath.getValue | public String getValue() {
StringBuilder b = new StringBuilder(open ? "[" : "(");
for (int p = 0; p < points.length; p++) {
if (p > 0) {
b.append(",");
}
b.append(points[p].toString());
}
b.append(open ? "]" : ")");
return b.toString();
} | java | public String getValue() {
StringBuilder b = new StringBuilder(open ? "[" : "(");
for (int p = 0; p < points.length; p++) {
if (p > 0) {
b.append(",");
}
b.append(points[p].toString());
}
b.append(open ? "]" : ")");
return b.toString();
} | [
"public",
"String",
"getValue",
"(",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
"open",
"?",
"\"[\"",
":",
"\"(\"",
")",
";",
"for",
"(",
"int",
"p",
"=",
"0",
";",
"p",
"<",
"points",
".",
"length",
";",
"p",
"++",
")",
"{... | This returns the path in the syntax expected by org.postgresql. | [
"This",
"returns",
"the",
"path",
"in",
"the",
"syntax",
"expected",
"by",
"org",
".",
"postgresql",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/geometric/PGpath.java#L132-L144 |
60,322 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseDeleteKeyword | public static boolean parseDeleteKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 'd'
&& (query[offset + 1] | 32) == 'e'
&& (query[offset + 2] | 32) == 'l'
&& (query[offset + 3] | 32) == 'e'
&& ... | java | public static boolean parseDeleteKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 'd'
&& (query[offset + 1] | 32) == 'e'
&& (query[offset + 2] | 32) == 'l'
&& (query[offset + 3] | 32) == 'e'
&& ... | [
"public",
"static",
"boolean",
"parseDeleteKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"6",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of DELETE keyword regardless of case. The initial character is
assumed to have been matched.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"DELETE",
"keyword",
"regardless",
"of",
"case",
".",
"The",
"initial",
"character",
"is",
"assumed",
"to",
"have",
"been",
"matched",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L562-L573 |
60,323 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseInsertKeyword | public static boolean parseInsertKeyword(final char[] query, int offset) {
if (query.length < (offset + 7)) {
return false;
}
return (query[offset] | 32) == 'i'
&& (query[offset + 1] | 32) == 'n'
&& (query[offset + 2] | 32) == 's'
&& (query[offset + 3] | 32) == 'e'
&& ... | java | public static boolean parseInsertKeyword(final char[] query, int offset) {
if (query.length < (offset + 7)) {
return false;
}
return (query[offset] | 32) == 'i'
&& (query[offset + 1] | 32) == 'n'
&& (query[offset + 2] | 32) == 's'
&& (query[offset + 3] | 32) == 'e'
&& ... | [
"public",
"static",
"boolean",
"parseInsertKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"7",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of INSERT keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"INSERT",
"keyword",
"regardless",
"of",
"case",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L582-L593 |
60,324 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseMoveKeyword | public static boolean parseMoveKeyword(final char[] query, int offset) {
if (query.length < (offset + 4)) {
return false;
}
return (query[offset] | 32) == 'm'
&& (query[offset + 1] | 32) == 'o'
&& (query[offset + 2] | 32) == 'v'
&& (query[offset + 3] | 32) == 'e';
} | java | public static boolean parseMoveKeyword(final char[] query, int offset) {
if (query.length < (offset + 4)) {
return false;
}
return (query[offset] | 32) == 'm'
&& (query[offset + 1] | 32) == 'o'
&& (query[offset + 2] | 32) == 'v'
&& (query[offset + 3] | 32) == 'e';
} | [
"public",
"static",
"boolean",
"parseMoveKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"4",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of MOVE keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"MOVE",
"keyword",
"regardless",
"of",
"case",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L602-L611 |
60,325 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseReturningKeyword | public static boolean parseReturningKeyword(final char[] query, int offset) {
if (query.length < (offset + 9)) {
return false;
}
return (query[offset] | 32) == 'r'
&& (query[offset + 1] | 32) == 'e'
&& (query[offset + 2] | 32) == 't'
&& (query[offset + 3] | 32) == 'u'
... | java | public static boolean parseReturningKeyword(final char[] query, int offset) {
if (query.length < (offset + 9)) {
return false;
}
return (query[offset] | 32) == 'r'
&& (query[offset + 1] | 32) == 'e'
&& (query[offset + 2] | 32) == 't'
&& (query[offset + 3] | 32) == 'u'
... | [
"public",
"static",
"boolean",
"parseReturningKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"9",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(... | Parse string to check presence of RETURNING keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"RETURNING",
"keyword",
"regardless",
"of",
"case",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L620-L634 |
60,326 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseSelectKeyword | public static boolean parseSelectKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 's'
&& (query[offset + 1] | 32) == 'e'
&& (query[offset + 2] | 32) == 'l'
&& (query[offset + 3] | 32) == 'e'
&& ... | java | public static boolean parseSelectKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 's'
&& (query[offset + 1] | 32) == 'e'
&& (query[offset + 2] | 32) == 'l'
&& (query[offset + 3] | 32) == 'e'
&& ... | [
"public",
"static",
"boolean",
"parseSelectKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"6",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of SELECT keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"SELECT",
"keyword",
"regardless",
"of",
"case",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L643-L654 |
60,327 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseUpdateKeyword | public static boolean parseUpdateKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 'u'
&& (query[offset + 1] | 32) == 'p'
&& (query[offset + 2] | 32) == 'd'
&& (query[offset + 3] | 32) == 'a'
&& ... | java | public static boolean parseUpdateKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 'u'
&& (query[offset + 1] | 32) == 'p'
&& (query[offset + 2] | 32) == 'd'
&& (query[offset + 3] | 32) == 'a'
&& ... | [
"public",
"static",
"boolean",
"parseUpdateKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"6",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of UPDATE keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"UPDATE",
"keyword",
"regardless",
"of",
"case",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L663-L674 |
60,328 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseValuesKeyword | public static boolean parseValuesKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 'v'
&& (query[offset + 1] | 32) == 'a'
&& (query[offset + 2] | 32) == 'l'
&& (query[offset + 3] | 32) == 'u'
&& ... | java | public static boolean parseValuesKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 'v'
&& (query[offset + 1] | 32) == 'a'
&& (query[offset + 2] | 32) == 'l'
&& (query[offset + 3] | 32) == 'u'
&& ... | [
"public",
"static",
"boolean",
"parseValuesKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"6",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of VALUES keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"VALUES",
"keyword",
"regardless",
"of",
"case",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L683-L694 |
60,329 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseWithKeyword | public static boolean parseWithKeyword(final char[] query, int offset) {
if (query.length < (offset + 4)) {
return false;
}
return (query[offset] | 32) == 'w'
&& (query[offset + 1] | 32) == 'i'
&& (query[offset + 2] | 32) == 't'
&& (query[offset + 3] | 32) == 'h';
} | java | public static boolean parseWithKeyword(final char[] query, int offset) {
if (query.length < (offset + 4)) {
return false;
}
return (query[offset] | 32) == 'w'
&& (query[offset + 1] | 32) == 'i'
&& (query[offset + 2] | 32) == 't'
&& (query[offset + 3] | 32) == 'h';
} | [
"public",
"static",
"boolean",
"parseWithKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"4",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of WITH keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"WITH",
"keyword",
"regardless",
"of",
"case",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L723-L732 |
60,330 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseAsKeyword | public static boolean parseAsKeyword(final char[] query, int offset) {
if (query.length < (offset + 2)) {
return false;
}
return (query[offset] | 32) == 'a'
&& (query[offset + 1] | 32) == 's';
} | java | public static boolean parseAsKeyword(final char[] query, int offset) {
if (query.length < (offset + 2)) {
return false;
}
return (query[offset] | 32) == 'a'
&& (query[offset + 1] | 32) == 's';
} | [
"public",
"static",
"boolean",
"parseAsKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"2",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"q... | Parse string to check presence of AS keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"AS",
"keyword",
"regardless",
"of",
"case",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L741-L748 |
60,331 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.subArraysEqual | private static boolean subArraysEqual(final char[] arr,
final int offA, final int offB,
final int len) {
if (offA < 0 || offB < 0
|| offA >= arr.length || offB >= arr.length
|| offA + len > arr.length || offB + len > arr.length) {
return false;
}
for (int i = 0; i < len; +... | java | private static boolean subArraysEqual(final char[] arr,
final int offA, final int offB,
final int len) {
if (offA < 0 || offB < 0
|| offA >= arr.length || offB >= arr.length
|| offA + len > arr.length || offB + len > arr.length) {
return false;
}
for (int i = 0; i < len; +... | [
"private",
"static",
"boolean",
"subArraysEqual",
"(",
"final",
"char",
"[",
"]",
"arr",
",",
"final",
"int",
"offA",
",",
"final",
"int",
"offB",
",",
"final",
"int",
"len",
")",
"{",
"if",
"(",
"offA",
"<",
"0",
"||",
"offB",
"<",
"0",
"||",
"off... | Compares two sub-arrays of the given character array for equalness. If the length is zero, the
result is true if and only if the offsets are within the bounds of the array.
@param arr a char array
@param offA first sub-array start offset
@param offB second sub-array start offset
@param len length of the sub arrays t... | [
"Compares",
"two",
"sub",
"-",
"arrays",
"of",
"the",
"given",
"character",
"array",
"for",
"equalness",
".",
"If",
"the",
"length",
"is",
"zero",
"the",
"result",
"is",
"true",
"if",
"and",
"only",
"if",
"the",
"offsets",
"are",
"within",
"the",
"bounds... | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L874-L890 |
60,332 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.escapeFunctionArguments | private static int escapeFunctionArguments(StringBuilder newsql, String functionName, char[] sql, int i,
boolean stdStrings)
throws SQLException {
// Maximum arity of functions in EscapedFunctions is 3
List<CharSequence> parsedArgs = new ArrayList<CharSequence>(3);
while (true) {
StringBui... | java | private static int escapeFunctionArguments(StringBuilder newsql, String functionName, char[] sql, int i,
boolean stdStrings)
throws SQLException {
// Maximum arity of functions in EscapedFunctions is 3
List<CharSequence> parsedArgs = new ArrayList<CharSequence>(3);
while (true) {
StringBui... | [
"private",
"static",
"int",
"escapeFunctionArguments",
"(",
"StringBuilder",
"newsql",
",",
"String",
"functionName",
",",
"char",
"[",
"]",
"sql",
",",
"int",
"i",
",",
"boolean",
"stdStrings",
")",
"throws",
"SQLException",
"{",
"// Maximum arity of functions in E... | Generate sql for escaped functions.
@param newsql destination StringBuilder
@param functionName the escaped function name
@param sql input SQL text (containing arguments of a function call with possible JDBC escapes)
@param i position in the input SQL
@param stdStrings whether standard_conforming_strings is on
@return... | [
"Generate",
"sql",
"for",
"escaped",
"functions",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L1306-L1343 |
60,333 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/xa/PGXAConnection.java | PGXAConnection.getConnection | @Override
public Connection getConnection() throws SQLException {
Connection conn = super.getConnection();
// When we're outside an XA transaction, autocommit
// is supposed to be true, per usual JDBC convention.
// When an XA transaction is in progress, it should be
// false.
if (state == St... | java | @Override
public Connection getConnection() throws SQLException {
Connection conn = super.getConnection();
// When we're outside an XA transaction, autocommit
// is supposed to be true, per usual JDBC convention.
// When an XA transaction is in progress, it should be
// false.
if (state == St... | [
"@",
"Override",
"public",
"Connection",
"getConnection",
"(",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"super",
".",
"getConnection",
"(",
")",
";",
"// When we're outside an XA transaction, autocommit",
"// is supposed to be true, per usual JDBC conven... | XAConnection interface. | [
"XAConnection",
"interface",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/xa/PGXAConnection.java#L81-L100 |
60,334 | pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/xa/PGXAConnection.java | PGXAConnection.forget | @Override
public void forget(Xid xid) throws XAException {
throw new PGXAException(GT.tr("Heuristic commit/rollback not supported. forget xid={0}", xid),
XAException.XAER_NOTA);
} | java | @Override
public void forget(Xid xid) throws XAException {
throw new PGXAException(GT.tr("Heuristic commit/rollback not supported. forget xid={0}", xid),
XAException.XAER_NOTA);
} | [
"@",
"Override",
"public",
"void",
"forget",
"(",
"Xid",
"xid",
")",
"throws",
"XAException",
"{",
"throw",
"new",
"PGXAException",
"(",
"GT",
".",
"tr",
"(",
"\"Heuristic commit/rollback not supported. forget xid={0}\"",
",",
"xid",
")",
",",
"XAException",
".",
... | Does nothing, since we don't do heuristics. | [
"Does",
"nothing",
"since",
"we",
"don",
"t",
"do",
"heuristics",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/xa/PGXAConnection.java#L624-L628 |
60,335 | Jacksgong/JKeyboardPanelSwitch | library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java | KeyboardUtil.detach | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static void detach(Activity activity, ViewTreeObserver.OnGlobalLayoutListener l) {
ViewGroup contentView = activity.findViewById(android.R.id.content);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
contentView.getViewTree... | java | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static void detach(Activity activity, ViewTreeObserver.OnGlobalLayoutListener l) {
ViewGroup contentView = activity.findViewById(android.R.id.content);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
contentView.getViewTree... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN",
")",
"public",
"static",
"void",
"detach",
"(",
"Activity",
"activity",
",",
"ViewTreeObserver",
".",
"OnGlobalLayoutListener",
"l",
")",
"{",
"ViewGroup",
"contentView",
"=",
"activity",
"... | Remove the OnGlobalLayoutListener from the activity root view
@param activity same activity used in {@link #attach} method
@param l ViewTreeObserver.OnGlobalLayoutListener returned by {@link #attach} method | [
"Remove",
"the",
"OnGlobalLayoutListener",
"from",
"the",
"activity",
"root",
"view"
] | 092128023e824c85da63540780c79088b37a0c74 | https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/092128023e824c85da63540780c79088b37a0c74/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L210-L219 |
60,336 | Jacksgong/JKeyboardPanelSwitch | app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/MainActivity.java | MainActivity.onClickExtraThemeResolved | public void onClickExtraThemeResolved(final View view) {
final boolean fullScreenTheme = mFullScreenRb.isChecked();
Intent i = new Intent(this, ChattingResolvedHandleByPlaceholderActivity.class);
i.putExtra(KEY_FULL_SCREEN_THEME, fullScreenTheme);
startActivity(i);
} | java | public void onClickExtraThemeResolved(final View view) {
final boolean fullScreenTheme = mFullScreenRb.isChecked();
Intent i = new Intent(this, ChattingResolvedHandleByPlaceholderActivity.class);
i.putExtra(KEY_FULL_SCREEN_THEME, fullScreenTheme);
startActivity(i);
} | [
"public",
"void",
"onClickExtraThemeResolved",
"(",
"final",
"View",
"view",
")",
"{",
"final",
"boolean",
"fullScreenTheme",
"=",
"mFullScreenRb",
".",
"isChecked",
"(",
")",
";",
"Intent",
"i",
"=",
"new",
"Intent",
"(",
"this",
",",
"ChattingResolvedHandleByP... | Resolved for Full Screen Theme or Translucent Status Theme. | [
"Resolved",
"for",
"Full",
"Screen",
"Theme",
"or",
"Translucent",
"Status",
"Theme",
"."
] | 092128023e824c85da63540780c79088b37a0c74 | https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/092128023e824c85da63540780c79088b37a0c74/app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/MainActivity.java#L93-L99 |
60,337 | Jacksgong/JKeyboardPanelSwitch | library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java | KPSwitchConflictUtil.hidePanelAndKeyboard | public static void hidePanelAndKeyboard(final View panelLayout) {
final Activity activity = (Activity) panelLayout.getContext();
final View focusView = activity.getCurrentFocus();
if (focusView != null) {
KeyboardUtil.hideKeyboard(activity.getCurrentFocus());
focusView.c... | java | public static void hidePanelAndKeyboard(final View panelLayout) {
final Activity activity = (Activity) panelLayout.getContext();
final View focusView = activity.getCurrentFocus();
if (focusView != null) {
KeyboardUtil.hideKeyboard(activity.getCurrentFocus());
focusView.c... | [
"public",
"static",
"void",
"hidePanelAndKeyboard",
"(",
"final",
"View",
"panelLayout",
")",
"{",
"final",
"Activity",
"activity",
"=",
"(",
"Activity",
")",
"panelLayout",
".",
"getContext",
"(",
")",
";",
"final",
"View",
"focusView",
"=",
"activity",
".",
... | Hide the panel and the keyboard.
@param panelLayout the layout of panel. | [
"Hide",
"the",
"panel",
"and",
"the",
"keyboard",
"."
] | 092128023e824c85da63540780c79088b37a0c74 | https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/092128023e824c85da63540780c79088b37a0c74/library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java#L243-L253 |
60,338 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java | TypefaceProvider.getTypeface | public static Typeface getTypeface(Context context, IconSet iconSet) {
String path = iconSet.fontPath().toString();
if (TYPEFACE_MAP.get(path) == null) {
final Typeface font = Typeface.createFromAsset(context.getAssets(), path);
TYPEFACE_MAP.put(path, font);
}
re... | java | public static Typeface getTypeface(Context context, IconSet iconSet) {
String path = iconSet.fontPath().toString();
if (TYPEFACE_MAP.get(path) == null) {
final Typeface font = Typeface.createFromAsset(context.getAssets(), path);
TYPEFACE_MAP.put(path, font);
}
re... | [
"public",
"static",
"Typeface",
"getTypeface",
"(",
"Context",
"context",
",",
"IconSet",
"iconSet",
")",
"{",
"String",
"path",
"=",
"iconSet",
".",
"fontPath",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"TYPEFACE_MAP",
".",
"get",
"(",
"path"... | Returns a reference to the requested typeface, creating a new instance if none already exists
@param context the current context
@param iconSet the icon typeface
@return a reference to the typeface instance | [
"Returns",
"a",
"reference",
"to",
"the",
"requested",
"typeface",
"creating",
"a",
"new",
"instance",
"if",
"none",
"already",
"exists"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java#L31-L39 |
60,339 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java | TypefaceProvider.registerDefaultIconSets | public static void registerDefaultIconSets() {
final FontAwesome fontAwesome = new FontAwesome();
final Typicon typicon = new Typicon();
final MaterialIcons materialIcons = new MaterialIcons();
REGISTERED_ICON_SETS.put(fontAwesome.fontPath(), fontAwesome);
REGISTERED_ICON_SETS.p... | java | public static void registerDefaultIconSets() {
final FontAwesome fontAwesome = new FontAwesome();
final Typicon typicon = new Typicon();
final MaterialIcons materialIcons = new MaterialIcons();
REGISTERED_ICON_SETS.put(fontAwesome.fontPath(), fontAwesome);
REGISTERED_ICON_SETS.p... | [
"public",
"static",
"void",
"registerDefaultIconSets",
"(",
")",
"{",
"final",
"FontAwesome",
"fontAwesome",
"=",
"new",
"FontAwesome",
"(",
")",
";",
"final",
"Typicon",
"typicon",
"=",
"new",
"Typicon",
"(",
")",
";",
"final",
"MaterialIcons",
"materialIcons",... | Registers instances of the Default IconSets so that they are available throughout the whole
application. Currently the default icon sets include FontAwesome and Typicon. | [
"Registers",
"instances",
"of",
"the",
"Default",
"IconSets",
"so",
"that",
"they",
"are",
"available",
"throughout",
"the",
"whole",
"application",
".",
"Currently",
"the",
"default",
"icon",
"sets",
"include",
"FontAwesome",
"and",
"Typicon",
"."
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java#L45-L53 |
60,340 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java | TypefaceProvider.retrieveRegisteredIconSet | public static IconSet retrieveRegisteredIconSet(String fontPath, boolean editMode) {
final IconSet iconSet = REGISTERED_ICON_SETS.get(fontPath);
if (iconSet == null && !editMode) {
throw new RuntimeException(String.format("Font '%s' not properly registered, please" +
" s... | java | public static IconSet retrieveRegisteredIconSet(String fontPath, boolean editMode) {
final IconSet iconSet = REGISTERED_ICON_SETS.get(fontPath);
if (iconSet == null && !editMode) {
throw new RuntimeException(String.format("Font '%s' not properly registered, please" +
" s... | [
"public",
"static",
"IconSet",
"retrieveRegisteredIconSet",
"(",
"String",
"fontPath",
",",
"boolean",
"editMode",
")",
"{",
"final",
"IconSet",
"iconSet",
"=",
"REGISTERED_ICON_SETS",
".",
"get",
"(",
"fontPath",
")",
";",
"if",
"(",
"iconSet",
"==",
"null",
... | Retrieves a registered IconSet whose font can be found in the asset directory at the given path
@param fontPath the given path
@param editMode - whether the view requesting the icon set is displayed in the preview editor
@return the registered IconSet instance | [
"Retrieves",
"a",
"registered",
"IconSet",
"whose",
"font",
"can",
"be",
"found",
"in",
"the",
"asset",
"directory",
"at",
"the",
"given",
"path"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java#L71-L79 |
60,341 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapButtonGroup.java | BootstrapButtonGroup.onRadioToggle | void onRadioToggle(int index) {
for (int i = 0; i < getChildCount(); i++) {
if (i != index) {
BootstrapButton b = retrieveButtonChild(i);
b.setSelected(false);
}
}
} | java | void onRadioToggle(int index) {
for (int i = 0; i < getChildCount(); i++) {
if (i != index) {
BootstrapButton b = retrieveButtonChild(i);
b.setSelected(false);
}
}
} | [
"void",
"onRadioToggle",
"(",
"int",
"index",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getChildCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i",
"!=",
"index",
")",
"{",
"BootstrapButton",
"b",
"=",
"retrieveButtonChild... | Used for Radio Group Mode - resets all children to an unselected state,
apart from the calling Button.
@param index the index of the button becoming selected | [
"Used",
"for",
"Radio",
"Group",
"Mode",
"-",
"resets",
"all",
"children",
"to",
"an",
"unselected",
"state",
"apart",
"from",
"the",
"calling",
"Button",
"."
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapButtonGroup.java#L209-L217 |
60,342 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java | AwesomeTextView.startFlashing | public void startFlashing(boolean forever, AnimationSpeed speed) {
Animation fadeIn = new AlphaAnimation(0, 1);
//set up extra variables
fadeIn.setDuration(50);
fadeIn.setRepeatMode(Animation.REVERSE);
//default repeat count is 0, however if user wants, set it up to be infinite... | java | public void startFlashing(boolean forever, AnimationSpeed speed) {
Animation fadeIn = new AlphaAnimation(0, 1);
//set up extra variables
fadeIn.setDuration(50);
fadeIn.setRepeatMode(Animation.REVERSE);
//default repeat count is 0, however if user wants, set it up to be infinite... | [
"public",
"void",
"startFlashing",
"(",
"boolean",
"forever",
",",
"AnimationSpeed",
"speed",
")",
"{",
"Animation",
"fadeIn",
"=",
"new",
"AlphaAnimation",
"(",
"0",
",",
"1",
")",
";",
"//set up extra variables",
"fadeIn",
".",
"setDuration",
"(",
"50",
")",... | Starts a Flashing Animation on the AwesomeTextView
@param forever whether the animation should be infinite or play once
@param speed how fast the item should flash | [
"Starts",
"a",
"Flashing",
"Animation",
"on",
"the",
"AwesomeTextView"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java#L163-L178 |
60,343 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java | AwesomeTextView.startRotate | public void startRotate(boolean clockwise, AnimationSpeed speed) {
Animation rotate;
//set up the rotation animation
if (clockwise) {
rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
}
else {
rotate... | java | public void startRotate(boolean clockwise, AnimationSpeed speed) {
Animation rotate;
//set up the rotation animation
if (clockwise) {
rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
}
else {
rotate... | [
"public",
"void",
"startRotate",
"(",
"boolean",
"clockwise",
",",
"AnimationSpeed",
"speed",
")",
"{",
"Animation",
"rotate",
";",
"//set up the rotation animation",
"if",
"(",
"clockwise",
")",
"{",
"rotate",
"=",
"new",
"RotateAnimation",
"(",
"0",
",",
"360"... | Starts a rotating animation on the AwesomeTextView
@param clockwise true for clockwise, false for anti clockwise spinning
@param speed how fast the item should rotate | [
"Starts",
"a",
"rotating",
"animation",
"on",
"the",
"AwesomeTextView"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java#L186-L204 |
60,344 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/IconResolver.java | IconResolver.resolveIconSet | private static IconSet resolveIconSet(String iconCode) {
CharSequence unicode;
for (IconSet set : getRegisteredIconSets()) {
if (set.fontPath().equals(FontAwesome.FONT_PATH) || set.fontPath().equals(Typicon.FONT_PATH) || set.fontPath().equals(MaterialIcons.FONT_PATH)) {
con... | java | private static IconSet resolveIconSet(String iconCode) {
CharSequence unicode;
for (IconSet set : getRegisteredIconSets()) {
if (set.fontPath().equals(FontAwesome.FONT_PATH) || set.fontPath().equals(Typicon.FONT_PATH) || set.fontPath().equals(MaterialIcons.FONT_PATH)) {
con... | [
"private",
"static",
"IconSet",
"resolveIconSet",
"(",
"String",
"iconCode",
")",
"{",
"CharSequence",
"unicode",
";",
"for",
"(",
"IconSet",
"set",
":",
"getRegisteredIconSets",
"(",
")",
")",
"{",
"if",
"(",
"set",
".",
"fontPath",
"(",
")",
".",
"equals... | Searches for the unicode character value for the Font Icon Code. This method searches all
active FontIcons in the application.
@param iconCode the font icon code
@return the unicode character matching the icon, or null if none matches | [
"Searches",
"for",
"the",
"unicode",
"character",
"value",
"for",
"the",
"Font",
"Icon",
"Code",
".",
"This",
"method",
"searches",
"all",
"active",
"FontIcons",
"in",
"the",
"application",
"."
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/IconResolver.java#L112-L132 |
60,345 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDropDown.java | BootstrapDropDown.measureStringWidth | private float measureStringWidth(String text) {
Paint mPaint = new Paint();
mPaint.setTextSize(baselineDropDownViewFontSize * bootstrapSize);
return (float) (DimenUtils.dpToPixels(mPaint.measureText(text)));
} | java | private float measureStringWidth(String text) {
Paint mPaint = new Paint();
mPaint.setTextSize(baselineDropDownViewFontSize * bootstrapSize);
return (float) (DimenUtils.dpToPixels(mPaint.measureText(text)));
} | [
"private",
"float",
"measureStringWidth",
"(",
"String",
"text",
")",
"{",
"Paint",
"mPaint",
"=",
"new",
"Paint",
"(",
")",
";",
"mPaint",
".",
"setTextSize",
"(",
"baselineDropDownViewFontSize",
"*",
"bootstrapSize",
")",
";",
"return",
"(",
"float",
")",
... | Calculating string width
@param text String to calculate
@return width of String in pixels | [
"Calculating",
"string",
"width"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDropDown.java#L291-L295 |
60,346 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDropDown.java | BootstrapDropDown.getLongestString | private String getLongestString(String[] array) {
int maxLength = 0;
String longestString = null;
for (String s : array) {
if (s.length() > maxLength) {
maxLength = s.length();
longestString = s;
}
}
return longestString;
... | java | private String getLongestString(String[] array) {
int maxLength = 0;
String longestString = null;
for (String s : array) {
if (s.length() > maxLength) {
maxLength = s.length();
longestString = s;
}
}
return longestString;
... | [
"private",
"String",
"getLongestString",
"(",
"String",
"[",
"]",
"array",
")",
"{",
"int",
"maxLength",
"=",
"0",
";",
"String",
"longestString",
"=",
"null",
";",
"for",
"(",
"String",
"s",
":",
"array",
")",
"{",
"if",
"(",
"s",
".",
"length",
"("... | Searching for longest string in array
@param array input string array
@return longest string | [
"Searching",
"for",
"longest",
"string",
"in",
"array"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDropDown.java#L304-L314 |
60,347 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBarGroup.java | BootstrapProgressBarGroup.addEmptyProgressBar | private void addEmptyProgressBar(){
int whereIsEmpty = -1;
for (int i = 0; i < getChildCount(); i++) {
if (retrieveChild(i) != null && retrieveChild(i).equals(emptyProgressBar)) {
whereIsEmpty = i;
}
}
if (whereIsEmpty != getChildCount() - 1) {
... | java | private void addEmptyProgressBar(){
int whereIsEmpty = -1;
for (int i = 0; i < getChildCount(); i++) {
if (retrieveChild(i) != null && retrieveChild(i).equals(emptyProgressBar)) {
whereIsEmpty = i;
}
}
if (whereIsEmpty != getChildCount() - 1) {
... | [
"private",
"void",
"addEmptyProgressBar",
"(",
")",
"{",
"int",
"whereIsEmpty",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getChildCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"retrieveChild",
"(",
"i",
")",
"... | This looks for instances of emptyProgressBar and removes them if they are not at the end and then adds one at the end if its needed. | [
"This",
"looks",
"for",
"instances",
"of",
"emptyProgressBar",
"and",
"removes",
"them",
"if",
"they",
"are",
"not",
"at",
"the",
"end",
"and",
"then",
"adds",
"one",
"at",
"the",
"end",
"if",
"its",
"needed",
"."
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBarGroup.java#L80-L99 |
60,348 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBarGroup.java | BootstrapProgressBarGroup.getCumulativeProgress | public int getCumulativeProgress(){
int numChildren = getChildCount();
int total = 0;
for (int i = 0; i < numChildren; i++) {
total += getChildProgress(i);
}
checkCumulativeSmallerThanMax(maxProgress, total);
return total;
} | java | public int getCumulativeProgress(){
int numChildren = getChildCount();
int total = 0;
for (int i = 0; i < numChildren; i++) {
total += getChildProgress(i);
}
checkCumulativeSmallerThanMax(maxProgress, total);
return total;
} | [
"public",
"int",
"getCumulativeProgress",
"(",
")",
"{",
"int",
"numChildren",
"=",
"getChildCount",
"(",
")",
";",
"int",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numChildren",
";",
"i",
"++",
")",
"{",
"total",
"+... | This get the total progress of all the children
@return the CumulativeProgress i.e. the total progress of all children | [
"This",
"get",
"the",
"total",
"progress",
"of",
"all",
"the",
"children"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBarGroup.java#L146-L154 |
60,349 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBarGroup.java | BootstrapProgressBarGroup.setStriped | @Override
public void setStriped(boolean striped) {
this.striped = striped;
for (int i = 0; i < getChildCount(); i++) {
retrieveChild(i).setStriped(striped);
}
} | java | @Override
public void setStriped(boolean striped) {
this.striped = striped;
for (int i = 0; i < getChildCount(); i++) {
retrieveChild(i).setStriped(striped);
}
} | [
"@",
"Override",
"public",
"void",
"setStriped",
"(",
"boolean",
"striped",
")",
"{",
"this",
".",
"striped",
"=",
"striped",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getChildCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"retrieveChild",
... | This will set all children to striped.
@param striped true for a striped pattern, false for a plain pattern | [
"This",
"will",
"set",
"all",
"children",
"to",
"striped",
"."
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBarGroup.java#L246-L252 |
60,350 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java | BootstrapDrawableFactory.bootstrapButton | static Drawable bootstrapButton(Context context,
BootstrapBrand brand,
int strokeWidth,
int cornerRadius,
ViewGroupPosition position,
boolea... | java | static Drawable bootstrapButton(Context context,
BootstrapBrand brand,
int strokeWidth,
int cornerRadius,
ViewGroupPosition position,
boolea... | [
"static",
"Drawable",
"bootstrapButton",
"(",
"Context",
"context",
",",
"BootstrapBrand",
"brand",
",",
"int",
"strokeWidth",
",",
"int",
"cornerRadius",
",",
"ViewGroupPosition",
"position",
",",
"boolean",
"showOutline",
",",
"boolean",
"rounded",
")",
"{",
"Gr... | Generates a background drawable for a Bootstrap Button
@param context the current context
@param brand the bootstrap brand
@param strokeWidth the stroke width in px
@param cornerRadius the corner radius in px
@param position the position of the button in its parent view
@param showOutline whether the... | [
"Generates",
"a",
"background",
"drawable",
"for",
"a",
"Bootstrap",
"Button"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java#L45-L79 |
60,351 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java | BootstrapDrawableFactory.bootstrapLabel | static Drawable bootstrapLabel(Context context,
BootstrapBrand bootstrapBrand,
boolean rounded,
float height) {
int cornerRadius = (int) DimenUtils.pixelsFromDpResource(context, R.dimen.bootstrap_default_co... | java | static Drawable bootstrapLabel(Context context,
BootstrapBrand bootstrapBrand,
boolean rounded,
float height) {
int cornerRadius = (int) DimenUtils.pixelsFromDpResource(context, R.dimen.bootstrap_default_co... | [
"static",
"Drawable",
"bootstrapLabel",
"(",
"Context",
"context",
",",
"BootstrapBrand",
"bootstrapBrand",
",",
"boolean",
"rounded",
",",
"float",
"height",
")",
"{",
"int",
"cornerRadius",
"=",
"(",
"int",
")",
"DimenUtils",
".",
"pixelsFromDpResource",
"(",
... | Generates a Drawable for a Bootstrap Label background, according to state parameters
@param context the current context
@param bootstrapBrand the BootstrapBrand theming whose colors should be used
@param rounded whether the corners should be rounded or not
@param height the view height in px
@ret... | [
"Generates",
"a",
"Drawable",
"for",
"a",
"Bootstrap",
"Label",
"background",
"according",
"to",
"state",
"parameters"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java#L90-L103 |
60,352 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java | BootstrapDrawableFactory.bootstrapEditText | static Drawable bootstrapEditText(Context context,
BootstrapBrand bootstrapBrand,
float strokeWidth,
float cornerRadius,
boolean rounded) {
StateListDrawable d... | java | static Drawable bootstrapEditText(Context context,
BootstrapBrand bootstrapBrand,
float strokeWidth,
float cornerRadius,
boolean rounded) {
StateListDrawable d... | [
"static",
"Drawable",
"bootstrapEditText",
"(",
"Context",
"context",
",",
"BootstrapBrand",
"bootstrapBrand",
",",
"float",
"strokeWidth",
",",
"float",
"cornerRadius",
",",
"boolean",
"rounded",
")",
"{",
"StateListDrawable",
"drawable",
"=",
"new",
"StateListDrawab... | Generates a Drawable for a Bootstrap Edit Text background
@param context the current context
@param bootstrapBrand the BootstrapBrand theming whose colors should be used
@param rounded whether the corners should be rounded or not
@return the Bootstrap Edit Text background | [
"Generates",
"a",
"Drawable",
"for",
"a",
"Bootstrap",
"Edit",
"Text",
"background"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java#L113-L148 |
60,353 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java | BootstrapDrawableFactory.bootstrapButtonText | static ColorStateList bootstrapButtonText(Context context, boolean outline, BootstrapBrand brand) {
int defaultColor = outline ? brand.defaultFill(context) : brand.defaultTextColor(context);
int activeColor = outline ? ColorUtils.resolveColor(android.R.color.white, context) : brand.activeTextColor(cont... | java | static ColorStateList bootstrapButtonText(Context context, boolean outline, BootstrapBrand brand) {
int defaultColor = outline ? brand.defaultFill(context) : brand.defaultTextColor(context);
int activeColor = outline ? ColorUtils.resolveColor(android.R.color.white, context) : brand.activeTextColor(cont... | [
"static",
"ColorStateList",
"bootstrapButtonText",
"(",
"Context",
"context",
",",
"boolean",
"outline",
",",
"BootstrapBrand",
"brand",
")",
"{",
"int",
"defaultColor",
"=",
"outline",
"?",
"brand",
".",
"defaultFill",
"(",
"context",
")",
":",
"brand",
".",
... | Generates a colorstatelist for a bootstrap button
@param context the current context
@param outline whether the button is outlined
@param brand the button brand
@return the color state list | [
"Generates",
"a",
"colorstatelist",
"for",
"a",
"bootstrap",
"button"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java#L204-L219 |
60,354 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java | BootstrapDrawableFactory.createArrowIcon | private static Drawable createArrowIcon(Context context, int width, int height, int color, ExpandDirection expandDirection) {
Bitmap canvasBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(canvasBitmap);
Paint paint = new Paint();
paint.setS... | java | private static Drawable createArrowIcon(Context context, int width, int height, int color, ExpandDirection expandDirection) {
Bitmap canvasBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(canvasBitmap);
Paint paint = new Paint();
paint.setS... | [
"private",
"static",
"Drawable",
"createArrowIcon",
"(",
"Context",
"context",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"color",
",",
"ExpandDirection",
"expandDirection",
")",
"{",
"Bitmap",
"canvasBitmap",
"=",
"Bitmap",
".",
"createBitmap",
"(",... | Creates arrow icon that depends on ExpandDirection
@param context context
@param width width of icon in pixels
@param height height of icon in pixels
@param color arrow color
@param expandDirection arrow direction
@return icon drawable | [
"Creates",
"arrow",
"icon",
"that",
"depends",
"on",
"ExpandDirection"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDrawableFactory.java#L390-L417 |
60,355 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBar.java | BootstrapProgressBar.startStripedAnimationIfNeeded | private void startStripedAnimationIfNeeded() {
if (!striped || !animated) {
return;
}
clearAnimation();
progressAnimator = ValueAnimator.ofFloat(0, 0);
progressAnimator.setDuration(UPDATE_ANIM_MS);
progressAnimator.setRepeatCount(ValueAnimator.INFINITE);
... | java | private void startStripedAnimationIfNeeded() {
if (!striped || !animated) {
return;
}
clearAnimation();
progressAnimator = ValueAnimator.ofFloat(0, 0);
progressAnimator.setDuration(UPDATE_ANIM_MS);
progressAnimator.setRepeatCount(ValueAnimator.INFINITE);
... | [
"private",
"void",
"startStripedAnimationIfNeeded",
"(",
")",
"{",
"if",
"(",
"!",
"striped",
"||",
"!",
"animated",
")",
"{",
"return",
";",
"}",
"clearAnimation",
"(",
")",
";",
"progressAnimator",
"=",
"ValueAnimator",
".",
"ofFloat",
"(",
"0",
",",
"0"... | Starts an infinite animation cycle which provides the visual effect of stripes moving
backwards. The current system time is used to offset tiled bitmaps of the progress background,
producing the effect that the stripes are moving backwards. | [
"Starts",
"an",
"infinite",
"animation",
"cycle",
"which",
"provides",
"the",
"visual",
"effect",
"of",
"stripes",
"moving",
"backwards",
".",
"The",
"current",
"system",
"time",
"is",
"used",
"to",
"offset",
"tiled",
"bitmaps",
"of",
"the",
"progress",
"backg... | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBar.java#L250-L270 |
60,356 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBar.java | BootstrapProgressBar.createTile | private static Bitmap createTile(float h, Paint stripePaint, Paint progressPaint) {
Bitmap bm = Bitmap.createBitmap((int) h * 2, (int) h, ARGB_8888);
Canvas tile = new Canvas(bm);
float x = 0;
Path path = new Path();
path.moveTo(x, 0);
path.lineTo(x, h);
path.li... | java | private static Bitmap createTile(float h, Paint stripePaint, Paint progressPaint) {
Bitmap bm = Bitmap.createBitmap((int) h * 2, (int) h, ARGB_8888);
Canvas tile = new Canvas(bm);
float x = 0;
Path path = new Path();
path.moveTo(x, 0);
path.lineTo(x, h);
path.li... | [
"private",
"static",
"Bitmap",
"createTile",
"(",
"float",
"h",
",",
"Paint",
"stripePaint",
",",
"Paint",
"progressPaint",
")",
"{",
"Bitmap",
"bm",
"=",
"Bitmap",
".",
"createBitmap",
"(",
"(",
"int",
")",
"h",
"*",
"2",
",",
"(",
"int",
")",
"h",
... | Creates a Bitmap which is a tile of the progress bar background
@param h the view height
@return a bitmap of the progress bar background | [
"Creates",
"a",
"Bitmap",
"which",
"is",
"a",
"tile",
"of",
"the",
"progress",
"bar",
"background"
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBar.java#L374-L401 |
60,357 | Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBar.java | BootstrapProgressBar.setMaxProgress | public void setMaxProgress(int newMaxProgress) {
if (getProgress() <= newMaxProgress) {
maxProgress = newMaxProgress;
}
else {
throw new IllegalArgumentException(
String.format("MaxProgress cant be smaller than the current progress %d<%d", getProgress(... | java | public void setMaxProgress(int newMaxProgress) {
if (getProgress() <= newMaxProgress) {
maxProgress = newMaxProgress;
}
else {
throw new IllegalArgumentException(
String.format("MaxProgress cant be smaller than the current progress %d<%d", getProgress(... | [
"public",
"void",
"setMaxProgress",
"(",
"int",
"newMaxProgress",
")",
"{",
"if",
"(",
"getProgress",
"(",
")",
"<=",
"newMaxProgress",
")",
"{",
"maxProgress",
"=",
"newMaxProgress",
";",
"}",
"else",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"Str... | Used for settings the maxprogress. Also check if currentProgress is smaller than newMaxProgress.
@param newMaxProgress the maxProgress value | [
"Used",
"for",
"settings",
"the",
"maxprogress",
".",
"Also",
"check",
"if",
"currentProgress",
"is",
"smaller",
"than",
"newMaxProgress",
"."
] | b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapProgressBar.java#L582-L592 |
60,358 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcMultiServer.java | JsonRpcMultiServer.getHandlerInterfaces | @Override
protected Class<?>[] getHandlerInterfaces(String serviceName) {
Class<?> remoteInterface = interfaceMap.get(serviceName);
if (remoteInterface != null) {
return new Class<?>[]{remoteInterface};
} else if (Proxy.isProxyClass(getHandler(serviceName).getClass())) {
return getHandler(serviceName).getC... | java | @Override
protected Class<?>[] getHandlerInterfaces(String serviceName) {
Class<?> remoteInterface = interfaceMap.get(serviceName);
if (remoteInterface != null) {
return new Class<?>[]{remoteInterface};
} else if (Proxy.isProxyClass(getHandler(serviceName).getClass())) {
return getHandler(serviceName).getC... | [
"@",
"Override",
"protected",
"Class",
"<",
"?",
">",
"[",
"]",
"getHandlerInterfaces",
"(",
"String",
"serviceName",
")",
"{",
"Class",
"<",
"?",
">",
"remoteInterface",
"=",
"interfaceMap",
".",
"get",
"(",
"serviceName",
")",
";",
"if",
"(",
"remoteInte... | Returns the handler's class or interfaces. The serviceName is used
to look up a registered handler.
@param serviceName the optional name of a service
@return the class | [
"Returns",
"the",
"handler",
"s",
"class",
"or",
"interfaces",
".",
"The",
"serviceName",
"is",
"used",
"to",
"look",
"up",
"a",
"registered",
"handler",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcMultiServer.java#L88-L98 |
60,359 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcMultiServer.java | JsonRpcMultiServer.getServiceName | @Override
protected String getServiceName(final String methodName) {
if (methodName != null) {
int ndx = methodName.indexOf(this.separator);
if (ndx > 0) {
return methodName.substring(0, ndx);
}
}
return methodName;
} | java | @Override
protected String getServiceName(final String methodName) {
if (methodName != null) {
int ndx = methodName.indexOf(this.separator);
if (ndx > 0) {
return methodName.substring(0, ndx);
}
}
return methodName;
} | [
"@",
"Override",
"protected",
"String",
"getServiceName",
"(",
"final",
"String",
"methodName",
")",
"{",
"if",
"(",
"methodName",
"!=",
"null",
")",
"{",
"int",
"ndx",
"=",
"methodName",
".",
"indexOf",
"(",
"this",
".",
"separator",
")",
";",
"if",
"("... | Get the service name from the methodNode. JSON-RPC methods with the form
Service.method will result in "Service" being returned in this case.
@param methodName method name
@return the name of the service, or <code>null</code> | [
"Get",
"the",
"service",
"name",
"from",
"the",
"methodNode",
".",
"JSON",
"-",
"RPC",
"methods",
"with",
"the",
"form",
"Service",
".",
"method",
"will",
"result",
"in",
"Service",
"being",
"returned",
"in",
"this",
"case",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcMultiServer.java#L107-L116 |
60,360 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java | JsonRpcServer.handle | public void handle(ResourceRequest request, ResourceResponse response) throws IOException {
logger.debug("Handing ResourceRequest {}", request.getMethod());
response.setContentType(contentType);
InputStream input = getRequestStream(request);
OutputStream output = response.getPortletOutputStream();
handleReque... | java | public void handle(ResourceRequest request, ResourceResponse response) throws IOException {
logger.debug("Handing ResourceRequest {}", request.getMethod());
response.setContentType(contentType);
InputStream input = getRequestStream(request);
OutputStream output = response.getPortletOutputStream();
handleReque... | [
"public",
"void",
"handle",
"(",
"ResourceRequest",
"request",
",",
"ResourceResponse",
"response",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"Handing ResourceRequest {}\"",
",",
"request",
".",
"getMethod",
"(",
")",
")",
";",
"response",
... | Handles a portlet request.
@param request the {@link ResourceRequest}
@param response the {@link ResourceResponse}
@throws IOException on error | [
"Handles",
"a",
"portlet",
"request",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java#L103-L111 |
60,361 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java | JsonRpcServer.handle | public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException {
logger.debug("Handling HttpServletRequest {}", request);
response.setContentType(contentType);
OutputStream output = response.getOutputStream();
InputStream input = getRequestStream(request);
int result = ErrorRe... | java | public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException {
logger.debug("Handling HttpServletRequest {}", request);
response.setContentType(contentType);
OutputStream output = response.getOutputStream();
InputStream input = getRequestStream(request);
int result = ErrorRe... | [
"public",
"void",
"handle",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"Handling HttpServletRequest {}\"",
",",
"request",
")",
";",
"response",
".",
"setContentType",... | Handles a servlet request.
@param request the {@link HttpServletRequest}
@param response the {@link HttpServletResponse}
@throws IOException on error | [
"Handles",
"a",
"servlet",
"request",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcServer.java#L134-L160 |
60,362 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/StreamServer.java | StreamServer.stop | public void stop() throws InterruptedException {
if (!isStarted.get()) {
throw new IllegalStateException("The StreamServer is not started");
}
stopServer();
stopClients();
closeSocket();
try {
waitForServerToTerminate();
isStarted.set(false);
stopServer();
} catch (InterruptedException e) {
... | java | public void stop() throws InterruptedException {
if (!isStarted.get()) {
throw new IllegalStateException("The StreamServer is not started");
}
stopServer();
stopClients();
closeSocket();
try {
waitForServerToTerminate();
isStarted.set(false);
stopServer();
} catch (InterruptedException e) {
... | [
"public",
"void",
"stop",
"(",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"!",
"isStarted",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The StreamServer is not started\"",
")",
";",
"}",
"stopServer",
"(",
")",
... | Stops the server thread.
@throws InterruptedException if a graceful shutdown didn't happen | [
"Stops",
"the",
"server",
"thread",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/StreamServer.java#L107-L122 |
60,363 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/StreamServer.java | StreamServer.closeQuietly | private void closeQuietly(Closeable c) {
if (c != null) {
try {
c.close();
} catch (Throwable t) {
logger.warn("Error closing, ignoring", t);
}
}
} | java | private void closeQuietly(Closeable c) {
if (c != null) {
try {
c.close();
} catch (Throwable t) {
logger.warn("Error closing, ignoring", t);
}
}
} | [
"private",
"void",
"closeQuietly",
"(",
"Closeable",
"c",
")",
"{",
"if",
"(",
"c",
"!=",
"null",
")",
"{",
"try",
"{",
"c",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"logger",
".",
"warn",
"(",
"\"Error closing, i... | Closes something quietly.
@param c closable | [
"Closes",
"something",
"quietly",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/StreamServer.java#L151-L159 |
60,364 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.getHandlerInterfaces | protected Class<?>[] getHandlerInterfaces(final String serviceName) {
if (remoteInterface != null) {
return new Class<?>[]{remoteInterface};
} else if (Proxy.isProxyClass(handler.getClass())) {
return handler.getClass().getInterfaces();
} else {
return new Class<?>[]{handler.getClass()};
}
} | java | protected Class<?>[] getHandlerInterfaces(final String serviceName) {
if (remoteInterface != null) {
return new Class<?>[]{remoteInterface};
} else if (Proxy.isProxyClass(handler.getClass())) {
return handler.getClass().getInterfaces();
} else {
return new Class<?>[]{handler.getClass()};
}
} | [
"protected",
"Class",
"<",
"?",
">",
"[",
"]",
"getHandlerInterfaces",
"(",
"final",
"String",
"serviceName",
")",
"{",
"if",
"(",
"remoteInterface",
"!=",
"null",
")",
"{",
"return",
"new",
"Class",
"<",
"?",
">",
"[",
"]",
"{",
"remoteInterface",
"}",
... | Returns the handler's class or interfaces. The variable serviceName is ignored in this class.
@param serviceName the optional name of a service
@return the class | [
"Returns",
"the",
"handler",
"s",
"class",
"or",
"interfaces",
".",
"The",
"variable",
"serviceName",
"is",
"ignored",
"in",
"this",
"class",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L255-L263 |
60,365 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.createResponseError | private ErrorObjectWithJsonError createResponseError(String jsonRpc, Object id, JsonError errorObject) {
ObjectNode response = mapper.createObjectNode();
ObjectNode error = mapper.createObjectNode();
error.put(ERROR_CODE, errorObject.code);
error.put(ERROR_MESSAGE, errorObject.message);
if (errorObject.data !... | java | private ErrorObjectWithJsonError createResponseError(String jsonRpc, Object id, JsonError errorObject) {
ObjectNode response = mapper.createObjectNode();
ObjectNode error = mapper.createObjectNode();
error.put(ERROR_CODE, errorObject.code);
error.put(ERROR_MESSAGE, errorObject.message);
if (errorObject.data !... | [
"private",
"ErrorObjectWithJsonError",
"createResponseError",
"(",
"String",
"jsonRpc",
",",
"Object",
"id",
",",
"JsonError",
"errorObject",
")",
"{",
"ObjectNode",
"response",
"=",
"mapper",
".",
"createObjectNode",
"(",
")",
";",
"ObjectNode",
"error",
"=",
"ma... | Convenience method for creating an error response.
@param jsonRpc the jsonrpc string
@param id the id
@param errorObject the error data (if any)
@return the error response | [
"Convenience",
"method",
"for",
"creating",
"an",
"error",
"response",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L555-L579 |
60,366 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.createResponseSuccess | private ObjectNode createResponseSuccess(String jsonRpc, Object id, JsonNode result) {
ObjectNode response = mapper.createObjectNode();
response.put(JSONRPC, jsonRpc);
if (Integer.class.isInstance(id)) {
response.put(ID, Integer.class.cast(id).intValue());
} else if (Long.class.isInstance(id)) {
response.... | java | private ObjectNode createResponseSuccess(String jsonRpc, Object id, JsonNode result) {
ObjectNode response = mapper.createObjectNode();
response.put(JSONRPC, jsonRpc);
if (Integer.class.isInstance(id)) {
response.put(ID, Integer.class.cast(id).intValue());
} else if (Long.class.isInstance(id)) {
response.... | [
"private",
"ObjectNode",
"createResponseSuccess",
"(",
"String",
"jsonRpc",
",",
"Object",
"id",
",",
"JsonNode",
"result",
")",
"{",
"ObjectNode",
"response",
"=",
"mapper",
".",
"createObjectNode",
"(",
")",
";",
"response",
".",
"put",
"(",
"JSONRPC",
",",
... | Creates a success response.
@param jsonRpc the version string
@param id the id of the request
@param result the result object
@return the response object | [
"Creates",
"a",
"success",
"response",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L589-L607 |
60,367 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/spring/rest/JsonRpcRestClient.java | JsonRpcRestClient.initRestTemplate | private void initRestTemplate() {
boolean isContainsConverter = false;
for (HttpMessageConverter<?> httpMessageConverter : this.restTemplate.getMessageConverters()) {
if (MappingJacksonRPC2HttpMessageConverter.class.isAssignableFrom(httpMessageConverter.getClass())) {
isContainsConverter = true;
break;
... | java | private void initRestTemplate() {
boolean isContainsConverter = false;
for (HttpMessageConverter<?> httpMessageConverter : this.restTemplate.getMessageConverters()) {
if (MappingJacksonRPC2HttpMessageConverter.class.isAssignableFrom(httpMessageConverter.getClass())) {
isContainsConverter = true;
break;
... | [
"private",
"void",
"initRestTemplate",
"(",
")",
"{",
"boolean",
"isContainsConverter",
"=",
"false",
";",
"for",
"(",
"HttpMessageConverter",
"<",
"?",
">",
"httpMessageConverter",
":",
"this",
".",
"restTemplate",
".",
"getMessageConverters",
"(",
")",
")",
"{... | Check RestTemplate contains required converters | [
"Check",
"RestTemplate",
"contains",
"required",
"converters"
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/spring/rest/JsonRpcRestClient.java#L67-L94 |
60,368 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpClient.java | JsonRpcHttpClient.prepareConnection | private HttpURLConnection prepareConnection(Map<String, String> extraHeaders) throws IOException {
// create URLConnection
HttpURLConnection connection = (HttpURLConnection) serviceUrl.openConnection(connectionProxy);
connection.setConnectTimeout(connectionTimeoutMillis);
connection.setReadTimeout(readTimeou... | java | private HttpURLConnection prepareConnection(Map<String, String> extraHeaders) throws IOException {
// create URLConnection
HttpURLConnection connection = (HttpURLConnection) serviceUrl.openConnection(connectionProxy);
connection.setConnectTimeout(connectionTimeoutMillis);
connection.setReadTimeout(readTimeou... | [
"private",
"HttpURLConnection",
"prepareConnection",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"extraHeaders",
")",
"throws",
"IOException",
"{",
"// create URLConnection",
"HttpURLConnection",
"connection",
"=",
"(",
"HttpURLConnection",
")",
"serviceUrl",
".",
... | Prepares a connection to the server.
@param extraHeaders extra headers to add to the request
@return the unopened connection
@throws IOException | [
"Prepares",
"a",
"connection",
"to",
"the",
"server",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpClient.java#L195-L213 |
60,369 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java | ProxyUtil.createCompositeServiceProxy | public static Object createCompositeServiceProxy(ClassLoader classLoader, Object[] services, boolean allowMultipleInheritance) {
return createCompositeServiceProxy(classLoader, services, null, allowMultipleInheritance);
} | java | public static Object createCompositeServiceProxy(ClassLoader classLoader, Object[] services, boolean allowMultipleInheritance) {
return createCompositeServiceProxy(classLoader, services, null, allowMultipleInheritance);
} | [
"public",
"static",
"Object",
"createCompositeServiceProxy",
"(",
"ClassLoader",
"classLoader",
",",
"Object",
"[",
"]",
"services",
",",
"boolean",
"allowMultipleInheritance",
")",
"{",
"return",
"createCompositeServiceProxy",
"(",
"classLoader",
",",
"services",
",",
... | Creates a composite service using all of the given
services.
@param classLoader the {@link ClassLoader}
@param services the service objects
@param allowMultipleInheritance whether or not to allow multiple inheritance
@return the object | [
"Creates",
"a",
"composite",
"service",
"using",
"all",
"of",
"the",
"given",
"services",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java#L37-L39 |
60,370 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java | ProxyUtil.createCompositeServiceProxy | public static Object createCompositeServiceProxy(ClassLoader classLoader, Object[] services, Class<?>[] serviceInterfaces, boolean allowMultipleInheritance) {
Set<Class<?>> interfaces = collectInterfaces(services, serviceInterfaces);
final Map<Class<?>, Object> serviceClassToInstanceMapping = buildServiceMap(ser... | java | public static Object createCompositeServiceProxy(ClassLoader classLoader, Object[] services, Class<?>[] serviceInterfaces, boolean allowMultipleInheritance) {
Set<Class<?>> interfaces = collectInterfaces(services, serviceInterfaces);
final Map<Class<?>, Object> serviceClassToInstanceMapping = buildServiceMap(ser... | [
"public",
"static",
"Object",
"createCompositeServiceProxy",
"(",
"ClassLoader",
"classLoader",
",",
"Object",
"[",
"]",
"services",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"serviceInterfaces",
",",
"boolean",
"allowMultipleInheritance",
")",
"{",
"Set",
"<",
"Cl... | Creates a composite service using all of the given
services and implementing the given interfaces.
@param classLoader the {@link ClassLoader}
@param services the service objects
@param serviceInterfaces the service interfaces
@param allowMultipleInheritance whether or not to allow m... | [
"Creates",
"a",
"composite",
"service",
"using",
"all",
"of",
"the",
"given",
"services",
"and",
"implementing",
"the",
"given",
"interfaces",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java#L51-L66 |
60,371 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/spring/AutoJsonRpcClientProxyCreator.java | AutoJsonRpcClientProxyCreator.registerJsonProxyBean | private void registerJsonProxyBean(DefaultListableBeanFactory defaultListableBeanFactory, String className, String path) {
BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder
.rootBeanDefinition(JsonProxyFactoryBean.class)
.addPropertyValue("serviceUrl", appendBasePath(path))
.addPrope... | java | private void registerJsonProxyBean(DefaultListableBeanFactory defaultListableBeanFactory, String className, String path) {
BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder
.rootBeanDefinition(JsonProxyFactoryBean.class)
.addPropertyValue("serviceUrl", appendBasePath(path))
.addPrope... | [
"private",
"void",
"registerJsonProxyBean",
"(",
"DefaultListableBeanFactory",
"defaultListableBeanFactory",
",",
"String",
"className",
",",
"String",
"path",
")",
"{",
"BeanDefinitionBuilder",
"beanDefinitionBuilder",
"=",
"BeanDefinitionBuilder",
".",
"rootBeanDefinition",
... | Registers a new proxy bean with the bean factory. | [
"Registers",
"a",
"new",
"proxy",
"bean",
"with",
"the",
"bean",
"factory",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/spring/AutoJsonRpcClientProxyCreator.java#L76-L91 |
60,372 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/spring/AutoJsonRpcClientProxyCreator.java | AutoJsonRpcClientProxyCreator.appendBasePath | private String appendBasePath(String path) {
try {
return new URL(baseUrl, path).toString();
} catch (MalformedURLException e) {
throw new IllegalArgumentException(format("Cannot combine URLs '%s' and '%s' to valid URL.", baseUrl, path), e);
}
} | java | private String appendBasePath(String path) {
try {
return new URL(baseUrl, path).toString();
} catch (MalformedURLException e) {
throw new IllegalArgumentException(format("Cannot combine URLs '%s' and '%s' to valid URL.", baseUrl, path), e);
}
} | [
"private",
"String",
"appendBasePath",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"return",
"new",
"URL",
"(",
"baseUrl",
",",
"path",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"{",
"throw",
"new",
"Il... | Appends the base path to the path found in the interface. | [
"Appends",
"the",
"base",
"path",
"to",
"the",
"path",
"found",
"in",
"the",
"interface",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/spring/AutoJsonRpcClientProxyCreator.java#L96-L102 |
60,373 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/ReflectionUtil.java | ReflectionUtil.findCandidateMethods | static Set<Method> findCandidateMethods(Class<?>[] classes, String name) {
StringBuilder sb = new StringBuilder();
for (Class<?> clazz : classes) {
sb.append(clazz.getName()).append("::");
}
String cacheKey = sb.append(name).toString();
if (methodCache.containsKey(cacheKey)) {
return methodCache.get(cac... | java | static Set<Method> findCandidateMethods(Class<?>[] classes, String name) {
StringBuilder sb = new StringBuilder();
for (Class<?> clazz : classes) {
sb.append(clazz.getName()).append("::");
}
String cacheKey = sb.append(name).toString();
if (methodCache.containsKey(cacheKey)) {
return methodCache.get(cac... | [
"static",
"Set",
"<",
"Method",
">",
"findCandidateMethods",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"classes",
",",
"String",
"name",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Class",
"<",
"?",
">",
"cl... | Finds methods with the given name on the given class.
@param classes the classes
@param name the method name
@return the methods | [
"Finds",
"methods",
"with",
"the",
"given",
"name",
"on",
"the",
"given",
"class",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/ReflectionUtil.java#L35-L65 |
60,374 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/ReflectionUtil.java | ReflectionUtil.parseArguments | public static Object parseArguments(Method method, Object[] arguments) {
JsonRpcParamsPassMode paramsPassMode = JsonRpcParamsPassMode.AUTO;
JsonRpcMethod jsonRpcMethod = getAnnotation(method, JsonRpcMethod.class);
if (jsonRpcMethod != null)
paramsPassMode = jsonRpcMethod.paramsPassMode();
Map<String, Objec... | java | public static Object parseArguments(Method method, Object[] arguments) {
JsonRpcParamsPassMode paramsPassMode = JsonRpcParamsPassMode.AUTO;
JsonRpcMethod jsonRpcMethod = getAnnotation(method, JsonRpcMethod.class);
if (jsonRpcMethod != null)
paramsPassMode = jsonRpcMethod.paramsPassMode();
Map<String, Objec... | [
"public",
"static",
"Object",
"parseArguments",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"JsonRpcParamsPassMode",
"paramsPassMode",
"=",
"JsonRpcParamsPassMode",
".",
"AUTO",
";",
"JsonRpcMethod",
"jsonRpcMethod",
"=",
"getAnnotation",
... | Parses the given arguments for the given method optionally
turning them into named parameters.
@param method the method
@param arguments the arguments
@return the parsed arguments | [
"Parses",
"the",
"given",
"arguments",
"for",
"the",
"given",
"method",
"optionally",
"turning",
"them",
"into",
"named",
"parameters",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/ReflectionUtil.java#L190-L230 |
60,375 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java | JsonRpcHttpAsyncClient.addHeaders | private void addHeaders(HttpRequest request, Map<String, String> headers) {
for (Map.Entry<String, String> key : headers.entrySet()) {
request.addHeader(key.getKey(), key.getValue());
}
} | java | private void addHeaders(HttpRequest request, Map<String, String> headers) {
for (Map.Entry<String, String> key : headers.entrySet()) {
request.addHeader(key.getKey(), key.getValue());
}
} | [
"private",
"void",
"addHeaders",
"(",
"HttpRequest",
"request",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"key",
":",
"headers",
".",
"entrySet",
"(",
")",
... | Set the request headers.
@param request the request object
@param headers to be used | [
"Set",
"the",
"request",
"headers",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java#L261-L265 |
60,376 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.invokeAndReadResponse | private Object invokeAndReadResponse(String methodName, Object argument, Type returnType, OutputStream output, InputStream input, String id) throws Throwable {
invoke(methodName, argument, output, id);
return readResponse(returnType, input, id);
} | java | private Object invokeAndReadResponse(String methodName, Object argument, Type returnType, OutputStream output, InputStream input, String id) throws Throwable {
invoke(methodName, argument, output, id);
return readResponse(returnType, input, id);
} | [
"private",
"Object",
"invokeAndReadResponse",
"(",
"String",
"methodName",
",",
"Object",
"argument",
",",
"Type",
"returnType",
",",
"OutputStream",
"output",
",",
"InputStream",
"input",
",",
"String",
"id",
")",
"throws",
"Throwable",
"{",
"invoke",
"(",
"met... | Invokes the given method on the remote service
passing the given arguments and reads a response.
@param methodName the method to invoke
@param argument the argument to pass to the method
@param returnType the expected return type
@param output the {@link OutputStream} to write to
@param input the {@link Inp... | [
"Invokes",
"the",
"given",
"method",
"on",
"the",
"remote",
"service",
"passing",
"the",
"given",
"arguments",
"and",
"reads",
"a",
"response",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L157-L160 |
60,377 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.readResponse | private Object readResponse(Type returnType, InputStream input, String id) throws Throwable {
ReadContext context = ReadContext.getReadContext(input, mapper);
ObjectNode jsonObject = getValidResponse(id, context);
notifyAnswerListener(jsonObject);
handleErrorResponse(jsonObject);
if (hasResult(jsonObjec... | java | private Object readResponse(Type returnType, InputStream input, String id) throws Throwable {
ReadContext context = ReadContext.getReadContext(input, mapper);
ObjectNode jsonObject = getValidResponse(id, context);
notifyAnswerListener(jsonObject);
handleErrorResponse(jsonObject);
if (hasResult(jsonObjec... | [
"private",
"Object",
"readResponse",
"(",
"Type",
"returnType",
",",
"InputStream",
"input",
",",
"String",
"id",
")",
"throws",
"Throwable",
"{",
"ReadContext",
"context",
"=",
"ReadContext",
".",
"getReadContext",
"(",
"input",
",",
"mapper",
")",
";",
"Obje... | Reads a JSON-PRC response from the server. This blocks until
a response is received. If an id is given, responses that do
not correspond, are disregarded.
@param returnType the expected return type
@param input the {@link InputStream} to read from
@param id The id used to compare the response with.
@retu... | [
"Reads",
"a",
"JSON",
"-",
"PRC",
"response",
"from",
"the",
"server",
".",
"This",
"blocks",
"until",
"a",
"response",
"is",
"received",
".",
"If",
"an",
"id",
"is",
"given",
"responses",
"that",
"do",
"not",
"correspond",
"are",
"disregarded",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L191-L207 |
60,378 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.internalCreateRequest | private ObjectNode internalCreateRequest(String methodName, Object arguments, String id) {
final ObjectNode request = mapper.createObjectNode();
addId(id, request);
addProtocolAndMethod(methodName, request);
addParameters(arguments, request);
addAdditionalHeaders(request);
notifyBeforeRequestListener(reques... | java | private ObjectNode internalCreateRequest(String methodName, Object arguments, String id) {
final ObjectNode request = mapper.createObjectNode();
addId(id, request);
addProtocolAndMethod(methodName, request);
addParameters(arguments, request);
addAdditionalHeaders(request);
notifyBeforeRequestListener(reques... | [
"private",
"ObjectNode",
"internalCreateRequest",
"(",
"String",
"methodName",
",",
"Object",
"arguments",
",",
"String",
"id",
")",
"{",
"final",
"ObjectNode",
"request",
"=",
"mapper",
".",
"createObjectNode",
"(",
")",
";",
"addId",
"(",
"id",
",",
"request... | Creates RPC request.
@param methodName the method name
@param arguments the arguments
@param id the optional id
@return Jackson request object | [
"Creates",
"RPC",
"request",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L339-L347 |
60,379 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.invokeNotification | public void invokeNotification(String methodName, Object argument, OutputStream output) throws IOException {
writeRequest(methodName, argument, output, null);
output.flush();
} | java | public void invokeNotification(String methodName, Object argument, OutputStream output) throws IOException {
writeRequest(methodName, argument, output, null);
output.flush();
} | [
"public",
"void",
"invokeNotification",
"(",
"String",
"methodName",
",",
"Object",
"argument",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"writeRequest",
"(",
"methodName",
",",
"argument",
",",
"output",
",",
"null",
")",
";",
"output",
... | Invokes the given method on the remote service passing
the given argument without reading or expecting a return
response.
@param methodName the method to invoke
@param argument the argument to pass to the method
@param output the {@link OutputStream} to write to
@throws IOException on error
@see #writeRequest(St... | [
"Invokes",
"the",
"given",
"method",
"on",
"the",
"remote",
"service",
"passing",
"the",
"given",
"argument",
"without",
"reading",
"or",
"expecting",
"a",
"return",
"response",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L501-L504 |
60,380 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/spring/rest/MappingJacksonRPC2HttpMessageConverter.java | MappingJacksonRPC2HttpMessageConverter.getJsonEncoding | private JsonEncoding getJsonEncoding(MediaType contentType) {
if (contentType != null && contentType.getCharset() != null) {
Charset charset = contentType.getCharset();
for (JsonEncoding encoding : JsonEncoding.values()) {
if (charset.name().equals(encoding.getJavaName())) {
return encoding;
}
}... | java | private JsonEncoding getJsonEncoding(MediaType contentType) {
if (contentType != null && contentType.getCharset() != null) {
Charset charset = contentType.getCharset();
for (JsonEncoding encoding : JsonEncoding.values()) {
if (charset.name().equals(encoding.getJavaName())) {
return encoding;
}
}... | [
"private",
"JsonEncoding",
"getJsonEncoding",
"(",
"MediaType",
"contentType",
")",
"{",
"if",
"(",
"contentType",
"!=",
"null",
"&&",
"contentType",
".",
"getCharset",
"(",
")",
"!=",
"null",
")",
"{",
"Charset",
"charset",
"=",
"contentType",
".",
"getCharse... | Determine the JSON encoding to use for the given content type.
@param contentType the media type as requested by the caller
@return the JSON encoding to use (never <code>null</code>) | [
"Determine",
"the",
"JSON",
"encoding",
"to",
"use",
"for",
"the",
"given",
"content",
"type",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/spring/rest/MappingJacksonRPC2HttpMessageConverter.java#L173-L183 |
60,381 | briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/spring/AutoJsonRpcServiceExporter.java | AutoJsonRpcServiceExporter.registerServiceProxy | private void registerServiceProxy(DefaultListableBeanFactory defaultListableBeanFactory, String servicePath, String serviceBeanName) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(JsonServiceExporter.class).addPropertyReference("service", serviceBeanName);
BeanDefinition serviceBeanDef... | java | private void registerServiceProxy(DefaultListableBeanFactory defaultListableBeanFactory, String servicePath, String serviceBeanName) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(JsonServiceExporter.class).addPropertyReference("service", serviceBeanName);
BeanDefinition serviceBeanDef... | [
"private",
"void",
"registerServiceProxy",
"(",
"DefaultListableBeanFactory",
"defaultListableBeanFactory",
",",
"String",
"servicePath",
",",
"String",
"serviceBeanName",
")",
"{",
"BeanDefinitionBuilder",
"builder",
"=",
"BeanDefinitionBuilder",
".",
"rootBeanDefinition",
"... | Registers the new beans with the bean factory. | [
"Registers",
"the",
"new",
"beans",
"with",
"the",
"bean",
"factory",
"."
] | d749762c9295b92d893677a8c7be2a14dd43b3bb | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/spring/AutoJsonRpcServiceExporter.java#L121-L162 |
60,382 | requery/requery | requery-processor/src/main/java/io/requery/processor/EntityGraph.java | EntityGraph.referencingEntity | Optional<EntityDescriptor> referencingEntity(AttributeDescriptor attribute) {
if (!Names.isEmpty(attribute.referencedTable())) {
// match by table name
return entities.values().stream()
.filter(entity -> entity.tableName().equalsIgnoreCase(attribute.referencedTable()))
... | java | Optional<EntityDescriptor> referencingEntity(AttributeDescriptor attribute) {
if (!Names.isEmpty(attribute.referencedTable())) {
// match by table name
return entities.values().stream()
.filter(entity -> entity.tableName().equalsIgnoreCase(attribute.referencedTable()))
... | [
"Optional",
"<",
"EntityDescriptor",
">",
"referencingEntity",
"(",
"AttributeDescriptor",
"attribute",
")",
"{",
"if",
"(",
"!",
"Names",
".",
"isEmpty",
"(",
"attribute",
".",
"referencedTable",
"(",
")",
")",
")",
"{",
"// match by table name",
"return",
"ent... | Given a association attribute in an Entity find the Entity the attribute is referencing.
@param attribute association attribute
@return Optional Entity type being referenced. | [
"Given",
"a",
"association",
"attribute",
"in",
"an",
"Entity",
"find",
"the",
"Entity",
"the",
"attribute",
"is",
"referencing",
"."
] | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery-processor/src/main/java/io/requery/processor/EntityGraph.java#L94-L125 |
60,383 | requery/requery | requery-processor/src/main/java/io/requery/processor/EntityGraph.java | EntityGraph.referencingAttribute | Optional<? extends AttributeDescriptor> referencingAttribute(AttributeDescriptor attribute,
EntityDescriptor referenced) {
String referencedColumn = attribute.referencedColumn();
if (Names.isEmpty(referencedColumn)) {
// using ... | java | Optional<? extends AttributeDescriptor> referencingAttribute(AttributeDescriptor attribute,
EntityDescriptor referenced) {
String referencedColumn = attribute.referencedColumn();
if (Names.isEmpty(referencedColumn)) {
// using ... | [
"Optional",
"<",
"?",
"extends",
"AttributeDescriptor",
">",
"referencingAttribute",
"(",
"AttributeDescriptor",
"attribute",
",",
"EntityDescriptor",
"referenced",
")",
"{",
"String",
"referencedColumn",
"=",
"attribute",
".",
"referencedColumn",
"(",
")",
";",
"if",... | Given an attribute in a given type finds the corresponding attribute that it is referencing
in that referencing type.
@param attribute attribute
@param referenced type being referenced
@return optional element it references | [
"Given",
"an",
"attribute",
"in",
"a",
"given",
"type",
"finds",
"the",
"corresponding",
"attribute",
"that",
"it",
"is",
"referencing",
"in",
"that",
"referencing",
"type",
"."
] | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery-processor/src/main/java/io/requery/processor/EntityGraph.java#L140-L160 |
60,384 | requery/requery | requery-processor/src/main/java/io/requery/processor/EntityGraph.java | EntityGraph.mappedAttributes | Set<AttributeDescriptor> mappedAttributes(EntityDescriptor entity,
AttributeDescriptor attribute,
EntityDescriptor referenced) {
String mappedBy = attribute.mappedBy();
if (Names.isEmpty(mappedBy)) {
... | java | Set<AttributeDescriptor> mappedAttributes(EntityDescriptor entity,
AttributeDescriptor attribute,
EntityDescriptor referenced) {
String mappedBy = attribute.mappedBy();
if (Names.isEmpty(mappedBy)) {
... | [
"Set",
"<",
"AttributeDescriptor",
">",
"mappedAttributes",
"(",
"EntityDescriptor",
"entity",
",",
"AttributeDescriptor",
"attribute",
",",
"EntityDescriptor",
"referenced",
")",
"{",
"String",
"mappedBy",
"=",
"attribute",
".",
"mappedBy",
"(",
")",
";",
"if",
"... | Given an association in an entity find the attributes it maps onto in the referenced entity.
@param entity entity owning the attribute
@param attribute association attribute
@param referenced type being referenced
@return set of mapped attributes | [
"Given",
"an",
"association",
"in",
"an",
"entity",
"find",
"the",
"attributes",
"it",
"maps",
"onto",
"in",
"the",
"referenced",
"entity",
"."
] | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery-processor/src/main/java/io/requery/processor/EntityGraph.java#L170-L186 |
60,385 | requery/requery | requery-android/src/main/java/io/requery/android/sqlite/BasePreparedStatement.java | BasePreparedStatement.bindBlobLiteral | protected void bindBlobLiteral(int index, byte[] value) {
if (blobLiterals == null) {
blobLiterals = new LinkedHashMap<>();
}
blobLiterals.put(index, value);
} | java | protected void bindBlobLiteral(int index, byte[] value) {
if (blobLiterals == null) {
blobLiterals = new LinkedHashMap<>();
}
blobLiterals.put(index, value);
} | [
"protected",
"void",
"bindBlobLiteral",
"(",
"int",
"index",
",",
"byte",
"[",
"]",
"value",
")",
"{",
"if",
"(",
"blobLiterals",
"==",
"null",
")",
"{",
"blobLiterals",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"}",
"blobLiterals",
".",
"put",
... | inlines a blob literal into the sql statement since it can't be used as bind parameter | [
"inlines",
"a",
"blob",
"literal",
"into",
"the",
"sql",
"statement",
"since",
"it",
"can",
"t",
"be",
"used",
"as",
"bind",
"parameter"
] | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery-android/src/main/java/io/requery/android/sqlite/BasePreparedStatement.java#L115-L120 |
60,386 | requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.createIndexes | public void createIndexes(Connection connection, TableCreationMode mode) {
ArrayList<Type<?>> sorted = sortTypes();
for (Type<?> type : sorted) {
createIndexes(connection, mode, type);
}
} | java | public void createIndexes(Connection connection, TableCreationMode mode) {
ArrayList<Type<?>> sorted = sortTypes();
for (Type<?> type : sorted) {
createIndexes(connection, mode, type);
}
} | [
"public",
"void",
"createIndexes",
"(",
"Connection",
"connection",
",",
"TableCreationMode",
"mode",
")",
"{",
"ArrayList",
"<",
"Type",
"<",
"?",
">",
">",
"sorted",
"=",
"sortTypes",
"(",
")",
";",
"for",
"(",
"Type",
"<",
"?",
">",
"type",
":",
"so... | Creates all indexes in the model.
@param connection to use
@param mode creation mode.
@throws TableModificationException if the creation fails. | [
"Creates",
"all",
"indexes",
"in",
"the",
"model",
"."
] | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L173-L178 |
60,387 | requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.createTablesString | public String createTablesString(TableCreationMode mode) {
ArrayList<Type<?>> sorted = sortTypes();
StringBuilder sb = new StringBuilder();
for (Type<?> type : sorted) {
String sql = tableCreateStatement(type, mode);
sb.append(sql);
sb.append(";\n");
}... | java | public String createTablesString(TableCreationMode mode) {
ArrayList<Type<?>> sorted = sortTypes();
StringBuilder sb = new StringBuilder();
for (Type<?> type : sorted) {
String sql = tableCreateStatement(type, mode);
sb.append(sql);
sb.append(";\n");
}... | [
"public",
"String",
"createTablesString",
"(",
"TableCreationMode",
"mode",
")",
"{",
"ArrayList",
"<",
"Type",
"<",
"?",
">",
">",
"sorted",
"=",
"sortTypes",
"(",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
... | Convenience method to generated the create table statements as a string.
@param mode table creation mode
@return DDL string | [
"Convenience",
"method",
"to",
"generated",
"the",
"create",
"table",
"statements",
"as",
"a",
"string",
"."
] | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L186-L195 |
60,388 | requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.dropTables | public void dropTables() {
try (Connection connection = getConnection();
Statement statement = connection.createStatement()) {
ArrayList<Type<?>> reversed = sortTypes();
Collections.reverse(reversed);
executeDropStatements(statement, reversed);
} catch (S... | java | public void dropTables() {
try (Connection connection = getConnection();
Statement statement = connection.createStatement()) {
ArrayList<Type<?>> reversed = sortTypes();
Collections.reverse(reversed);
executeDropStatements(statement, reversed);
} catch (S... | [
"public",
"void",
"dropTables",
"(",
")",
"{",
"try",
"(",
"Connection",
"connection",
"=",
"getConnection",
"(",
")",
";",
"Statement",
"statement",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"ArrayList",
"<",
"Type",
"<",
"?",
">",
... | Drop all tables in the schema. Note if the platform supports if exists that will be used in
the statement, if not and the table doesn't exist an exception will be thrown. | [
"Drop",
"all",
"tables",
"in",
"the",
"schema",
".",
"Note",
"if",
"the",
"platform",
"supports",
"if",
"exists",
"that",
"will",
"be",
"used",
"in",
"the",
"statement",
"if",
"not",
"and",
"the",
"table",
"doesn",
"t",
"exist",
"an",
"exception",
"will"... | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L201-L210 |
60,389 | requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.dropTable | public void dropTable(Type<?> type) {
try (Connection connection = getConnection();
Statement statement = connection.createStatement()) {
executeDropStatements(statement, Collections.<Type<?>>singletonList(type));
} catch (SQLException e) {
throw new TableModificatio... | java | public void dropTable(Type<?> type) {
try (Connection connection = getConnection();
Statement statement = connection.createStatement()) {
executeDropStatements(statement, Collections.<Type<?>>singletonList(type));
} catch (SQLException e) {
throw new TableModificatio... | [
"public",
"void",
"dropTable",
"(",
"Type",
"<",
"?",
">",
"type",
")",
"{",
"try",
"(",
"Connection",
"connection",
"=",
"getConnection",
"(",
")",
";",
"Statement",
"statement",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"executeDropS... | Drops a single table in the schema. | [
"Drops",
"a",
"single",
"table",
"in",
"the",
"schema",
"."
] | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L215-L222 |
60,390 | requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.tableCreateStatement | public <T> String tableCreateStatement(Type<T> type, TableCreationMode mode) {
String tableName = type.getName();
QueryBuilder qb = createQueryBuilder();
qb.keyword(CREATE);
if (type.getTableCreateAttributes() != null) {
for (String attribute : type.getTableCreateAttributes(... | java | public <T> String tableCreateStatement(Type<T> type, TableCreationMode mode) {
String tableName = type.getName();
QueryBuilder qb = createQueryBuilder();
qb.keyword(CREATE);
if (type.getTableCreateAttributes() != null) {
for (String attribute : type.getTableCreateAttributes(... | [
"public",
"<",
"T",
">",
"String",
"tableCreateStatement",
"(",
"Type",
"<",
"T",
">",
"type",
",",
"TableCreationMode",
"mode",
")",
"{",
"String",
"tableName",
"=",
"type",
".",
"getName",
"(",
")",
";",
"QueryBuilder",
"qb",
"=",
"createQueryBuilder",
"... | Generates the create table for a specific type.
@param type to generate the table statement
@param mode creation mode
@param <T> Type
@return create table sql string | [
"Generates",
"the",
"create",
"table",
"for",
"a",
"specific",
"type",
"."
] | 3070590c2ef76bb7062570bf9df03cd482db024a | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L391-L463 |
60,391 | ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/copy/SerializingCopier.java | SerializingCopier.copy | @Override
public T copy(final T obj) {
try {
return serializer.read(serializer.serialize(obj));
} catch (ClassNotFoundException e) {
throw new SerializerException("Copying failed.", e);
}
} | java | @Override
public T copy(final T obj) {
try {
return serializer.read(serializer.serialize(obj));
} catch (ClassNotFoundException e) {
throw new SerializerException("Copying failed.", e);
}
} | [
"@",
"Override",
"public",
"T",
"copy",
"(",
"final",
"T",
"obj",
")",
"{",
"try",
"{",
"return",
"serializer",
".",
"read",
"(",
"serializer",
".",
"serialize",
"(",
"obj",
")",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"... | Returns a copy of the passed in instance by serializing and deserializing it. | [
"Returns",
"a",
"copy",
"of",
"the",
"passed",
"in",
"instance",
"by",
"serializing",
"and",
"deserializing",
"it",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/copy/SerializingCopier.java#L57-L64 |
60,392 | ehcache/ehcache3 | transactions/src/main/java/org/ehcache/transactions/xa/txmgr/btm/BitronixXAResourceRegistry.java | BitronixXAResourceRegistry.registerXAResource | @Override
public void registerXAResource(String uniqueName, XAResource xaResource) {
Ehcache3XAResourceProducer xaResourceProducer = producers.get(uniqueName);
if (xaResourceProducer == null) {
xaResourceProducer = new Ehcache3XAResourceProducer();
xaResourceProducer.setUniqueName(uniqueName);
... | java | @Override
public void registerXAResource(String uniqueName, XAResource xaResource) {
Ehcache3XAResourceProducer xaResourceProducer = producers.get(uniqueName);
if (xaResourceProducer == null) {
xaResourceProducer = new Ehcache3XAResourceProducer();
xaResourceProducer.setUniqueName(uniqueName);
... | [
"@",
"Override",
"public",
"void",
"registerXAResource",
"(",
"String",
"uniqueName",
",",
"XAResource",
"xaResource",
")",
"{",
"Ehcache3XAResourceProducer",
"xaResourceProducer",
"=",
"producers",
".",
"get",
"(",
"uniqueName",
")",
";",
"if",
"(",
"xaResourceProd... | Register an XAResource of a cache with BTM. The first time a XAResource is registered a new
EhCacheXAResourceProducer is created to hold it.
@param uniqueName the uniqueName of this XAResourceProducer, usually the cache's name
@param xaResource the XAResource to be registered | [
"Register",
"an",
"XAResource",
"of",
"a",
"cache",
"with",
"BTM",
".",
"The",
"first",
"time",
"a",
"XAResource",
"is",
"registered",
"a",
"new",
"EhCacheXAResourceProducer",
"is",
"created",
"to",
"hold",
"it",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/transactions/src/main/java/org/ehcache/transactions/xa/txmgr/btm/BitronixXAResourceRegistry.java#L40-L59 |
60,393 | ehcache/ehcache3 | transactions/src/main/java/org/ehcache/transactions/xa/txmgr/btm/BitronixXAResourceRegistry.java | BitronixXAResourceRegistry.unregisterXAResource | @Override
public void unregisterXAResource(String uniqueName, XAResource xaResource) {
Ehcache3XAResourceProducer xaResourceProducer = producers.get(uniqueName);
if (xaResourceProducer != null) {
boolean found = xaResourceProducer.removeXAResource(xaResource);
if (!found) {
throw new Ille... | java | @Override
public void unregisterXAResource(String uniqueName, XAResource xaResource) {
Ehcache3XAResourceProducer xaResourceProducer = producers.get(uniqueName);
if (xaResourceProducer != null) {
boolean found = xaResourceProducer.removeXAResource(xaResource);
if (!found) {
throw new Ille... | [
"@",
"Override",
"public",
"void",
"unregisterXAResource",
"(",
"String",
"uniqueName",
",",
"XAResource",
"xaResource",
")",
"{",
"Ehcache3XAResourceProducer",
"xaResourceProducer",
"=",
"producers",
".",
"get",
"(",
"uniqueName",
")",
";",
"if",
"(",
"xaResourcePr... | Unregister an XAResource of a cache from BTM.
@param uniqueName the uniqueName of this XAResourceProducer, usually the cache's name
@param xaResource the XAResource to be registered | [
"Unregister",
"an",
"XAResource",
"of",
"a",
"cache",
"from",
"BTM",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/transactions/src/main/java/org/ehcache/transactions/xa/txmgr/btm/BitronixXAResourceRegistry.java#L66-L82 |
60,394 | ehcache/ehcache3 | clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/operations/ChainResolver.java | ChainResolver.compact | public void compact(ServerStoreProxy.ChainEntry entry) {
ChainBuilder builder = new ChainBuilder();
for (PutOperation<K, V> operation : resolveAll(entry).values()) {
builder = builder.add(codec.encode(operation));
}
Chain compacted = builder.build();
if (compacted.length() < entry.length()) {
... | java | public void compact(ServerStoreProxy.ChainEntry entry) {
ChainBuilder builder = new ChainBuilder();
for (PutOperation<K, V> operation : resolveAll(entry).values()) {
builder = builder.add(codec.encode(operation));
}
Chain compacted = builder.build();
if (compacted.length() < entry.length()) {
... | [
"public",
"void",
"compact",
"(",
"ServerStoreProxy",
".",
"ChainEntry",
"entry",
")",
"{",
"ChainBuilder",
"builder",
"=",
"new",
"ChainBuilder",
"(",
")",
";",
"for",
"(",
"PutOperation",
"<",
"K",
",",
"V",
">",
"operation",
":",
"resolveAll",
"(",
"ent... | Compacts the given chain entry by resolving every key within.
@param entry an uncompacted heterogenous {@link ServerStoreProxy.ChainEntry} | [
"Compacts",
"the",
"given",
"chain",
"entry",
"by",
"resolving",
"every",
"key",
"within",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/operations/ChainResolver.java#L93-L102 |
60,395 | ehcache/ehcache3 | clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/operations/ChainResolver.java | ChainResolver.resolveAll | protected Map<K, PutOperation<K, V>> resolveAll(Chain chain) {
//absent hash-collisions this should always be a 1 entry map
Map<K, PutOperation<K, V>> compacted = new HashMap<>(2);
for (Element element : chain) {
ByteBuffer payload = element.getPayload();
Operation<K, V> operation = codec.decode... | java | protected Map<K, PutOperation<K, V>> resolveAll(Chain chain) {
//absent hash-collisions this should always be a 1 entry map
Map<K, PutOperation<K, V>> compacted = new HashMap<>(2);
for (Element element : chain) {
ByteBuffer payload = element.getPayload();
Operation<K, V> operation = codec.decode... | [
"protected",
"Map",
"<",
"K",
",",
"PutOperation",
"<",
"K",
",",
"V",
">",
">",
"resolveAll",
"(",
"Chain",
"chain",
")",
"{",
"//absent hash-collisions this should always be a 1 entry map",
"Map",
"<",
"K",
",",
"PutOperation",
"<",
"K",
",",
"V",
">",
">"... | Resolves all keys within the given chain to their equivalent put operations.
@param chain target chain
@return a map of equivalent put operations | [
"Resolves",
"all",
"keys",
"within",
"the",
"given",
"chain",
"to",
"their",
"equivalent",
"put",
"operations",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/internal/store/operations/ChainResolver.java#L145-L154 |
60,396 | ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/internal/store/offheap/MemorySizeParser.java | MemorySizeParser.parse | public static long parse(String configuredMemorySize) throws IllegalArgumentException {
MemorySize size = parseIncludingUnit(configuredMemorySize);
return size.calculateMemorySizeInBytes();
} | java | public static long parse(String configuredMemorySize) throws IllegalArgumentException {
MemorySize size = parseIncludingUnit(configuredMemorySize);
return size.calculateMemorySizeInBytes();
} | [
"public",
"static",
"long",
"parse",
"(",
"String",
"configuredMemorySize",
")",
"throws",
"IllegalArgumentException",
"{",
"MemorySize",
"size",
"=",
"parseIncludingUnit",
"(",
"configuredMemorySize",
")",
";",
"return",
"size",
".",
"calculateMemorySizeInBytes",
"(",
... | Parse a String containing a human-readable memory size.
@param configuredMemorySize the String containing a human-readable memory size.
@return the memory size in bytes.
@throws IllegalArgumentException thrown when the configured memory size cannot be parsed. | [
"Parse",
"a",
"String",
"containing",
"a",
"human",
"-",
"readable",
"memory",
"size",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/store/offheap/MemorySizeParser.java#L37-L40 |
60,397 | ehcache/ehcache3 | clustered/client/src/main/java/org/ehcache/clustered/client/internal/ClusterTierManagerClientEntityFactory.java | ClusterTierManagerClientEntityFactory.abandonLeadership | public boolean abandonLeadership(String entityIdentifier, boolean healthyConnection) {
Hold hold = maintenanceHolds.remove(entityIdentifier);
return (hold != null) && healthyConnection && silentlyUnlock(hold, entityIdentifier);
} | java | public boolean abandonLeadership(String entityIdentifier, boolean healthyConnection) {
Hold hold = maintenanceHolds.remove(entityIdentifier);
return (hold != null) && healthyConnection && silentlyUnlock(hold, entityIdentifier);
} | [
"public",
"boolean",
"abandonLeadership",
"(",
"String",
"entityIdentifier",
",",
"boolean",
"healthyConnection",
")",
"{",
"Hold",
"hold",
"=",
"maintenanceHolds",
".",
"remove",
"(",
"entityIdentifier",
")",
";",
"return",
"(",
"hold",
"!=",
"null",
")",
"&&",... | Proactively abandon leadership before closing connection.
@param entityIdentifier the master entity identifier
@return true of abandoned false otherwise | [
"Proactively",
"abandon",
"leadership",
"before",
"closing",
"connection",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/internal/ClusterTierManagerClientEntityFactory.java#L94-L97 |
60,398 | ehcache/ehcache3 | clustered/client/src/main/java/org/ehcache/clustered/client/internal/ClusterTierManagerClientEntityFactory.java | ClusterTierManagerClientEntityFactory.abandonFetchHolds | private boolean abandonFetchHolds(String entityIdentifier, boolean healthyConnection) {
Hold hold = fetchHolds.remove(entityIdentifier);
return (hold != null) && healthyConnection && silentlyUnlock(hold, entityIdentifier);
} | java | private boolean abandonFetchHolds(String entityIdentifier, boolean healthyConnection) {
Hold hold = fetchHolds.remove(entityIdentifier);
return (hold != null) && healthyConnection && silentlyUnlock(hold, entityIdentifier);
} | [
"private",
"boolean",
"abandonFetchHolds",
"(",
"String",
"entityIdentifier",
",",
"boolean",
"healthyConnection",
")",
"{",
"Hold",
"hold",
"=",
"fetchHolds",
".",
"remove",
"(",
"entityIdentifier",
")",
";",
"return",
"(",
"hold",
"!=",
"null",
")",
"&&",
"h... | Proactively abandon any READ holds before closing connection.
@param entityIdentifier the master entity identifier
@return true of abandoned false otherwise | [
"Proactively",
"abandon",
"any",
"READ",
"holds",
"before",
"closing",
"connection",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/client/src/main/java/org/ehcache/clustered/client/internal/ClusterTierManagerClientEntityFactory.java#L105-L108 |
60,399 | ehcache/ehcache3 | clustered/server/src/main/java/org/ehcache/clustered/server/management/ClusterTierManagement.java | ClusterTierManagement.init | private void init() {
ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier);
ServerStoreBinding serverStoreBinding = new ServerStoreBinding(storeIdentifier, serverStore);
CompletableFuture<Void> r1 = managementRegistry.register(serverStoreBinding);
ServerSideConfiguration.Poo... | java | private void init() {
ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier);
ServerStoreBinding serverStoreBinding = new ServerStoreBinding(storeIdentifier, serverStore);
CompletableFuture<Void> r1 = managementRegistry.register(serverStoreBinding);
ServerSideConfiguration.Poo... | [
"private",
"void",
"init",
"(",
")",
"{",
"ServerSideServerStore",
"serverStore",
"=",
"ehcacheStateService",
".",
"getStore",
"(",
"storeIdentifier",
")",
";",
"ServerStoreBinding",
"serverStoreBinding",
"=",
"new",
"ServerStoreBinding",
"(",
"storeIdentifier",
",",
... | the goal of the following code is to send the management metadata from the entity into the monitoring tree AFTER the entity creation | [
"the",
"goal",
"of",
"the",
"following",
"code",
"is",
"to",
"send",
"the",
"management",
"metadata",
"from",
"the",
"entity",
"into",
"the",
"monitoring",
"tree",
"AFTER",
"the",
"entity",
"creation"
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/server/src/main/java/org/ehcache/clustered/server/management/ClusterTierManagement.java#L91-L106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.