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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Red5/red5-io | src/main/java/org/red5/io/flv/impl/FLVReader.java | FLVReader.getRemainingBytes | private long getRemainingBytes() {
if (in != null) {
if (!useLoadBuf) {
return in.remaining();
}
try {
if (channel.isOpen()) {
return channelSize - channel.position() + in.remaining();
} else {
... | java | private long getRemainingBytes() {
if (in != null) {
if (!useLoadBuf) {
return in.remaining();
}
try {
if (channel.isOpen()) {
return channelSize - channel.position() + in.remaining();
} else {
... | [
"private",
"long",
"getRemainingBytes",
"(",
")",
"{",
"if",
"(",
"in",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"useLoadBuf",
")",
"{",
"return",
"in",
".",
"remaining",
"(",
")",
";",
"}",
"try",
"{",
"if",
"(",
"channel",
".",
"isOpen",
"(",
")... | Get the remaining bytes that could be read from a file or ByteBuffer.
@return Number of remaining bytes | [
"Get",
"the",
"remaining",
"bytes",
"that",
"could",
"be",
"read",
"from",
"a",
"file",
"or",
"ByteBuffer",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L228-L244 | train |
Red5/red5-io | src/main/java/org/red5/io/flv/impl/FLVReader.java | FLVReader.getTotalBytes | @Override
public long getTotalBytes() {
if (!useLoadBuf) {
return in.capacity();
}
try {
return channelSize;
} catch (Exception e) {
log.error("Error getTotalBytes", e);
return 0;
}
} | java | @Override
public long getTotalBytes() {
if (!useLoadBuf) {
return in.capacity();
}
try {
return channelSize;
} catch (Exception e) {
log.error("Error getTotalBytes", e);
return 0;
}
} | [
"@",
"Override",
"public",
"long",
"getTotalBytes",
"(",
")",
"{",
"if",
"(",
"!",
"useLoadBuf",
")",
"{",
"return",
"in",
".",
"capacity",
"(",
")",
";",
"}",
"try",
"{",
"return",
"channelSize",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
... | Get the total readable bytes in a file or ByteBuffer.
@return Total readable bytes | [
"Get",
"the",
"total",
"readable",
"bytes",
"in",
"a",
"file",
"or",
"ByteBuffer",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L251-L262 | train |
Red5/red5-io | src/main/java/org/red5/io/flv/impl/FLVReader.java | FLVReader.getCurrentPosition | private long getCurrentPosition() {
long pos;
if (!useLoadBuf) {
return in.position();
}
try {
if (in != null) {
pos = (channel.position() - in.remaining());
} else {
pos = channel.position();
}
r... | java | private long getCurrentPosition() {
long pos;
if (!useLoadBuf) {
return in.position();
}
try {
if (in != null) {
pos = (channel.position() - in.remaining());
} else {
pos = channel.position();
}
r... | [
"private",
"long",
"getCurrentPosition",
"(",
")",
"{",
"long",
"pos",
";",
"if",
"(",
"!",
"useLoadBuf",
")",
"{",
"return",
"in",
".",
"position",
"(",
")",
";",
"}",
"try",
"{",
"if",
"(",
"in",
"!=",
"null",
")",
"{",
"pos",
"=",
"(",
"channe... | Get the current position in a file or ByteBuffer.
@return Current position in a file | [
"Get",
"the",
"current",
"position",
"in",
"a",
"file",
"or",
"ByteBuffer",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L269-L285 | train |
Red5/red5-io | src/main/java/org/red5/io/flv/impl/FLVReader.java | FLVReader.setCurrentPosition | private void setCurrentPosition(long pos) {
if (pos == Long.MAX_VALUE) {
pos = file.length();
}
if (!useLoadBuf) {
in.position((int) pos);
return;
}
try {
if (pos >= (channel.position() - in.limit()) && pos < channel.position()) {
... | java | private void setCurrentPosition(long pos) {
if (pos == Long.MAX_VALUE) {
pos = file.length();
}
if (!useLoadBuf) {
in.position((int) pos);
return;
}
try {
if (pos >= (channel.position() - in.limit()) && pos < channel.position()) {
... | [
"private",
"void",
"setCurrentPosition",
"(",
"long",
"pos",
")",
"{",
"if",
"(",
"pos",
"==",
"Long",
".",
"MAX_VALUE",
")",
"{",
"pos",
"=",
"file",
".",
"length",
"(",
")",
";",
"}",
"if",
"(",
"!",
"useLoadBuf",
")",
"{",
"in",
".",
"position",... | Modifies current position.
@param pos
Current position in file | [
"Modifies",
"current",
"position",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L293-L312 | train |
Red5/red5-io | src/main/java/org/red5/io/flv/impl/FLVReader.java | FLVReader.fillBuffer | private void fillBuffer(long amount, boolean reload) {
try {
if (amount > bufferSize) {
amount = bufferSize;
}
log.debug("Buffering amount: {} buffer size: {}", amount, bufferSize);
// Read all remaining bytes if the requested amount reach the end ... | java | private void fillBuffer(long amount, boolean reload) {
try {
if (amount > bufferSize) {
amount = bufferSize;
}
log.debug("Buffering amount: {} buffer size: {}", amount, bufferSize);
// Read all remaining bytes if the requested amount reach the end ... | [
"private",
"void",
"fillBuffer",
"(",
"long",
"amount",
",",
"boolean",
"reload",
")",
"{",
"try",
"{",
"if",
"(",
"amount",
">",
"bufferSize",
")",
"{",
"amount",
"=",
"bufferSize",
";",
"}",
"log",
".",
"debug",
"(",
"\"Buffering amount: {} buffer size: {}... | Load enough bytes from channel to buffer. After the loading process, the caller can make sure the amount in buffer is of size
'amount' if we haven't reached the end of channel.
@param amount
The amount of bytes in buffer after returning, no larger than bufferSize
@param reload
Whether to reload or append | [
"Load",
"enough",
"bytes",
"from",
"channel",
"to",
"buffer",
".",
"After",
"the",
"loading",
"process",
"the",
"caller",
"can",
"make",
"sure",
"the",
"amount",
"in",
"buffer",
"is",
"of",
"size",
"amount",
"if",
"we",
"haven",
"t",
"reached",
"the",
"e... | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L340-L380 | train |
Red5/red5-io | src/main/java/org/red5/io/flv/impl/FLVReader.java | FLVReader.setBufferType | public static void setBufferType(String bufferType) {
int bufferTypeHash = bufferType.hashCode();
switch (bufferTypeHash) {
case 3198444: //heap
//Get a heap buffer from buffer pool
FLVReader.bufferType = BufferType.HEAP;
break;
cas... | java | public static void setBufferType(String bufferType) {
int bufferTypeHash = bufferType.hashCode();
switch (bufferTypeHash) {
case 3198444: //heap
//Get a heap buffer from buffer pool
FLVReader.bufferType = BufferType.HEAP;
break;
cas... | [
"public",
"static",
"void",
"setBufferType",
"(",
"String",
"bufferType",
")",
"{",
"int",
"bufferTypeHash",
"=",
"bufferType",
".",
"hashCode",
"(",
")",
";",
"switch",
"(",
"bufferTypeHash",
")",
"{",
"case",
"3198444",
":",
"//heap",
"//Get a heap buffer from... | Setter for buffer type.
@param bufferType
Value to set for property 'bufferType' | [
"Setter",
"for",
"buffer",
"type",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L433-L449 | train |
Red5/red5-io | src/main/java/org/red5/io/flv/impl/FLVReader.java | FLVReader.readTagHeader | private ITag readTagHeader() throws UnsupportedDataTypeException {
// previous tag size (4 bytes) + flv tag header size (11 bytes)
fillBuffer(15);
// previous tag's size
int previousTagSize = in.getInt();
// start of the flv tag
byte dataType = in.get();
if (log.i... | java | private ITag readTagHeader() throws UnsupportedDataTypeException {
// previous tag size (4 bytes) + flv tag header size (11 bytes)
fillBuffer(15);
// previous tag's size
int previousTagSize = in.getInt();
// start of the flv tag
byte dataType = in.get();
if (log.i... | [
"private",
"ITag",
"readTagHeader",
"(",
")",
"throws",
"UnsupportedDataTypeException",
"{",
"// previous tag size (4 bytes) + flv tag header size (11 bytes)",
"fillBuffer",
"(",
"15",
")",
";",
"// previous tag's size",
"int",
"previousTagSize",
"=",
"in",
".",
"getInt",
"... | Read only header part of a tag.
@return Tag header
@throws UnsupportedDataTypeException | [
"Read",
"only",
"header",
"part",
"of",
"a",
"tag",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L888-L924 | train |
Red5/red5-io | src/main/java/org/red5/io/flv/impl/FLVReader.java | FLVReader.getDuration | public static int getDuration(File flvFile) {
int duration = 0;
RandomAccessFile flv = null;
try {
flv = new RandomAccessFile(flvFile, "r");
long flvLength = Math.max(flvFile.length(), flv.length());
log.debug("File length: {}", flvLength);
if (flv... | java | public static int getDuration(File flvFile) {
int duration = 0;
RandomAccessFile flv = null;
try {
flv = new RandomAccessFile(flvFile, "r");
long flvLength = Math.max(flvFile.length(), flv.length());
log.debug("File length: {}", flvLength);
if (flv... | [
"public",
"static",
"int",
"getDuration",
"(",
"File",
"flvFile",
")",
"{",
"int",
"duration",
"=",
"0",
";",
"RandomAccessFile",
"flv",
"=",
"null",
";",
"try",
"{",
"flv",
"=",
"new",
"RandomAccessFile",
"(",
"flvFile",
",",
"\"r\"",
")",
";",
"long",
... | Returns the last tag's timestamp as the files duration.
@param flvFile
FLV file
@return duration | [
"Returns",
"the",
"last",
"tag",
"s",
"timestamp",
"as",
"the",
"files",
"duration",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L933-L1000 | train |
Red5/red5-io | src/main/java/org/red5/io/mp4/MP4Frame.java | MP4Frame.compareTo | @Override
public int compareTo(MP4Frame that) {
int ret = 0;
if (this.time > that.getTime()) {
ret = 1;
} else if (this.time < that.getTime()) {
ret = -1;
} else if (Double.doubleToLongBits(time) == Double.doubleToLongBits(that.getTime()) && this.offset... | java | @Override
public int compareTo(MP4Frame that) {
int ret = 0;
if (this.time > that.getTime()) {
ret = 1;
} else if (this.time < that.getTime()) {
ret = -1;
} else if (Double.doubleToLongBits(time) == Double.doubleToLongBits(that.getTime()) && this.offset... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"MP4Frame",
"that",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"if",
"(",
"this",
".",
"time",
">",
"that",
".",
"getTime",
"(",
")",
")",
"{",
"ret",
"=",
"1",
";",
"}",
"else",
"if",
"(",
"this"... | The frames are expected to be sorted by their timestamp | [
"The",
"frames",
"are",
"expected",
"to",
"be",
"sorted",
"by",
"their",
"timestamp"
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/mp4/MP4Frame.java#L166-L179 | train |
Red5/red5-io | src/main/java/org/red5/io/amf3/Output.java | Output.writePrimitiveByteArray | private void writePrimitiveByteArray(byte[] bytes) {
writeAMF3();
this.buf.put(AMF3.TYPE_BYTEARRAY);
if (hasReference(bytes)) {
putInteger(getReferenceId(bytes) << 1);
return;
}
storeReference(bytes);
int length = bytes.length;
... | java | private void writePrimitiveByteArray(byte[] bytes) {
writeAMF3();
this.buf.put(AMF3.TYPE_BYTEARRAY);
if (hasReference(bytes)) {
putInteger(getReferenceId(bytes) << 1);
return;
}
storeReference(bytes);
int length = bytes.length;
... | [
"private",
"void",
"writePrimitiveByteArray",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"writeAMF3",
"(",
")",
";",
"this",
".",
"buf",
".",
"put",
"(",
"AMF3",
".",
"TYPE_BYTEARRAY",
")",
";",
"if",
"(",
"hasReference",
"(",
"bytes",
")",
")",
"{",
... | Use the specialized BYTEARRAY type. | [
"Use",
"the",
"specialized",
"BYTEARRAY",
"type",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf3/Output.java#L284-L298 | train |
Red5/red5-io | src/main/java/org/red5/io/amf3/Output.java | Output.writeVectorInt | @Override
public void writeVectorInt(Vector<Integer> vector) {
log.debug("writeVectorInt: {}", vector);
writeAMF3();
buf.put(AMF3.TYPE_VECTOR_INT);
if (hasReference(vector)) {
putInteger(getReferenceId(vector) << 1);
return;
}
storeRef... | java | @Override
public void writeVectorInt(Vector<Integer> vector) {
log.debug("writeVectorInt: {}", vector);
writeAMF3();
buf.put(AMF3.TYPE_VECTOR_INT);
if (hasReference(vector)) {
putInteger(getReferenceId(vector) << 1);
return;
}
storeRef... | [
"@",
"Override",
"public",
"void",
"writeVectorInt",
"(",
"Vector",
"<",
"Integer",
">",
"vector",
")",
"{",
"log",
".",
"debug",
"(",
"\"writeVectorInt: {}\"",
",",
"vector",
")",
";",
"writeAMF3",
"(",
")",
";",
"buf",
".",
"put",
"(",
"AMF3",
".",
"... | Write a Vector<int>.
@param vector
vector | [
"Write",
"a",
"Vector<",
";",
"int>",
";",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf3/Output.java#L589-L613 | train |
Red5/red5-io | src/main/java/org/red5/io/amf3/Output.java | Output.writeVectorUInt | @Override
public void writeVectorUInt(Vector<Long> vector) {
log.debug("writeVectorUInt: {}", vector);
writeAMF3();
buf.put(AMF3.TYPE_VECTOR_UINT);
if (hasReference(vector)) {
putInteger(getReferenceId(vector) << 1);
return;
}
storeRef... | java | @Override
public void writeVectorUInt(Vector<Long> vector) {
log.debug("writeVectorUInt: {}", vector);
writeAMF3();
buf.put(AMF3.TYPE_VECTOR_UINT);
if (hasReference(vector)) {
putInteger(getReferenceId(vector) << 1);
return;
}
storeRef... | [
"@",
"Override",
"public",
"void",
"writeVectorUInt",
"(",
"Vector",
"<",
"Long",
">",
"vector",
")",
"{",
"log",
".",
"debug",
"(",
"\"writeVectorUInt: {}\"",
",",
"vector",
")",
";",
"writeAMF3",
"(",
")",
";",
"buf",
".",
"put",
"(",
"AMF3",
".",
"T... | Write a Vector<uint>.
@param vector
vector | [
"Write",
"a",
"Vector<",
";",
"uint>",
";",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf3/Output.java#L621-L639 | train |
Red5/red5-io | src/main/java/org/red5/io/amf3/Output.java | Output.writeVectorNumber | @Override
public void writeVectorNumber(Vector<Double> vector) {
log.debug("writeVectorNumber: {}", vector);
buf.put(AMF3.TYPE_VECTOR_NUMBER);
if (hasReference(vector)) {
putInteger(getReferenceId(vector) << 1);
return;
}
storeReference(vector)... | java | @Override
public void writeVectorNumber(Vector<Double> vector) {
log.debug("writeVectorNumber: {}", vector);
buf.put(AMF3.TYPE_VECTOR_NUMBER);
if (hasReference(vector)) {
putInteger(getReferenceId(vector) << 1);
return;
}
storeReference(vector)... | [
"@",
"Override",
"public",
"void",
"writeVectorNumber",
"(",
"Vector",
"<",
"Double",
">",
"vector",
")",
"{",
"log",
".",
"debug",
"(",
"\"writeVectorNumber: {}\"",
",",
"vector",
")",
";",
"buf",
".",
"put",
"(",
"AMF3",
".",
"TYPE_VECTOR_NUMBER",
")",
"... | Write a Vector<Number>.
@param vector
vector | [
"Write",
"a",
"Vector<",
";",
"Number>",
";",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf3/Output.java#L647-L662 | train |
Red5/red5-io | src/main/java/org/red5/io/amf3/Output.java | Output.writeVectorObject | @Override
public void writeVectorObject(Vector<Object> vector) {
log.debug("writeVectorObject: {}", vector);
buf.put(AMF3.TYPE_VECTOR_OBJECT);
if (hasReference(vector)) {
putInteger(getReferenceId(vector) << 1);
return;
}
storeReference(vector)... | java | @Override
public void writeVectorObject(Vector<Object> vector) {
log.debug("writeVectorObject: {}", vector);
buf.put(AMF3.TYPE_VECTOR_OBJECT);
if (hasReference(vector)) {
putInteger(getReferenceId(vector) << 1);
return;
}
storeReference(vector)... | [
"@",
"Override",
"public",
"void",
"writeVectorObject",
"(",
"Vector",
"<",
"Object",
">",
"vector",
")",
"{",
"log",
".",
"debug",
"(",
"\"writeVectorObject: {}\"",
",",
"vector",
")",
";",
"buf",
".",
"put",
"(",
"AMF3",
".",
"TYPE_VECTOR_OBJECT",
")",
"... | Write a Vector<Object>.
@param vector
vector | [
"Write",
"a",
"Vector<",
";",
"Object>",
";",
"."
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf3/Output.java#L670-L685 | train |
Red5/red5-io | src/main/java/org/red5/io/webm/WebmReader.java | WebmReader.close | @Override
public void close() throws IOException {
if (fis != null) {
try {
fis.close();
fis = null;
} catch (Throwable th) {
//no-op
}
}
} | java | @Override
public void close() throws IOException {
if (fis != null) {
try {
fis.close();
fis = null;
} catch (Throwable th) {
//no-op
}
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fis",
"!=",
"null",
")",
"{",
"try",
"{",
"fis",
".",
"close",
"(",
")",
";",
"fis",
"=",
"null",
";",
"}",
"catch",
"(",
"Throwable",
"th",
")",
"{",... | Will close all opened resources | [
"Will",
"close",
"all",
"opened",
"resources"
] | 9bbbc506423c5a8f18169d46d400df56c0072a33 | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/webm/WebmReader.java#L142-L152 | train |
vincentbrison/dualcache | dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/Logger.java | Logger.logInfo | void logInfo(String tag, String msg) {
log(Log.INFO, tag, msg);
} | java | void logInfo(String tag, String msg) {
log(Log.INFO, tag, msg);
} | [
"void",
"logInfo",
"(",
"String",
"tag",
",",
"String",
"msg",
")",
"{",
"log",
"(",
"Log",
".",
"INFO",
",",
"tag",
",",
"msg",
")",
";",
"}"
] | Log with level info.
@param tag is the tag to used.
@param msg is the msg to log. | [
"Log",
"with",
"level",
"info",
"."
] | 76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f | https://github.com/vincentbrison/dualcache/blob/76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f/dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/Logger.java#L44-L46 | train |
vincentbrison/dualcache | dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java | DualCache.put | public void put(String key, T object) {
// Synchronize put on each entry. Gives concurrent editions on different entries, and atomic
// modification on the same entry.
if (ramMode.equals(DualCacheRamMode.ENABLE_WITH_REFERENCE)) {
ramCacheLru.put(key, object);
}
Strin... | java | public void put(String key, T object) {
// Synchronize put on each entry. Gives concurrent editions on different entries, and atomic
// modification on the same entry.
if (ramMode.equals(DualCacheRamMode.ENABLE_WITH_REFERENCE)) {
ramCacheLru.put(key, object);
}
Strin... | [
"public",
"void",
"put",
"(",
"String",
"key",
",",
"T",
"object",
")",
"{",
"// Synchronize put on each entry. Gives concurrent editions on different entries, and atomic",
"// modification on the same entry.",
"if",
"(",
"ramMode",
".",
"equals",
"(",
"DualCacheRamMode",
"."... | Put an object in cache.
@param key is the key of the object.
@param object is the object to put in cache. | [
"Put",
"an",
"object",
"in",
"cache",
"."
] | 76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f | https://github.com/vincentbrison/dualcache/blob/76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f/dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java#L144-L174 | train |
vincentbrison/dualcache | dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java | DualCache.get | public T get(String key) {
Object ramResult = null;
String diskResult = null;
DiskLruCache.Snapshot snapshotObject = null;
// Try to get the object from RAM.
boolean isRamSerialized = ramMode.equals(DualCacheRamMode.ENABLE_WITH_SPECIFIC_SERIALIZER);
boolean isRamReferen... | java | public T get(String key) {
Object ramResult = null;
String diskResult = null;
DiskLruCache.Snapshot snapshotObject = null;
// Try to get the object from RAM.
boolean isRamSerialized = ramMode.equals(DualCacheRamMode.ENABLE_WITH_SPECIFIC_SERIALIZER);
boolean isRamReferen... | [
"public",
"T",
"get",
"(",
"String",
"key",
")",
"{",
"Object",
"ramResult",
"=",
"null",
";",
"String",
"diskResult",
"=",
"null",
";",
"DiskLruCache",
".",
"Snapshot",
"snapshotObject",
"=",
"null",
";",
"// Try to get the object from RAM.",
"boolean",
"isRamS... | Return the object of the corresponding key from the cache. In no object is available,
return null.
@param key is the key of the object.
@return the object of the corresponding key from the cache. In no object is available,
return null. | [
"Return",
"the",
"object",
"of",
"the",
"corresponding",
"key",
"from",
"the",
"cache",
".",
"In",
"no",
"object",
"is",
"available",
"return",
"null",
"."
] | 76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f | https://github.com/vincentbrison/dualcache/blob/76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f/dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java#L184-L253 | train |
vincentbrison/dualcache | dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java | DualCache.delete | public void delete(String key) {
if (!ramMode.equals(DualCacheRamMode.DISABLE)) {
ramCacheLru.remove(key);
}
if (!diskMode.equals(DualCacheDiskMode.DISABLE)) {
try {
dualCacheLock.lockDiskEntryWrite(key);
diskLruCache.remove(key);
... | java | public void delete(String key) {
if (!ramMode.equals(DualCacheRamMode.DISABLE)) {
ramCacheLru.remove(key);
}
if (!diskMode.equals(DualCacheDiskMode.DISABLE)) {
try {
dualCacheLock.lockDiskEntryWrite(key);
diskLruCache.remove(key);
... | [
"public",
"void",
"delete",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"!",
"ramMode",
".",
"equals",
"(",
"DualCacheRamMode",
".",
"DISABLE",
")",
")",
"{",
"ramCacheLru",
".",
"remove",
"(",
"key",
")",
";",
"}",
"if",
"(",
"!",
"diskMode",
".",
... | Delete the corresponding object in cache.
@param key is the key of the object. | [
"Delete",
"the",
"corresponding",
"object",
"in",
"cache",
"."
] | 76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f | https://github.com/vincentbrison/dualcache/blob/76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f/dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java#L260-L274 | train |
vincentbrison/dualcache | dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java | DualCache.invalidateDisk | public void invalidateDisk() {
if (!diskMode.equals(DualCacheDiskMode.DISABLE)) {
try {
dualCacheLock.lockFullDiskWrite();
diskLruCache.delete();
openDiskLruCache(diskCacheFolder);
} catch (IOException e) {
logger.logError(e... | java | public void invalidateDisk() {
if (!diskMode.equals(DualCacheDiskMode.DISABLE)) {
try {
dualCacheLock.lockFullDiskWrite();
diskLruCache.delete();
openDiskLruCache(diskCacheFolder);
} catch (IOException e) {
logger.logError(e... | [
"public",
"void",
"invalidateDisk",
"(",
")",
"{",
"if",
"(",
"!",
"diskMode",
".",
"equals",
"(",
"DualCacheDiskMode",
".",
"DISABLE",
")",
")",
"{",
"try",
"{",
"dualCacheLock",
".",
"lockFullDiskWrite",
"(",
")",
";",
"diskLruCache",
".",
"delete",
"(",... | Remove all objects from Disk. | [
"Remove",
"all",
"objects",
"from",
"Disk",
"."
] | 76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f | https://github.com/vincentbrison/dualcache/blob/76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f/dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java#L296-L308 | train |
vincentbrison/dualcache | dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java | DualCache.contains | public boolean contains(String key) {
if (!ramMode.equals(DualCacheRamMode.DISABLE) && ramCacheLru.snapshot().containsKey(key)) {
return true;
}
try {
dualCacheLock.lockDiskEntryWrite(key);
if (!diskMode.equals(DualCacheDiskMode.DISABLE) && diskLruCache.get(ke... | java | public boolean contains(String key) {
if (!ramMode.equals(DualCacheRamMode.DISABLE) && ramCacheLru.snapshot().containsKey(key)) {
return true;
}
try {
dualCacheLock.lockDiskEntryWrite(key);
if (!diskMode.equals(DualCacheDiskMode.DISABLE) && diskLruCache.get(ke... | [
"public",
"boolean",
"contains",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"!",
"ramMode",
".",
"equals",
"(",
"DualCacheRamMode",
".",
"DISABLE",
")",
"&&",
"ramCacheLru",
".",
"snapshot",
"(",
")",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"ret... | Test if an object is present in cache.
@param key is the key of the object.
@return true if the object is present in cache, false otherwise. | [
"Test",
"if",
"an",
"object",
"is",
"present",
"in",
"cache",
"."
] | 76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f | https://github.com/vincentbrison/dualcache/blob/76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f/dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/DualCache.java#L315-L330 | train |
vincentbrison/dualcache | dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/Builder.java | Builder.build | public DualCache<T> build() {
if (ramMode == null) {
throw new IllegalStateException("No ram mode set");
}
if (diskMode == null) {
throw new IllegalStateException("No disk mode set");
}
DualCache<T> cache = new DualCache<>(
appVersion,
... | java | public DualCache<T> build() {
if (ramMode == null) {
throw new IllegalStateException("No ram mode set");
}
if (diskMode == null) {
throw new IllegalStateException("No disk mode set");
}
DualCache<T> cache = new DualCache<>(
appVersion,
... | [
"public",
"DualCache",
"<",
"T",
">",
"build",
"(",
")",
"{",
"if",
"(",
"ramMode",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"No ram mode set\"",
")",
";",
"}",
"if",
"(",
"diskMode",
"==",
"null",
")",
"{",
"throw",
"new... | Builder the cache. Exception will be thrown if it can not be created.
@return the cache instance. | [
"Builder",
"the",
"cache",
".",
"Exception",
"will",
"be",
"thrown",
"if",
"it",
"can",
"not",
"be",
"created",
"."
] | 76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f | https://github.com/vincentbrison/dualcache/blob/76ec6e08d5b8b17aca97d01e5fb5f36cb4beff5f/dualcache-library/src/main/java/com/vincentbrison/openlibraries/android/dualcache/Builder.java#L62-L94 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/TarInputStream.java | TarInputStream.read | @Override
public int read() throws IOException {
byte[] buf = new byte[1];
int res = this.read(buf, 0, 1);
if (res != -1) {
return 0xFF & buf[0];
}
return res;
} | java | @Override
public int read() throws IOException {
byte[] buf = new byte[1];
int res = this.read(buf, 0, 1);
if (res != -1) {
return 0xFF & buf[0];
}
return res;
} | [
"@",
"Override",
"public",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"1",
"]",
";",
"int",
"res",
"=",
"this",
".",
"read",
"(",
"buf",
",",
"0",
",",
"1",
")",
";",
"if",
"(",
"r... | Read a byte
@see java.io.FilterInputStream#read() | [
"Read",
"a",
"byte"
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/TarInputStream.java#L69-L80 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/TarInputStream.java | TarInputStream.read | @Override
public int read(byte[] b, int off, int len) throws IOException {
if (currentEntry != null) {
if (currentFileSize == currentEntry.getSize()) {
return -1;
} else if ((currentEntry.getSize() - currentFileSize) < len) {
len = (int) (currentEntry.getSize() - currentFileSize);
}
}
... | java | @Override
public int read(byte[] b, int off, int len) throws IOException {
if (currentEntry != null) {
if (currentFileSize == currentEntry.getSize()) {
return -1;
} else if ((currentEntry.getSize() - currentFileSize) < len) {
len = (int) (currentEntry.getSize() - currentFileSize);
}
}
... | [
"@",
"Override",
"public",
"int",
"read",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentEntry",
"!=",
"null",
")",
"{",
"if",
"(",
"currentFileSize",
"==",
"currentEntry",
".",
... | Checks if the bytes being read exceed the entry size and adjusts the byte
array length. Updates the byte counters
@see java.io.FilterInputStream#read(byte[], int, int) | [
"Checks",
"if",
"the",
"bytes",
"being",
"read",
"exceed",
"the",
"entry",
"size",
"and",
"adjusts",
"the",
"byte",
"array",
"length",
".",
"Updates",
"the",
"byte",
"counters"
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/TarInputStream.java#L89-L110 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/TarInputStream.java | TarInputStream.getNextEntry | public TarEntry getNextEntry() throws IOException {
closeCurrentEntry();
byte[] header = new byte[TarConstants.HEADER_BLOCK];
byte[] theader = new byte[TarConstants.HEADER_BLOCK];
int tr = 0;
// Read full header
while (tr < TarConstants.HEADER_BLOCK) {
int res = read(theader, 0, TarConstants.H... | java | public TarEntry getNextEntry() throws IOException {
closeCurrentEntry();
byte[] header = new byte[TarConstants.HEADER_BLOCK];
byte[] theader = new byte[TarConstants.HEADER_BLOCK];
int tr = 0;
// Read full header
while (tr < TarConstants.HEADER_BLOCK) {
int res = read(theader, 0, TarConstants.H... | [
"public",
"TarEntry",
"getNextEntry",
"(",
")",
"throws",
"IOException",
"{",
"closeCurrentEntry",
"(",
")",
";",
"byte",
"[",
"]",
"header",
"=",
"new",
"byte",
"[",
"TarConstants",
".",
"HEADER_BLOCK",
"]",
";",
"byte",
"[",
"]",
"theader",
"=",
"new",
... | Returns the next entry in the tar file
@return TarEntry
@throws IOException | [
"Returns",
"the",
"next",
"entry",
"in",
"the",
"tar",
"file"
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/TarInputStream.java#L118-L151 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/TarInputStream.java | TarInputStream.skipPad | protected void skipPad() throws IOException {
if (bytesRead > 0) {
int extra = (int) (bytesRead % TarConstants.DATA_BLOCK);
if (extra > 0) {
long bs = 0;
while (bs < TarConstants.DATA_BLOCK - extra) {
long res = skip(TarConstants.DATA_BLOCK - extra - bs);
bs += res;
}
}
}
... | java | protected void skipPad() throws IOException {
if (bytesRead > 0) {
int extra = (int) (bytesRead % TarConstants.DATA_BLOCK);
if (extra > 0) {
long bs = 0;
while (bs < TarConstants.DATA_BLOCK - extra) {
long res = skip(TarConstants.DATA_BLOCK - extra - bs);
bs += res;
}
}
}
... | [
"protected",
"void",
"skipPad",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bytesRead",
">",
"0",
")",
"{",
"int",
"extra",
"=",
"(",
"int",
")",
"(",
"bytesRead",
"%",
"TarConstants",
".",
"DATA_BLOCK",
")",
";",
"if",
"(",
"extra",
">",
"0"... | Skips the pad at the end of each tar entry file content
@throws IOException | [
"Skips",
"the",
"pad",
"at",
"the",
"end",
"of",
"each",
"tar",
"entry",
"file",
"content"
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/TarInputStream.java#L194-L206 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/Octal.java | Octal.getLongOctalBytes | public static int getLongOctalBytes(long value, byte[] buf, int offset, int length) {
byte[] temp = new byte[length + 1];
getOctalBytes( value, temp, 0, length + 1 );
System.arraycopy( temp, 0, buf, offset, length );
return offset + length;
} | java | public static int getLongOctalBytes(long value, byte[] buf, int offset, int length) {
byte[] temp = new byte[length + 1];
getOctalBytes( value, temp, 0, length + 1 );
System.arraycopy( temp, 0, buf, offset, length );
return offset + length;
} | [
"public",
"static",
"int",
"getLongOctalBytes",
"(",
"long",
"value",
",",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"byte",
"[",
"]",
"temp",
"=",
"new",
"byte",
"[",
"length",
"+",
"1",
"]",
";",
"getOctalBytes"... | Write an octal long integer to a header buffer.
@param value
The value to write.
@param buf
The header buffer from which to parse.
@param offset
The offset into the buffer from which to parse.
@param length
The number of header bytes to parse.
@return The long value of the octal bytes. | [
"Write",
"an",
"octal",
"long",
"integer",
"to",
"a",
"header",
"buffer",
"."
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/Octal.java#L137-L142 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/TarOutputStream.java | TarOutputStream.write | @Override
public void write(int b) throws IOException {
out.write( b );
bytesWritten += 1;
if (currentEntry != null) {
currentFileSize += 1;
}
} | java | @Override
public void write(int b) throws IOException {
out.write( b );
bytesWritten += 1;
if (currentEntry != null) {
currentFileSize += 1;
}
} | [
"@",
"Override",
"public",
"void",
"write",
"(",
"int",
"b",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"b",
")",
";",
"bytesWritten",
"+=",
"1",
";",
"if",
"(",
"currentEntry",
"!=",
"null",
")",
"{",
"currentFileSize",
"+=",
"1",
... | Writes a byte to the stream and updates byte counters
@see java.io.FilterOutputStream#write(int) | [
"Writes",
"a",
"byte",
"to",
"the",
"stream",
"and",
"updates",
"byte",
"counters"
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/TarOutputStream.java#L79-L87 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/TarOutputStream.java | TarOutputStream.write | @Override
public void write(byte[] b, int off, int len) throws IOException {
if (currentEntry != null && !currentEntry.isDirectory()) {
if (currentEntry.getSize() < currentFileSize + len) {
throw new IOException( "The current entry[" + currentEntry.getName() + "] size["
... | java | @Override
public void write(byte[] b, int off, int len) throws IOException {
if (currentEntry != null && !currentEntry.isDirectory()) {
if (currentEntry.getSize() < currentFileSize + len) {
throw new IOException( "The current entry[" + currentEntry.getName() + "] size["
... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentEntry",
"!=",
"null",
"&&",
"!",
"currentEntry",
".",
"isDirectory",
"(",
")",
")",
"{... | Checks if the bytes being written exceed the current entry size.
@see java.io.FilterOutputStream#write(byte[], int, int) | [
"Checks",
"if",
"the",
"bytes",
"being",
"written",
"exceed",
"the",
"current",
"entry",
"size",
"."
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/TarOutputStream.java#L94-L111 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/TarOutputStream.java | TarOutputStream.putNextEntry | public void putNextEntry(TarEntry entry) throws IOException {
closeCurrentEntry();
byte[] header = new byte[TarConstants.HEADER_BLOCK];
entry.writeEntryHeader( header );
write( header );
currentEntry = entry;
} | java | public void putNextEntry(TarEntry entry) throws IOException {
closeCurrentEntry();
byte[] header = new byte[TarConstants.HEADER_BLOCK];
entry.writeEntryHeader( header );
write( header );
currentEntry = entry;
} | [
"public",
"void",
"putNextEntry",
"(",
"TarEntry",
"entry",
")",
"throws",
"IOException",
"{",
"closeCurrentEntry",
"(",
")",
";",
"byte",
"[",
"]",
"header",
"=",
"new",
"byte",
"[",
"TarConstants",
".",
"HEADER_BLOCK",
"]",
";",
"entry",
".",
"writeEntryHe... | Writes the next tar entry header on the stream
@throws IOException | [
"Writes",
"the",
"next",
"tar",
"entry",
"header",
"on",
"the",
"stream"
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/TarOutputStream.java#L118-L127 | train |
kamranzafar/jtar | src/main/java/org/kamranzafar/jtar/TarOutputStream.java | TarOutputStream.pad | protected void pad() throws IOException {
if (bytesWritten > 0) {
int extra = (int) ( bytesWritten % TarConstants.DATA_BLOCK );
if (extra > 0) {
write( new byte[TarConstants.DATA_BLOCK - extra] );
}
}
} | java | protected void pad() throws IOException {
if (bytesWritten > 0) {
int extra = (int) ( bytesWritten % TarConstants.DATA_BLOCK );
if (extra > 0) {
write( new byte[TarConstants.DATA_BLOCK - extra] );
}
}
} | [
"protected",
"void",
"pad",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bytesWritten",
">",
"0",
")",
"{",
"int",
"extra",
"=",
"(",
"int",
")",
"(",
"bytesWritten",
"%",
"TarConstants",
".",
"DATA_BLOCK",
")",
";",
"if",
"(",
"extra",
">",
"... | Pads the last content block
@throws IOException | [
"Pads",
"the",
"last",
"content",
"block"
] | aace0a3c8a6478fd1bac95865c27535e658afb73 | https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/TarOutputStream.java#L153-L161 | train |
Cleveroad/BubbleAnimationLayout | library/src/main/java/com/cleveroad/bubbleanimation/BubbleAnimationLayout.java | BubbleAnimationLayout.setIndicatorWidth | @SuppressWarnings("unused")
public void setIndicatorWidth(int indicatorWidth) {
mIndicatorWidth = indicatorWidth;
mIndicatorRectangle.set(getPaddingLeft(), getPaddingTop(), getPaddingLeft() + mIndicatorWidth, getMeasuredHeight() - getPaddingBottom());
requestLayout();
} | java | @SuppressWarnings("unused")
public void setIndicatorWidth(int indicatorWidth) {
mIndicatorWidth = indicatorWidth;
mIndicatorRectangle.set(getPaddingLeft(), getPaddingTop(), getPaddingLeft() + mIndicatorWidth, getMeasuredHeight() - getPaddingBottom());
requestLayout();
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"void",
"setIndicatorWidth",
"(",
"int",
"indicatorWidth",
")",
"{",
"mIndicatorWidth",
"=",
"indicatorWidth",
";",
"mIndicatorRectangle",
".",
"set",
"(",
"getPaddingLeft",
"(",
")",
",",
"getPaddingTop",
... | Set indicator width
@param indicatorWidth indicator width in px | [
"Set",
"indicator",
"width"
] | 6b2c3668e8c2bf415066474b46df7b87877e494b | https://github.com/Cleveroad/BubbleAnimationLayout/blob/6b2c3668e8c2bf415066474b46df7b87877e494b/library/src/main/java/com/cleveroad/bubbleanimation/BubbleAnimationLayout.java#L375-L380 | train |
Cleveroad/BubbleAnimationLayout | library/src/main/java/com/cleveroad/bubbleanimation/BubbleAnimationLayout.java | BubbleAnimationLayout.resetView | @SuppressWarnings("unused")
public void resetView() {
if (mForwardAnimatorSet != null && mForwardAnimatorSet.isRunning()) {
mForwardAnimatorSet.end();
}
if (mReverseAnimatorSet != null && mReverseAnimatorSet.isRunning()) {
mReverseAnimatorSet.end();
}
... | java | @SuppressWarnings("unused")
public void resetView() {
if (mForwardAnimatorSet != null && mForwardAnimatorSet.isRunning()) {
mForwardAnimatorSet.end();
}
if (mReverseAnimatorSet != null && mReverseAnimatorSet.isRunning()) {
mReverseAnimatorSet.end();
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"void",
"resetView",
"(",
")",
"{",
"if",
"(",
"mForwardAnimatorSet",
"!=",
"null",
"&&",
"mForwardAnimatorSet",
".",
"isRunning",
"(",
")",
")",
"{",
"mForwardAnimatorSet",
".",
"end",
"(",
")",
";"... | Reset view to initial state | [
"Reset",
"view",
"to",
"initial",
"state"
] | 6b2c3668e8c2bf415066474b46df7b87877e494b | https://github.com/Cleveroad/BubbleAnimationLayout/blob/6b2c3668e8c2bf415066474b46df7b87877e494b/library/src/main/java/com/cleveroad/bubbleanimation/BubbleAnimationLayout.java#L394-L414 | train |
Cleveroad/BubbleAnimationLayout | library/src/main/java/com/cleveroad/bubbleanimation/BubbleAnimationLayout.java | BubbleAnimationLayout.showContextView | @SuppressWarnings("unused")
public void showContextView() {
if ((mForwardAnimatorSet != null && mForwardAnimatorSet.isRunning())
|| (mAnimationView != null && mAnimationView.isPlaying())
|| (mReverseAnimatorSet != null && mReverseAnimatorSet.isRunning())) {
return... | java | @SuppressWarnings("unused")
public void showContextView() {
if ((mForwardAnimatorSet != null && mForwardAnimatorSet.isRunning())
|| (mAnimationView != null && mAnimationView.isPlaying())
|| (mReverseAnimatorSet != null && mReverseAnimatorSet.isRunning())) {
return... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"void",
"showContextView",
"(",
")",
"{",
"if",
"(",
"(",
"mForwardAnimatorSet",
"!=",
"null",
"&&",
"mForwardAnimatorSet",
".",
"isRunning",
"(",
")",
")",
"||",
"(",
"mAnimationView",
"!=",
"null",
... | Show context view | [
"Show",
"context",
"view"
] | 6b2c3668e8c2bf415066474b46df7b87877e494b | https://github.com/Cleveroad/BubbleAnimationLayout/blob/6b2c3668e8c2bf415066474b46df7b87877e494b/library/src/main/java/com/cleveroad/bubbleanimation/BubbleAnimationLayout.java#L487-L503 | train |
Cleveroad/BubbleAnimationLayout | library/src/main/java/com/cleveroad/bubbleanimation/BubbleAnimationLayout.java | BubbleAnimationLayout.showBaseView | @SuppressWarnings("unused")
public void showBaseView() {
if ((mForwardAnimatorSet != null && mForwardAnimatorSet.isRunning())
|| (mAnimationView != null && mAnimationView.isPlaying())
|| (mReverseAnimatorSet != null && mReverseAnimatorSet.isRunning())) {
return;
... | java | @SuppressWarnings("unused")
public void showBaseView() {
if ((mForwardAnimatorSet != null && mForwardAnimatorSet.isRunning())
|| (mAnimationView != null && mAnimationView.isPlaying())
|| (mReverseAnimatorSet != null && mReverseAnimatorSet.isRunning())) {
return;
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"void",
"showBaseView",
"(",
")",
"{",
"if",
"(",
"(",
"mForwardAnimatorSet",
"!=",
"null",
"&&",
"mForwardAnimatorSet",
".",
"isRunning",
"(",
")",
")",
"||",
"(",
"mAnimationView",
"!=",
"null",
"&... | Show base view | [
"Show",
"base",
"view"
] | 6b2c3668e8c2bf415066474b46df7b87877e494b | https://github.com/Cleveroad/BubbleAnimationLayout/blob/6b2c3668e8c2bf415066474b46df7b87877e494b/library/src/main/java/com/cleveroad/bubbleanimation/BubbleAnimationLayout.java#L508-L524 | train |
Cleveroad/BubbleAnimationLayout | library/src/main/java/com/cleveroad/bubbleanimation/DrawableUtils.java | DrawableUtils.normalize | public static float normalize(float val, float minVal, float maxVal) {
if (val < minVal || val > maxVal)
throw new IllegalArgumentException("Value must be between min and max values. [val, min, max]: [" + val + "," + minVal + ", " + maxVal + "]");
return (val - minVal) / (maxVal - minVal);
... | java | public static float normalize(float val, float minVal, float maxVal) {
if (val < minVal || val > maxVal)
throw new IllegalArgumentException("Value must be between min and max values. [val, min, max]: [" + val + "," + minVal + ", " + maxVal + "]");
return (val - minVal) / (maxVal - minVal);
... | [
"public",
"static",
"float",
"normalize",
"(",
"float",
"val",
",",
"float",
"minVal",
",",
"float",
"maxVal",
")",
"{",
"if",
"(",
"val",
"<",
"minVal",
"||",
"val",
">",
"maxVal",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Value must be betwe... | Normalize value between minimum and maximum.
@param val value
@param minVal minimum value
@param maxVal maximum value
@return normalized value in range <code>0..1</code>
@throws IllegalArgumentException if value is out of range <code>[minVal, maxVal]</code> | [
"Normalize",
"value",
"between",
"minimum",
"and",
"maximum",
"."
] | 6b2c3668e8c2bf415066474b46df7b87877e494b | https://github.com/Cleveroad/BubbleAnimationLayout/blob/6b2c3668e8c2bf415066474b46df7b87877e494b/library/src/main/java/com/cleveroad/bubbleanimation/DrawableUtils.java#L20-L24 | train |
Cleveroad/BubbleAnimationLayout | library/src/main/java/com/cleveroad/bubbleanimation/DrawableUtils.java | DrawableUtils.enlarge | public static float enlarge(float startValue, float endValue, float time) {
if (startValue > endValue)
throw new IllegalArgumentException("Start size can't be larger than end size.");
return startValue + (endValue - startValue) * time;
} | java | public static float enlarge(float startValue, float endValue, float time) {
if (startValue > endValue)
throw new IllegalArgumentException("Start size can't be larger than end size.");
return startValue + (endValue - startValue) * time;
} | [
"public",
"static",
"float",
"enlarge",
"(",
"float",
"startValue",
",",
"float",
"endValue",
",",
"float",
"time",
")",
"{",
"if",
"(",
"startValue",
">",
"endValue",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Start size can't be larger than end size.... | Enlarge value from startValue to endValue
@param startValue start size
@param endValue end size
@param time time of animation
@return new size value | [
"Enlarge",
"value",
"from",
"startValue",
"to",
"endValue"
] | 6b2c3668e8c2bf415066474b46df7b87877e494b | https://github.com/Cleveroad/BubbleAnimationLayout/blob/6b2c3668e8c2bf415066474b46df7b87877e494b/library/src/main/java/com/cleveroad/bubbleanimation/DrawableUtils.java#L51-L55 | train |
Cleveroad/BubbleAnimationLayout | library/src/main/java/com/cleveroad/bubbleanimation/DrawableUtils.java | DrawableUtils.reduce | public static float reduce(float startValue, float endValue, float time) {
if (startValue < endValue)
throw new IllegalArgumentException("End size can't be larger than start size.");
return endValue + (startValue - endValue) * (1 - time);
} | java | public static float reduce(float startValue, float endValue, float time) {
if (startValue < endValue)
throw new IllegalArgumentException("End size can't be larger than start size.");
return endValue + (startValue - endValue) * (1 - time);
} | [
"public",
"static",
"float",
"reduce",
"(",
"float",
"startValue",
",",
"float",
"endValue",
",",
"float",
"time",
")",
"{",
"if",
"(",
"startValue",
"<",
"endValue",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"End size can't be larger than start size.\... | Reduce value from startValue to endValue
@param startValue start size
@param endValue end size
@param time time of animation
@return new size value | [
"Reduce",
"value",
"from",
"startValue",
"to",
"endValue"
] | 6b2c3668e8c2bf415066474b46df7b87877e494b | https://github.com/Cleveroad/BubbleAnimationLayout/blob/6b2c3668e8c2bf415066474b46df7b87877e494b/library/src/main/java/com/cleveroad/bubbleanimation/DrawableUtils.java#L65-L69 | train |
bugsnag/bugsnag-java | bugsnag-spring/src/main/java/com/bugsnag/ScheduledTaskConfiguration.java | ScheduledTaskConfiguration.configureTasks | @Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
BugsnagScheduledTaskExceptionHandler bugsnagErrorHandler =
new BugsnagScheduledTaskExceptionHandler(bugsnag);
// Decision process for finding a TaskScheduler, in order of preference:
//
// 1... | java | @Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
BugsnagScheduledTaskExceptionHandler bugsnagErrorHandler =
new BugsnagScheduledTaskExceptionHandler(bugsnag);
// Decision process for finding a TaskScheduler, in order of preference:
//
// 1... | [
"@",
"Override",
"public",
"void",
"configureTasks",
"(",
"ScheduledTaskRegistrar",
"taskRegistrar",
")",
"{",
"BugsnagScheduledTaskExceptionHandler",
"bugsnagErrorHandler",
"=",
"new",
"BugsnagScheduledTaskExceptionHandler",
"(",
"bugsnag",
")",
";",
"// Decision process for f... | Add bugsnag error handling to a task scheduler | [
"Add",
"bugsnag",
"error",
"handling",
"to",
"a",
"task",
"scheduler"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag-spring/src/main/java/com/bugsnag/ScheduledTaskConfiguration.java#L34-L59 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java | BugsnagAppender.populateContextData | private void populateContextData(Report report, ILoggingEvent event) {
Map<String, String> propertyMap = event.getMDCPropertyMap();
if (propertyMap != null) {
// Loop through all the keys and put them in the correct tabs
for (Map.Entry<String, String> entry : propertyMap.entryS... | java | private void populateContextData(Report report, ILoggingEvent event) {
Map<String, String> propertyMap = event.getMDCPropertyMap();
if (propertyMap != null) {
// Loop through all the keys and put them in the correct tabs
for (Map.Entry<String, String> entry : propertyMap.entryS... | [
"private",
"void",
"populateContextData",
"(",
"Report",
"report",
",",
"ILoggingEvent",
"event",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"propertyMap",
"=",
"event",
".",
"getMDCPropertyMap",
"(",
")",
";",
"if",
"(",
"propertyMap",
"!=",
"null"... | Adds logging context values to the given report meta data
@param report The report being sent to Bugsnag
@param event The logging event | [
"Adds",
"logging",
"context",
"values",
"to",
"the",
"given",
"report",
"meta",
"data"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java#L146-L156 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java | BugsnagAppender.calculateSeverity | private Severity calculateSeverity(ILoggingEvent event) {
if (event.getLevel().equals(Level.ERROR)) {
return Severity.ERROR;
} else if (event.getLevel().equals(Level.WARN)) {
return Severity.WARNING;
}
return Severity.INFO;
} | java | private Severity calculateSeverity(ILoggingEvent event) {
if (event.getLevel().equals(Level.ERROR)) {
return Severity.ERROR;
} else if (event.getLevel().equals(Level.WARN)) {
return Severity.WARNING;
}
return Severity.INFO;
} | [
"private",
"Severity",
"calculateSeverity",
"(",
"ILoggingEvent",
"event",
")",
"{",
"if",
"(",
"event",
".",
"getLevel",
"(",
")",
".",
"equals",
"(",
"Level",
".",
"ERROR",
")",
")",
"{",
"return",
"Severity",
".",
"ERROR",
";",
"}",
"else",
"if",
"(... | Calculates the severity based on the logging event
@param event the event
@return The Bugsnag severity | [
"Calculates",
"the",
"severity",
"based",
"on",
"the",
"logging",
"event"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java#L163-L170 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java | BugsnagAppender.setEndpoint | public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
if (bugsnag != null) {
bugsnag.setEndpoints(endpoint, null);
}
} | java | public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
if (bugsnag != null) {
bugsnag.setEndpoints(endpoint, null);
}
} | [
"public",
"void",
"setEndpoint",
"(",
"String",
"endpoint",
")",
"{",
"this",
".",
"endpoint",
"=",
"endpoint",
";",
"if",
"(",
"bugsnag",
"!=",
"null",
")",
"{",
"bugsnag",
".",
"setEndpoints",
"(",
"endpoint",
",",
"null",
")",
";",
"}",
"}"
] | Internal use only
Should only be used via the logback.xml file
@see Bugsnag#setEndpoints(String, String) | [
"Internal",
"use",
"only",
"Should",
"only",
"be",
"used",
"via",
"the",
"logback",
".",
"xml",
"file"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java#L351-L357 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java | BugsnagAppender.split | List<String> split(String value) {
if (value == null) {
return Collections.emptyList();
}
String[] parts = value.split(",", -1);
return Arrays.asList(parts);
} | java | List<String> split(String value) {
if (value == null) {
return Collections.emptyList();
}
String[] parts = value.split(",", -1);
return Arrays.asList(parts);
} | [
"List",
"<",
"String",
">",
"split",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"String",
"[",
"]",
"parts",
"=",
"value",
".",
"split",
"(",
"\",\"",... | Splits the given string on commas
@param value The string to split
@return The list of parts | [
"Splits",
"the",
"given",
"string",
"on",
"commas"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java#L530-L536 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java | BugsnagAppender.isExcludedLogger | private boolean isExcludedLogger(String loggerName) {
for (Pattern excludedLoggerPattern : EXCLUDED_LOGGER_PATTERNS) {
if (excludedLoggerPattern.matcher(loggerName).matches()) {
return true;
}
}
return false;
} | java | private boolean isExcludedLogger(String loggerName) {
for (Pattern excludedLoggerPattern : EXCLUDED_LOGGER_PATTERNS) {
if (excludedLoggerPattern.matcher(loggerName).matches()) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isExcludedLogger",
"(",
"String",
"loggerName",
")",
"{",
"for",
"(",
"Pattern",
"excludedLoggerPattern",
":",
"EXCLUDED_LOGGER_PATTERNS",
")",
"{",
"if",
"(",
"excludedLoggerPattern",
".",
"matcher",
"(",
"loggerName",
")",
".",
"matches",
... | Whether or not a logger is excluded from generating Bugsnag reports
@param loggerName The name of the logger
@return true if the logger should be excluded | [
"Whether",
"or",
"not",
"a",
"logger",
"is",
"excluded",
"from",
"generating",
"Bugsnag",
"reports"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java#L550-L557 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/callbacks/DeviceCallback.java | DeviceCallback.getHostnameValue | public static String getHostnameValue() {
if (!hostnameInitialised) {
synchronized (LOCK) {
if (!hostnameInitialised) {
hostname = lookupHostname();
hostnameInitialised = true;
}
}
}
return hostname;
... | java | public static String getHostnameValue() {
if (!hostnameInitialised) {
synchronized (LOCK) {
if (!hostnameInitialised) {
hostname = lookupHostname();
hostnameInitialised = true;
}
}
}
return hostname;
... | [
"public",
"static",
"String",
"getHostnameValue",
"(",
")",
"{",
"if",
"(",
"!",
"hostnameInitialised",
")",
"{",
"synchronized",
"(",
"LOCK",
")",
"{",
"if",
"(",
"!",
"hostnameInitialised",
")",
"{",
"hostname",
"=",
"lookupHostname",
"(",
")",
";",
"hos... | Memoises the hostname, as lookup can be expensive | [
"Memoises",
"the",
"hostname",
"as",
"lookup",
"can",
"be",
"expensive"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/callbacks/DeviceCallback.java#L18-L28 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.getExceptions | @Expose
protected List<Exception> getExceptions() {
List<Exception> exceptions = new ArrayList<Exception>();
exceptions.add(exception);
Throwable currentThrowable = exception.getThrowable().getCause();
while (currentThrowable != null) {
exceptions.add(new Exception(confi... | java | @Expose
protected List<Exception> getExceptions() {
List<Exception> exceptions = new ArrayList<Exception>();
exceptions.add(exception);
Throwable currentThrowable = exception.getThrowable().getCause();
while (currentThrowable != null) {
exceptions.add(new Exception(confi... | [
"@",
"Expose",
"protected",
"List",
"<",
"Exception",
">",
"getExceptions",
"(",
")",
"{",
"List",
"<",
"Exception",
">",
"exceptions",
"=",
"new",
"ArrayList",
"<",
"Exception",
">",
"(",
")",
";",
"exceptions",
".",
"add",
"(",
"exception",
")",
";",
... | Get the exceptions for the report.
@return the exceptions that make up the error. | [
"Get",
"the",
"exceptions",
"for",
"the",
"report",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L67-L79 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.addToTab | public Report addToTab(String tabName, String key, Object value) {
diagnostics.metaData.addToTab(tabName, key, value);
return this;
} | java | public Report addToTab(String tabName, String key, Object value) {
diagnostics.metaData.addToTab(tabName, key, value);
return this;
} | [
"public",
"Report",
"addToTab",
"(",
"String",
"tabName",
",",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"diagnostics",
".",
"metaData",
".",
"addToTab",
"(",
"tabName",
",",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add a key value pair to a metadata tab.
@param tabName the name of the tab to add the key value pair to
@param key the key of the metadata to add
@param value the metadata value to add
@return the modified report | [
"Add",
"a",
"key",
"value",
"pair",
"to",
"a",
"metadata",
"tab",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L190-L193 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.setAppInfo | @Deprecated
public Report setAppInfo(String key, Object value) {
diagnostics.app.put(key, value);
return this;
} | java | @Deprecated
public Report setAppInfo(String key, Object value) {
diagnostics.app.put(key, value);
return this;
} | [
"@",
"Deprecated",
"public",
"Report",
"setAppInfo",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"diagnostics",
".",
"app",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add some application info on the report.
@param key the key of app info to add
@param value the value of app info to add
@return the modified report
@deprecated use {@link #addToTab(String, String, Object)} instead | [
"Add",
"some",
"application",
"info",
"on",
"the",
"report",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L214-L218 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.setDeviceInfo | @Deprecated
public Report setDeviceInfo(String key, Object value) {
diagnostics.device.put(key, value);
return this;
} | java | @Deprecated
public Report setDeviceInfo(String key, Object value) {
diagnostics.device.put(key, value);
return this;
} | [
"@",
"Deprecated",
"public",
"Report",
"setDeviceInfo",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"diagnostics",
".",
"device",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Set device information on the report.
@param key the key of device info to add
@param value the value of device info to add
@return the modified report
@deprecated use {@link #addToTab(String, String, Object)} instead | [
"Set",
"device",
"information",
"on",
"the",
"report",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L259-L263 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.setUser | public Report setUser(String id, String email, String name) {
diagnostics.user.put("id", id);
diagnostics.user.put("email", email);
diagnostics.user.put("name", name);
return this;
} | java | public Report setUser(String id, String email, String name) {
diagnostics.user.put("id", id);
diagnostics.user.put("email", email);
diagnostics.user.put("name", name);
return this;
} | [
"public",
"Report",
"setUser",
"(",
"String",
"id",
",",
"String",
"email",
",",
"String",
"name",
")",
"{",
"diagnostics",
".",
"user",
".",
"put",
"(",
"\"id\"",
",",
"id",
")",
";",
"diagnostics",
".",
"user",
".",
"put",
"(",
"\"email\"",
",",
"e... | Helper method to set all the user attributes.
@param id the identifier of the user.
@param email the email of the user.
@param name the name of the user.
@return the modified report. | [
"Helper",
"method",
"to",
"set",
"all",
"the",
"user",
"attributes",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L297-L302 | train |
bugsnag/bugsnag-java | features/fixtures/scenarios/src/main/java/com/bugsnag/mazerunner/scenarios/Scenario.java | Scenario.disableSessionDelivery | protected void disableSessionDelivery() {
bugsnag.setSessionDelivery(new Delivery() {
@Override
public void deliver(Serializer serializer, Object object, Map<String, String> headers) {
// Do nothing
}
@Override
public void close() {
... | java | protected void disableSessionDelivery() {
bugsnag.setSessionDelivery(new Delivery() {
@Override
public void deliver(Serializer serializer, Object object, Map<String, String> headers) {
// Do nothing
}
@Override
public void close() {
... | [
"protected",
"void",
"disableSessionDelivery",
"(",
")",
"{",
"bugsnag",
".",
"setSessionDelivery",
"(",
"new",
"Delivery",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"deliver",
"(",
"Serializer",
"serializer",
",",
"Object",
"object",
",",
"Map",
"<",
... | Prevents sessions from being delivered | [
"Prevents",
"sessions",
"from",
"being",
"delivered"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/features/fixtures/scenarios/src/main/java/com/bugsnag/mazerunner/scenarios/Scenario.java#L39-L51 | train |
bugsnag/bugsnag-java | features/fixtures/scenarios/src/main/java/com/bugsnag/mazerunner/scenarios/Scenario.java | Scenario.flushAllSessions | protected void flushAllSessions() {
try {
Field field = bugsnag.getClass().getDeclaredField("sessionTracker");
field.setAccessible(true);
Object sessionTracker = field.get(bugsnag);
field = sessionTracker.getClass().getDeclaredField("enqueuedSessionCounts");
... | java | protected void flushAllSessions() {
try {
Field field = bugsnag.getClass().getDeclaredField("sessionTracker");
field.setAccessible(true);
Object sessionTracker = field.get(bugsnag);
field = sessionTracker.getClass().getDeclaredField("enqueuedSessionCounts");
... | [
"protected",
"void",
"flushAllSessions",
"(",
")",
"{",
"try",
"{",
"Field",
"field",
"=",
"bugsnag",
".",
"getClass",
"(",
")",
".",
"getDeclaredField",
"(",
"\"sessionTracker\"",
")",
";",
"field",
".",
"setAccessible",
"(",
"true",
")",
";",
"Object",
"... | Flushes sessions from the Bugsnag object | [
"Flushes",
"sessions",
"from",
"the",
"Bugsnag",
"object"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/features/fixtures/scenarios/src/main/java/com/bugsnag/mazerunner/scenarios/Scenario.java#L56-L80 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/serialization/Serializer.java | Serializer.writeToStream | public void writeToStream(OutputStream stream, Object object) throws SerializationException {
try {
mapper.writeValue(stream, object);
} catch (IOException ex) {
throw new SerializationException("Exception during serialization", ex);
}
} | java | public void writeToStream(OutputStream stream, Object object) throws SerializationException {
try {
mapper.writeValue(stream, object);
} catch (IOException ex) {
throw new SerializationException("Exception during serialization", ex);
}
} | [
"public",
"void",
"writeToStream",
"(",
"OutputStream",
"stream",
",",
"Object",
"object",
")",
"throws",
"SerializationException",
"{",
"try",
"{",
"mapper",
".",
"writeValue",
"(",
"stream",
",",
"object",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
... | Write the object to the stream.
@param stream the stream to write the object to.
@param object the object to write to the stream.
@throws SerializationException the object could not be serialized. | [
"Write",
"the",
"object",
"to",
"the",
"stream",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/serialization/Serializer.java#L32-L38 | train |
bugsnag/bugsnag-java | examples/spring-web/src/main/java/com/bugsnag/example/spring/web/Config.java | Config.bugsnag | @Bean
public Bugsnag bugsnag() {
// Create a Bugsnag client
Bugsnag bugsnag = new Bugsnag("YOUR-API-KEY");
// Set some diagnostic data which will not change during the
// lifecycle of the application
bugsnag.setReleaseStage("staging");
bugsnag.setAppVersion("1.0.1");... | java | @Bean
public Bugsnag bugsnag() {
// Create a Bugsnag client
Bugsnag bugsnag = new Bugsnag("YOUR-API-KEY");
// Set some diagnostic data which will not change during the
// lifecycle of the application
bugsnag.setReleaseStage("staging");
bugsnag.setAppVersion("1.0.1");... | [
"@",
"Bean",
"public",
"Bugsnag",
"bugsnag",
"(",
")",
"{",
"// Create a Bugsnag client",
"Bugsnag",
"bugsnag",
"=",
"new",
"Bugsnag",
"(",
"\"YOUR-API-KEY\"",
")",
";",
"// Set some diagnostic data which will not change during the",
"// lifecycle of the application",
"bugsna... | Define singleton bean "bugsnag" which can be injected into any Spring managed class with @Autowired. | [
"Define",
"singleton",
"bean",
"bugsnag",
"which",
"can",
"be",
"injected",
"into",
"any",
"Spring",
"managed",
"class",
"with"
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/examples/spring-web/src/main/java/com/bugsnag/example/spring/web/Config.java#L19-L46 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Bugsnag.java | Bugsnag.close | public void close() {
LOGGER.debug("Closing connection to Bugsnag");
if (config.delivery != null) {
config.delivery.close();
}
ExceptionHandler.disable(this);
} | java | public void close() {
LOGGER.debug("Closing connection to Bugsnag");
if (config.delivery != null) {
config.delivery.close();
}
ExceptionHandler.disable(this);
} | [
"public",
"void",
"close",
"(",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Closing connection to Bugsnag\"",
")",
";",
"if",
"(",
"config",
".",
"delivery",
"!=",
"null",
")",
"{",
"config",
".",
"delivery",
".",
"close",
"(",
")",
";",
"}",
"ExceptionHan... | Close the connection to Bugsnag and unlink the exception handler. | [
"Close",
"the",
"connection",
"to",
"Bugsnag",
"and",
"unlink",
"the",
"exception",
"handler",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Bugsnag.java#L599-L605 | train |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Bugsnag.java | Bugsnag.addThreadMetaData | public static void addThreadMetaData(String tabName, String key, Object value) {
THREAD_METADATA.get().addToTab(tabName, key, value);
} | java | public static void addThreadMetaData(String tabName, String key, Object value) {
THREAD_METADATA.get().addToTab(tabName, key, value);
} | [
"public",
"static",
"void",
"addThreadMetaData",
"(",
"String",
"tabName",
",",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"THREAD_METADATA",
".",
"get",
"(",
")",
".",
"addToTab",
"(",
"tabName",
",",
"key",
",",
"value",
")",
";",
"}"
] | Add a key value pair to a metadata tab just for this thread.
@param tabName the name of the tab to add the key value pair to
@param key the key of the metadata to add
@param value the metadata value to add | [
"Add",
"a",
"key",
"value",
"pair",
"to",
"a",
"metadata",
"tab",
"just",
"for",
"this",
"thread",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Bugsnag.java#L616-L618 | train |
bugsnag/bugsnag-java | bugsnag-spring/src/main/java/com/bugsnag/BugsnagSpringConfiguration.java | BugsnagSpringConfiguration.excludeLoggers | @PostConstruct
@SuppressWarnings("checkstyle:emptycatchblock")
void excludeLoggers() {
try {
// Exclude Tomcat logger when processing HTTP requests via a servlet.
// Regex specified to match the servlet variable parts of the logger name, e.g.
// the Spring Boot defaul... | java | @PostConstruct
@SuppressWarnings("checkstyle:emptycatchblock")
void excludeLoggers() {
try {
// Exclude Tomcat logger when processing HTTP requests via a servlet.
// Regex specified to match the servlet variable parts of the logger name, e.g.
// the Spring Boot defaul... | [
"@",
"PostConstruct",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:emptycatchblock\"",
")",
"void",
"excludeLoggers",
"(",
")",
"{",
"try",
"{",
"// Exclude Tomcat logger when processing HTTP requests via a servlet.",
"// Regex specified to match the servlet variable parts of the logger... | If using Logback, stop any configured appender from creating Bugsnag reports for Spring log
messages as they effectively duplicate error reports for unhandled exceptions. | [
"If",
"using",
"Logback",
"stop",
"any",
"configured",
"appender",
"from",
"creating",
"Bugsnag",
"reports",
"for",
"Spring",
"log",
"messages",
"as",
"they",
"effectively",
"duplicate",
"error",
"reports",
"for",
"unhandled",
"exceptions",
"."
] | 11817d63949bcf2b2b6b765a1d37305cdec356f2 | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag-spring/src/main/java/com/bugsnag/BugsnagSpringConfiguration.java#L50-L71 | train |
omadahealth/CircularBarPager | library/src/main/java/com/github/omadahealth/circularbarpager/library/viewpager/WrapContentViewPager.java | WrapContentViewPager.onMeasure | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
try {
int mode = MeasureSpec.getMode(heightMeasureSpec);
if (mode == MeasureSpec.UNSPECIFIED || mode == MeasureSpec.AT_MOST) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
... | java | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
try {
int mode = MeasureSpec.getMode(heightMeasureSpec);
if (mode == MeasureSpec.UNSPECIFIED || mode == MeasureSpec.AT_MOST) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
... | [
"@",
"Override",
"protected",
"void",
"onMeasure",
"(",
"int",
"widthMeasureSpec",
",",
"int",
"heightMeasureSpec",
")",
"{",
"try",
"{",
"int",
"mode",
"=",
"MeasureSpec",
".",
"getMode",
"(",
"heightMeasureSpec",
")",
";",
"if",
"(",
"mode",
"==",
"Measure... | Allows to redraw the view size to wrap the content of the bigger child.
@param widthMeasureSpec with measured
@param heightMeasureSpec height measured | [
"Allows",
"to",
"redraw",
"the",
"view",
"size",
"to",
"wrap",
"the",
"content",
"of",
"the",
"bigger",
"child",
"."
] | 3a43e8828849da727fd13345e83b8432f7271155 | https://github.com/omadahealth/CircularBarPager/blob/3a43e8828849da727fd13345e83b8432f7271155/library/src/main/java/com/github/omadahealth/circularbarpager/library/viewpager/WrapContentViewPager.java#L90-L115 | train |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/PeekView.java | PeekView.setWidth | private void setWidth(int width) {
contentParams.width = options.fullScreenPeek() ? screenWidth : width;
content.setLayoutParams(contentParams);
} | java | private void setWidth(int width) {
contentParams.width = options.fullScreenPeek() ? screenWidth : width;
content.setLayoutParams(contentParams);
} | [
"private",
"void",
"setWidth",
"(",
"int",
"width",
")",
"{",
"contentParams",
".",
"width",
"=",
"options",
".",
"fullScreenPeek",
"(",
")",
"?",
"screenWidth",
":",
"width",
";",
"content",
".",
"setLayoutParams",
"(",
"contentParams",
")",
";",
"}"
] | Sets the width of the view in PX.
@param width the width of the circle in px | [
"Sets",
"the",
"width",
"of",
"the",
"view",
"in",
"PX",
"."
] | 8329c44f31c3752da43bab5f261a28ca02254613 | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/PeekView.java#L148-L151 | train |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/PeekView.java | PeekView.setHeight | private void setHeight(int height) {
contentParams.height = options.fullScreenPeek() ? screenHeight : height;
content.setLayoutParams(contentParams);
} | java | private void setHeight(int height) {
contentParams.height = options.fullScreenPeek() ? screenHeight : height;
content.setLayoutParams(contentParams);
} | [
"private",
"void",
"setHeight",
"(",
"int",
"height",
")",
"{",
"contentParams",
".",
"height",
"=",
"options",
".",
"fullScreenPeek",
"(",
")",
"?",
"screenHeight",
":",
"height",
";",
"content",
".",
"setLayoutParams",
"(",
"contentParams",
")",
";",
"}"
] | Sets the height of the view in PX.
@param height the height of the circle in px | [
"Sets",
"the",
"height",
"of",
"the",
"view",
"in",
"PX",
"."
] | 8329c44f31c3752da43bab5f261a28ca02254613 | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/PeekView.java#L158-L161 | train |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/PeekView.java | PeekView.setOffsetByMotionEvent | public void setOffsetByMotionEvent(MotionEvent event) {
int x = (int) event.getRawX();
int y = (int) event.getRawY();
if (x + contentParams.width + FINGER_SIZE < screenWidth) {
setContentOffset(x, y, Translation.HORIZONTAL, FINGER_SIZE);
} else if (x - FINGER_SIZE - contentP... | java | public void setOffsetByMotionEvent(MotionEvent event) {
int x = (int) event.getRawX();
int y = (int) event.getRawY();
if (x + contentParams.width + FINGER_SIZE < screenWidth) {
setContentOffset(x, y, Translation.HORIZONTAL, FINGER_SIZE);
} else if (x - FINGER_SIZE - contentP... | [
"public",
"void",
"setOffsetByMotionEvent",
"(",
"MotionEvent",
"event",
")",
"{",
"int",
"x",
"=",
"(",
"int",
")",
"event",
".",
"getRawX",
"(",
")",
";",
"int",
"y",
"=",
"(",
"int",
")",
"event",
".",
"getRawY",
"(",
")",
";",
"if",
"(",
"x",
... | Places the peek view over the top of a motion event. This will translate the motion event's start points
so that the PeekView isn't covered by the finger.
@param event event that activates the peek view | [
"Places",
"the",
"peek",
"view",
"over",
"the",
"top",
"of",
"a",
"motion",
"event",
".",
"This",
"will",
"translate",
"the",
"motion",
"event",
"s",
"start",
"points",
"so",
"that",
"the",
"PeekView",
"isn",
"t",
"covered",
"by",
"the",
"finger",
"."
] | 8329c44f31c3752da43bab5f261a28ca02254613 | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/PeekView.java#L187-L207 | train |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/PeekView.java | PeekView.setContentOffset | private void setContentOffset(int startX, int startY, Translation translation, int movementAmount) {
if (translation == Translation.VERTICAL) {
// center the X around the start point
int originalStartX = startX;
startX -= contentParams.width / 2;
// if Y is in ... | java | private void setContentOffset(int startX, int startY, Translation translation, int movementAmount) {
if (translation == Translation.VERTICAL) {
// center the X around the start point
int originalStartX = startX;
startX -= contentParams.width / 2;
// if Y is in ... | [
"private",
"void",
"setContentOffset",
"(",
"int",
"startX",
",",
"int",
"startY",
",",
"Translation",
"translation",
",",
"int",
"movementAmount",
")",
"{",
"if",
"(",
"translation",
"==",
"Translation",
".",
"VERTICAL",
")",
"{",
"// center the X around the star... | Show the PeekView over the point of motion
@param startX
@param startY | [
"Show",
"the",
"PeekView",
"over",
"the",
"point",
"of",
"motion"
] | 8329c44f31c3752da43bab5f261a28ca02254613 | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/PeekView.java#L215-L283 | train |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/PeekView.java | PeekView.show | public void show() {
androidContentView.addView(this);
// set the translations for the content view
content.setTranslationX(distanceFromLeft);
content.setTranslationY(distanceFromTop);
// animate the alpha of the PeekView
ObjectAnimator animator = ObjectAnimator.ofFloat... | java | public void show() {
androidContentView.addView(this);
// set the translations for the content view
content.setTranslationX(distanceFromLeft);
content.setTranslationY(distanceFromTop);
// animate the alpha of the PeekView
ObjectAnimator animator = ObjectAnimator.ofFloat... | [
"public",
"void",
"show",
"(",
")",
"{",
"androidContentView",
".",
"addView",
"(",
"this",
")",
";",
"// set the translations for the content view",
"content",
".",
"setTranslationX",
"(",
"distanceFromLeft",
")",
";",
"content",
".",
"setTranslationY",
"(",
"dista... | Show the content of the PeekView by adding it to the android.R.id.content FrameLayout. | [
"Show",
"the",
"content",
"of",
"the",
"PeekView",
"by",
"adding",
"it",
"to",
"the",
"android",
".",
"R",
".",
"id",
".",
"content",
"FrameLayout",
"."
] | 8329c44f31c3752da43bab5f261a28ca02254613 | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/PeekView.java#L301-L321 | train |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/PeekView.java | PeekView.hide | public void hide() {
// animate with a fade
ObjectAnimator animator = ObjectAnimator.ofFloat(this, View.ALPHA, 1.0f, 0.0f);
animator.addListener(new AnimatorEndListener() {
@Override
public void onAnimationEnd(Animator animator) {
// remove the view from ... | java | public void hide() {
// animate with a fade
ObjectAnimator animator = ObjectAnimator.ofFloat(this, View.ALPHA, 1.0f, 0.0f);
animator.addListener(new AnimatorEndListener() {
@Override
public void onAnimationEnd(Animator animator) {
// remove the view from ... | [
"public",
"void",
"hide",
"(",
")",
"{",
"// animate with a fade",
"ObjectAnimator",
"animator",
"=",
"ObjectAnimator",
".",
"ofFloat",
"(",
"this",
",",
"View",
".",
"ALPHA",
",",
"1.0f",
",",
"0.0f",
")",
";",
"animator",
".",
"addListener",
"(",
"new",
... | Hide the PeekView and remove it from the android.R.id.content FrameLayout. | [
"Hide",
"the",
"PeekView",
"and",
"remove",
"it",
"from",
"the",
"android",
".",
"R",
".",
"id",
".",
"content",
"FrameLayout",
"."
] | 8329c44f31c3752da43bab5f261a28ca02254613 | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/PeekView.java#L326-L346 | train |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/builder/Peek.java | Peek.applyTo | public void applyTo(final PeekViewActivity activity, final View base) {
final GestureDetectorCompat detector =
new GestureDetectorCompat(activity, new GestureListener(activity, base, this));
base.setOnTouchListener(new View.OnTouchListener() {
@Override
public bo... | java | public void applyTo(final PeekViewActivity activity, final View base) {
final GestureDetectorCompat detector =
new GestureDetectorCompat(activity, new GestureListener(activity, base, this));
base.setOnTouchListener(new View.OnTouchListener() {
@Override
public bo... | [
"public",
"void",
"applyTo",
"(",
"final",
"PeekViewActivity",
"activity",
",",
"final",
"View",
"base",
")",
"{",
"final",
"GestureDetectorCompat",
"detector",
"=",
"new",
"GestureDetectorCompat",
"(",
"activity",
",",
"new",
"GestureListener",
"(",
"activity",
"... | Finish the builder by selecting the base view that you want to show the PeekView from.
@param activity the PeekViewActivity that you are on.
@param base the view that you want to touch to apply the peek to. | [
"Finish",
"the",
"builder",
"by",
"selecting",
"the",
"base",
"view",
"that",
"you",
"want",
"to",
"show",
"the",
"PeekView",
"from",
"."
] | 8329c44f31c3752da43bab5f261a28ca02254613 | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/builder/Peek.java#L91-L108 | train |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/builder/Peek.java | Peek.show | public void show(PeekViewActivity activity, MotionEvent motionEvent) {
PeekView peek;
if (layout == null) {
peek = new PeekView(activity, options, layoutRes, callbacks);
} else {
peek = new PeekView(activity, options, layout, callbacks);
}
peek.setOffset... | java | public void show(PeekViewActivity activity, MotionEvent motionEvent) {
PeekView peek;
if (layout == null) {
peek = new PeekView(activity, options, layoutRes, callbacks);
} else {
peek = new PeekView(activity, options, layout, callbacks);
}
peek.setOffset... | [
"public",
"void",
"show",
"(",
"PeekViewActivity",
"activity",
",",
"MotionEvent",
"motionEvent",
")",
"{",
"PeekView",
"peek",
";",
"if",
"(",
"layout",
"==",
"null",
")",
"{",
"peek",
"=",
"new",
"PeekView",
"(",
"activity",
",",
"options",
",",
"layoutR... | Show the PeekView
@param activity
@param motionEvent | [
"Show",
"the",
"PeekView"
] | 8329c44f31c3752da43bab5f261a28ca02254613 | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/builder/Peek.java#L116-L127 | train |
omadahealth/CircularBarPager | library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBar.java | CircularBar.loadStyledAttributes | public void loadStyledAttributes(AttributeSet attrs, int defStyleAttr) {
if (attrs != null) {
final TypedArray attributes = mContext.getTheme().obtainStyledAttributes(attrs, R.styleable.CircularViewPager,
defStyleAttr, 0);
mStartLineEnabled = attributes.getBoolean(R.... | java | public void loadStyledAttributes(AttributeSet attrs, int defStyleAttr) {
if (attrs != null) {
final TypedArray attributes = mContext.getTheme().obtainStyledAttributes(attrs, R.styleable.CircularViewPager,
defStyleAttr, 0);
mStartLineEnabled = attributes.getBoolean(R.... | [
"public",
"void",
"loadStyledAttributes",
"(",
"AttributeSet",
"attrs",
",",
"int",
"defStyleAttr",
")",
"{",
"if",
"(",
"attrs",
"!=",
"null",
")",
"{",
"final",
"TypedArray",
"attributes",
"=",
"mContext",
".",
"getTheme",
"(",
")",
".",
"obtainStyledAttribu... | Loads the styles and attributes defined in the xml tag of this class
@param attrs The attributes to read from
@param defStyleAttr The styles to read from | [
"Loads",
"the",
"styles",
"and",
"attributes",
"defined",
"in",
"the",
"xml",
"tag",
"of",
"this",
"class"
] | 3a43e8828849da727fd13345e83b8432f7271155 | https://github.com/omadahealth/CircularBarPager/blob/3a43e8828849da727fd13345e83b8432f7271155/library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBar.java#L438-L466 | train |
omadahealth/CircularBarPager | library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBar.java | CircularBar.initializePainters | private void initializePainters() {
mClockwiseReachedArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mClockwiseReachedArcPaint.setColor(mClockwiseArcColor);
mClockwiseReachedArcPaint.setAntiAlias(true);
mClockwiseReachedArcPaint.setStrokeWidth(mClockwiseReachedArcWidth);
mClockwiseR... | java | private void initializePainters() {
mClockwiseReachedArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mClockwiseReachedArcPaint.setColor(mClockwiseArcColor);
mClockwiseReachedArcPaint.setAntiAlias(true);
mClockwiseReachedArcPaint.setStrokeWidth(mClockwiseReachedArcWidth);
mClockwiseR... | [
"private",
"void",
"initializePainters",
"(",
")",
"{",
"mClockwiseReachedArcPaint",
"=",
"new",
"Paint",
"(",
"Paint",
".",
"ANTI_ALIAS_FLAG",
")",
";",
"mClockwiseReachedArcPaint",
".",
"setColor",
"(",
"mClockwiseArcColor",
")",
";",
"mClockwiseReachedArcPaint",
".... | Initializes the paints used for the bars | [
"Initializes",
"the",
"paints",
"used",
"for",
"the",
"bars"
] | 3a43e8828849da727fd13345e83b8432f7271155 | https://github.com/omadahealth/CircularBarPager/blob/3a43e8828849da727fd13345e83b8432f7271155/library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBar.java#L535-L568 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/snapshot/SnapshotCreator.java | SnapshotCreator.createSnapshot | public static ProducerSnapshot createSnapshot(IStatsProducer producer, String intervalName){
ProducerSnapshot ret = new ProducerSnapshot();
ret.setCategory(producer.getCategory());
ret.setSubsystem(producer.getSubsystem());
ret.setProducerId(producer.getProducerId());
ret.setIntervalName(intervalName);
Li... | java | public static ProducerSnapshot createSnapshot(IStatsProducer producer, String intervalName){
ProducerSnapshot ret = new ProducerSnapshot();
ret.setCategory(producer.getCategory());
ret.setSubsystem(producer.getSubsystem());
ret.setProducerId(producer.getProducerId());
ret.setIntervalName(intervalName);
Li... | [
"public",
"static",
"ProducerSnapshot",
"createSnapshot",
"(",
"IStatsProducer",
"producer",
",",
"String",
"intervalName",
")",
"{",
"ProducerSnapshot",
"ret",
"=",
"new",
"ProducerSnapshot",
"(",
")",
";",
"ret",
".",
"setCategory",
"(",
"producer",
".",
"getCat... | Creates a snapshot for a producer.
@param producer
@param intervalName
@return | [
"Creates",
"a",
"snapshot",
"for",
"a",
"producer",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/snapshot/SnapshotCreator.java#L22-L46 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/snapshot/SnapshotCreator.java | SnapshotCreator.createStatSnapshot | private static StatSnapshot createStatSnapshot(IStats stat, String intervalName, List<String> valueNames){
StatSnapshot snapshot = new StatSnapshot(stat.getName());
for (String valueName : valueNames){
snapshot.setValue(valueName, stat.getValueByNameAsString(valueName, intervalName, TimeUnit.NANOSECONDS));
}
... | java | private static StatSnapshot createStatSnapshot(IStats stat, String intervalName, List<String> valueNames){
StatSnapshot snapshot = new StatSnapshot(stat.getName());
for (String valueName : valueNames){
snapshot.setValue(valueName, stat.getValueByNameAsString(valueName, intervalName, TimeUnit.NANOSECONDS));
}
... | [
"private",
"static",
"StatSnapshot",
"createStatSnapshot",
"(",
"IStats",
"stat",
",",
"String",
"intervalName",
",",
"List",
"<",
"String",
">",
"valueNames",
")",
"{",
"StatSnapshot",
"snapshot",
"=",
"new",
"StatSnapshot",
"(",
"stat",
".",
"getName",
"(",
... | Creates a snapshot for one stat object.
@param stat
@param intervalName
@param valueNames
@return | [
"Creates",
"a",
"snapshot",
"for",
"one",
"stat",
"object",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/snapshot/SnapshotCreator.java#L55-L66 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/blueprint/BlueprintProducersFactory.java | BlueprintProducersFactory.getBlueprintProducer | public static BlueprintProducer getBlueprintProducer(String producerId, String category, String subsystem){
try{
//first find producer
BlueprintProducer producer = producers.get(producerId);
if (producer==null){
synchronized(producers){
producer = producers.get(producerId);
if (producer==null){... | java | public static BlueprintProducer getBlueprintProducer(String producerId, String category, String subsystem){
try{
//first find producer
BlueprintProducer producer = producers.get(producerId);
if (producer==null){
synchronized(producers){
producer = producers.get(producerId);
if (producer==null){... | [
"public",
"static",
"BlueprintProducer",
"getBlueprintProducer",
"(",
"String",
"producerId",
",",
"String",
"category",
",",
"String",
"subsystem",
")",
"{",
"try",
"{",
"//first find producer",
"BlueprintProducer",
"producer",
"=",
"producers",
".",
"get",
"(",
"p... | Returns the blueprint producer with this id. Creates one if none is existing. Uses DLC pattern to reduce synchronization overhead.
@param producerId
@param category
@param subsystem
@return | [
"Returns",
"the",
"blueprint",
"producer",
"with",
"this",
"id",
".",
"Creates",
"one",
"if",
"none",
"is",
"existing",
".",
"Uses",
"DLC",
"pattern",
"to",
"reduce",
"synchronization",
"overhead",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/blueprint/BlueprintProducersFactory.java#L33-L53 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java | ShowCumulatedProducersAction.setAccumulatorAttributes | private void setAccumulatorAttributes(List<String> accumulatorIds, HttpServletRequest request) throws APIException {
if (accumulatorIds == null || accumulatorIds.isEmpty()) {
return;
}
request.setAttribute("accumulatorsPresent", Boolean.TRUE);
//create multiple graphs with ... | java | private void setAccumulatorAttributes(List<String> accumulatorIds, HttpServletRequest request) throws APIException {
if (accumulatorIds == null || accumulatorIds.isEmpty()) {
return;
}
request.setAttribute("accumulatorsPresent", Boolean.TRUE);
//create multiple graphs with ... | [
"private",
"void",
"setAccumulatorAttributes",
"(",
"List",
"<",
"String",
">",
"accumulatorIds",
",",
"HttpServletRequest",
"request",
")",
"throws",
"APIException",
"{",
"if",
"(",
"accumulatorIds",
"==",
"null",
"||",
"accumulatorIds",
".",
"isEmpty",
"(",
")",... | Sets accumulator specific attributes, required to show accumulator charts on page.
@param accumulatorIds Accumulator IDs, tied to given producers
@param request {@link HttpServletRequest} | [
"Sets",
"accumulator",
"specific",
"attributes",
"required",
"to",
"show",
"accumulator",
"charts",
"on",
"page",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java#L143-L162 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java | ShowCumulatedProducersAction.setThresholdAttributes | private void setThresholdAttributes(List<String> thresholdIds, HttpServletRequest request) throws APIException {
if (thresholdIds == null || thresholdIds.isEmpty()) {
return;
}
request.setAttribute("thresholdsPresent", Boolean.TRUE);
List<ThresholdStatusBean> thresholdStatus... | java | private void setThresholdAttributes(List<String> thresholdIds, HttpServletRequest request) throws APIException {
if (thresholdIds == null || thresholdIds.isEmpty()) {
return;
}
request.setAttribute("thresholdsPresent", Boolean.TRUE);
List<ThresholdStatusBean> thresholdStatus... | [
"private",
"void",
"setThresholdAttributes",
"(",
"List",
"<",
"String",
">",
"thresholdIds",
",",
"HttpServletRequest",
"request",
")",
"throws",
"APIException",
"{",
"if",
"(",
"thresholdIds",
"==",
"null",
"||",
"thresholdIds",
".",
"isEmpty",
"(",
")",
")",
... | Sets threshold specific attributes, required to show thresholds on page.
@param thresholdIds Threshold IDs, tied to given producers
@param request {@link HttpServletRequest} | [
"Sets",
"threshold",
"specific",
"attributes",
"required",
"to",
"show",
"thresholds",
"on",
"page",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java#L169-L177 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java | ShowCumulatedProducersAction.removeCumulatedStats | private void removeCumulatedStats(ProducerDecoratorBean decorator) {
if (decorator == null) {
LOGGER.warn("Decorator is empty");
return;
}
for (ProducerAO producer : decorator.getProducers()) {
for (Iterator<StatLineAO> statLineIterator = producer.getLines().... | java | private void removeCumulatedStats(ProducerDecoratorBean decorator) {
if (decorator == null) {
LOGGER.warn("Decorator is empty");
return;
}
for (ProducerAO producer : decorator.getProducers()) {
for (Iterator<StatLineAO> statLineIterator = producer.getLines().... | [
"private",
"void",
"removeCumulatedStats",
"(",
"ProducerDecoratorBean",
"decorator",
")",
"{",
"if",
"(",
"decorator",
"==",
"null",
")",
"{",
"LOGGER",
".",
"warn",
"(",
"\"Decorator is empty\"",
")",
";",
"return",
";",
"}",
"for",
"(",
"ProducerAO",
"produ... | Removes cumulated stats from producers inside decorator.
@param decorator {@link ProducerDecoratorBean} | [
"Removes",
"cumulated",
"stats",
"from",
"producers",
"inside",
"decorator",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java#L275-L288 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java | ShowCumulatedProducersAction.hasAnyStat | private boolean hasAnyStat(ProducerDecoratorBean decorator) {
for (ProducerAO producer : decorator.getProducers()) {
for (StatLineAO line : producer.getLines()) {
if (!CUMULATED_STAT_NAME_VALUE.equals(line.getStatName())) {
return true;
}
... | java | private boolean hasAnyStat(ProducerDecoratorBean decorator) {
for (ProducerAO producer : decorator.getProducers()) {
for (StatLineAO line : producer.getLines()) {
if (!CUMULATED_STAT_NAME_VALUE.equals(line.getStatName())) {
return true;
}
... | [
"private",
"boolean",
"hasAnyStat",
"(",
"ProducerDecoratorBean",
"decorator",
")",
"{",
"for",
"(",
"ProducerAO",
"producer",
":",
"decorator",
".",
"getProducers",
"(",
")",
")",
"{",
"for",
"(",
"StatLineAO",
"line",
":",
"producer",
".",
"getLines",
"(",
... | Checks whether given decorator stat lines contain something besides cumulated stat.
@param decorator {@link ProducerDecoratorBean} | [
"Checks",
"whether",
"given",
"decorator",
"stat",
"lines",
"contain",
"something",
"besides",
"cumulated",
"stat",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java#L310-L320 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/config/producers/MBeanProducerConfig.java | MBeanProducerConfig.isMBeanRequired | public boolean isMBeanRequired(final String domainName, final String className) {
if(domains == null || domains.length == 0)
return true; // No domain configuration set. All domains should pass
for(MBeanProducerDomainConfig domainConfig : domains)
if(domainConfig.getName(... | java | public boolean isMBeanRequired(final String domainName, final String className) {
if(domains == null || domains.length == 0)
return true; // No domain configuration set. All domains should pass
for(MBeanProducerDomainConfig domainConfig : domains)
if(domainConfig.getName(... | [
"public",
"boolean",
"isMBeanRequired",
"(",
"final",
"String",
"domainName",
",",
"final",
"String",
"className",
")",
"{",
"if",
"(",
"domains",
"==",
"null",
"||",
"domains",
".",
"length",
"==",
"0",
")",
"return",
"true",
";",
"// No domain configuration ... | Checks is mbean with given domain and class required by
this configuration.
@param domainName name of mbean domain
@param className class name of mbean
@return true - configuration require to add this mbean as producer.
false - mbean should be skipped. | [
"Checks",
"is",
"mbean",
"with",
"given",
"domain",
"and",
"class",
"required",
"by",
"this",
"configuration",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/config/producers/MBeanProducerConfig.java#L69-L84 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java | AnnotationUtils.findAnnotationInAnnotations | private static <A extends Annotation> A findAnnotationInAnnotations(final AnnotatedElement source, final Class<A> targetAnnotationClass) {
final Annotation[] allAnnotations = source.getAnnotations();
for (final Annotation annotation : allAnnotations) {
final A result = findAnnotation(annotation, targetAnnotation... | java | private static <A extends Annotation> A findAnnotationInAnnotations(final AnnotatedElement source, final Class<A> targetAnnotationClass) {
final Annotation[] allAnnotations = source.getAnnotations();
for (final Annotation annotation : allAnnotations) {
final A result = findAnnotation(annotation, targetAnnotation... | [
"private",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"findAnnotationInAnnotations",
"(",
"final",
"AnnotatedElement",
"source",
",",
"final",
"Class",
"<",
"A",
">",
"targetAnnotationClass",
")",
"{",
"final",
"Annotation",
"[",
"]",
"allAnnotations",... | Tries to find required annotation in scope of all annotations of incoming 'source'.
@param source
{@link AnnotatedElement}
@param targetAnnotationClass
{@link Class} - actually required annotation class
@param <A>
- type param
@return {@link A} in case if found, {@code null} otherwise | [
"Tries",
"to",
"find",
"required",
"annotation",
"in",
"scope",
"of",
"all",
"annotations",
"of",
"incoming",
"source",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java#L54-L63 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java | AnnotationUtils.findTypeAnnotation | public static <A extends Annotation> A findTypeAnnotation(final Class<?> type, final Class<A> targetAnnotationClass) {
Objects.requireNonNull(type, "incoming 'type' is not valid");
Objects.requireNonNull(targetAnnotationClass, "incoming 'targetAnnotationClass' is not valid");
if (type.equals(Object.class))
re... | java | public static <A extends Annotation> A findTypeAnnotation(final Class<?> type, final Class<A> targetAnnotationClass) {
Objects.requireNonNull(type, "incoming 'type' is not valid");
Objects.requireNonNull(targetAnnotationClass, "incoming 'targetAnnotationClass' is not valid");
if (type.equals(Object.class))
re... | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"findTypeAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Class",
"<",
"A",
">",
"targetAnnotationClass",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"type",
","... | Recursive annotation search on type, it annotations and parents hierarchy. Interfaces ignored.
@param type
{@link Class}
@param targetAnnotationClass
required {@link Annotation} class
@param <A>
type param
@return {@link A} in case if found, {@code null} otherwise | [
"Recursive",
"annotation",
"search",
"on",
"type",
"it",
"annotations",
"and",
"parents",
"hierarchy",
".",
"Interfaces",
"ignored",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java#L129-L144 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/StatValueImpl.java | StatValueImpl.getHolderByIntervalName | private ValueHolder getHolderByIntervalName(String aIntervalName){
ValueHolder h = values.get(aIntervalName);
if (h == null)
throw new UnknownIntervalException(aIntervalName);
return h;
} | java | private ValueHolder getHolderByIntervalName(String aIntervalName){
ValueHolder h = values.get(aIntervalName);
if (h == null)
throw new UnknownIntervalException(aIntervalName);
return h;
} | [
"private",
"ValueHolder",
"getHolderByIntervalName",
"(",
"String",
"aIntervalName",
")",
"{",
"ValueHolder",
"h",
"=",
"values",
".",
"get",
"(",
"aIntervalName",
")",
";",
"if",
"(",
"h",
"==",
"null",
")",
"throw",
"new",
"UnknownIntervalException",
"(",
"a... | This method returns the ValueHolder that is stored for the given Interval name.
@param aIntervalName the name of the interval
@return the stored ValueHolder
@throws UnknownIntervalException if there is no ValueHolder stored for an Interval with the given name | [
"This",
"method",
"returns",
"the",
"ValueHolder",
"that",
"is",
"stored",
"for",
"the",
"given",
"Interval",
"name",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/StatValueImpl.java#L147-L152 | train |
anotheria/moskito | moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/connectors/impl/RabbitMQConnector.java | RabbitMQConnector.initWithDefaultProperties | @Override
public void initWithDefaultProperties(Properties properties) throws ConnectorInitException {
log.debug("Starting to initWithDefaultProperties RabbitMQ connector in php plugin...");
ConnectionFactory factory = new ConnectionFactory();
factory.setHost(properties.getProperty("conne... | java | @Override
public void initWithDefaultProperties(Properties properties) throws ConnectorInitException {
log.debug("Starting to initWithDefaultProperties RabbitMQ connector in php plugin...");
ConnectionFactory factory = new ConnectionFactory();
factory.setHost(properties.getProperty("conne... | [
"@",
"Override",
"public",
"void",
"initWithDefaultProperties",
"(",
"Properties",
"properties",
")",
"throws",
"ConnectorInitException",
"{",
"log",
".",
"debug",
"(",
"\"Starting to initWithDefaultProperties RabbitMQ connector in php plugin...\"",
")",
";",
"ConnectionFactory... | Opens connection and channel to listen
configured queue for incoming data
@param properties configured connector properties
@throws ConnectorInitException on connection to RabbitMQ fail | [
"Opens",
"connection",
"and",
"channel",
"to",
"listen",
"configured",
"queue",
"for",
"incoming",
"data"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/connectors/impl/RabbitMQConnector.java#L67-L97 | train |
anotheria/moskito | moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/connectors/impl/RabbitMQConnector.java | RabbitMQConnector.deinit | public void deinit() {
if (channel != null) try {
channel.close();
} catch (IOException | TimeoutException e) {
log.warn("Failed to close channel in RabbitMQ connector");
}
if (connection != null) try {
connection.close();
} catch (IOExceptio... | java | public void deinit() {
if (channel != null) try {
channel.close();
} catch (IOException | TimeoutException e) {
log.warn("Failed to close channel in RabbitMQ connector");
}
if (connection != null) try {
connection.close();
} catch (IOExceptio... | [
"public",
"void",
"deinit",
"(",
")",
"{",
"if",
"(",
"channel",
"!=",
"null",
")",
"try",
"{",
"channel",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"|",
"TimeoutException",
"e",
")",
"{",
"log",
".",
"warn",
"(",
"\"Failed to cl... | Closes RabbitMQ channel and connection | [
"Closes",
"RabbitMQ",
"channel",
"and",
"connection"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/connectors/impl/RabbitMQConnector.java#L102-L116 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/logging/IntervalStatsLogger.java | IntervalStatsLogger.intervalUpdated | @Override public void intervalUpdated(Interval caller) {
output.out("===============================================================================");
output.out("=== SNAPSHOT Interval "+interval.getName()+" updated, Entity: "+id);
output.out("=== Timestamp: "+Date.currentDate()+", ServiceId: "+target.getProduce... | java | @Override public void intervalUpdated(Interval caller) {
output.out("===============================================================================");
output.out("=== SNAPSHOT Interval "+interval.getName()+" updated, Entity: "+id);
output.out("=== Timestamp: "+Date.currentDate()+", ServiceId: "+target.getProduce... | [
"@",
"Override",
"public",
"void",
"intervalUpdated",
"(",
"Interval",
"caller",
")",
"{",
"output",
".",
"out",
"(",
"\"===============================================================================\"",
")",
";",
"output",
".",
"out",
"(",
"\"=== SNAPSHOT Interval \"",
... | Called by the timer. Writes the current status to the logger. | [
"Called",
"by",
"the",
"timer",
".",
"Writes",
"the",
"current",
"status",
"to",
"the",
"logger",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/logging/IntervalStatsLogger.java#L102-L116 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/embedded/StartMoSKitoInspectBackendForRemote.java | StartMoSKitoInspectBackendForRemote.startMoSKitoInspectBackend | public static void startMoSKitoInspectBackend(int port) throws MoSKitoInspectStartException{
log.info("Starting moskito-inspect remote agent at port "+port);
Class serverClazz = null;
Exception exception = null;
try{
serverClazz = Class.forName("net.anotheria.moskito.webui.shared.api.generated.CombinedAPIS... | java | public static void startMoSKitoInspectBackend(int port) throws MoSKitoInspectStartException{
log.info("Starting moskito-inspect remote agent at port "+port);
Class serverClazz = null;
Exception exception = null;
try{
serverClazz = Class.forName("net.anotheria.moskito.webui.shared.api.generated.CombinedAPIS... | [
"public",
"static",
"void",
"startMoSKitoInspectBackend",
"(",
"int",
"port",
")",
"throws",
"MoSKitoInspectStartException",
"{",
"log",
".",
"info",
"(",
"\"Starting moskito-inspect remote agent at port \"",
"+",
"port",
")",
";",
"Class",
"serverClazz",
"=",
"null",
... | Starts MoSKito Inspect Backend.
@param port port on which to start moskito rmi listener. If not specified (-1) either default or configured by distributeme port is used.
@throws MoSKitoInspectStartException | [
"Starts",
"MoSKito",
"Inspect",
"Backend",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/embedded/StartMoSKitoInspectBackendForRemote.java#L35-L62 | train |
anotheria/moskito | moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/config/MoskitoPHPConfig.java | MoskitoPHPConfig.getDefault | public MapperConfig[] getDefault() {
MapperConfig executionStatsMapper = new MapperConfig();
executionStatsMapper.setMapperClass("net.anotheria.extensions.php.mappers.impl.ExecutionStatsMapper");
executionStatsMapper.setMapperId("ExecutionStatsMapper");
MapperConfig serviceStatsMapper ... | java | public MapperConfig[] getDefault() {
MapperConfig executionStatsMapper = new MapperConfig();
executionStatsMapper.setMapperClass("net.anotheria.extensions.php.mappers.impl.ExecutionStatsMapper");
executionStatsMapper.setMapperId("ExecutionStatsMapper");
MapperConfig serviceStatsMapper ... | [
"public",
"MapperConfig",
"[",
"]",
"getDefault",
"(",
")",
"{",
"MapperConfig",
"executionStatsMapper",
"=",
"new",
"MapperConfig",
"(",
")",
";",
"executionStatsMapper",
".",
"setMapperClass",
"(",
"\"net.anotheria.extensions.php.mappers.impl.ExecutionStatsMapper\"",
")",... | Defines builtin default mappers that required for agent proper work
@return array of builtin mappers configurations | [
"Defines",
"builtin",
"default",
"mappers",
"that",
"required",
"for",
"agent",
"proper",
"work"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/config/MoskitoPHPConfig.java#L42-L60 | train |
anotheria/moskito | moskito-integration/moskito-sql/src/main/java/net/anotheria/moskito/sql/callingAspect/ConnectionCallAspect.java | ConnectionCallAspect.doMoskitoProfiling | private Object doMoskitoProfiling(ProceedingJoinPoint pjp, String statement) throws Throwable {
String statementGeneralized = removeParametersFromStatement(statement);
long callTime = System.nanoTime();
QueryStats cumulatedStats = producer.getDefaultStats();
QueryStats statementStats = null;
try{
statement... | java | private Object doMoskitoProfiling(ProceedingJoinPoint pjp, String statement) throws Throwable {
String statementGeneralized = removeParametersFromStatement(statement);
long callTime = System.nanoTime();
QueryStats cumulatedStats = producer.getDefaultStats();
QueryStats statementStats = null;
try{
statement... | [
"private",
"Object",
"doMoskitoProfiling",
"(",
"ProceedingJoinPoint",
"pjp",
",",
"String",
"statement",
")",
"throws",
"Throwable",
"{",
"String",
"statementGeneralized",
"=",
"removeParametersFromStatement",
"(",
"statement",
")",
";",
"long",
"callTime",
"=",
"Sys... | Perform MoSKito profiling.
@param pjp {@link ProceedingJoinPoint}
@param statement sql statement
@return invocation result - both with profiling
@throws Throwable on errors | [
"Perform",
"MoSKito",
"profiling",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-sql/src/main/java/net/anotheria/moskito/sql/callingAspect/ConnectionCallAspect.java#L114-L158 | train |
anotheria/moskito | moskito-integration/moskito-sql/src/main/java/net/anotheria/moskito/sql/callingAspect/ConnectionCallAspect.java | ConnectionCallAspect.addTrace | private void addTrace(String statement, final boolean isSuccess, final long duration) {
TracedCall aRunningTrace = RunningTraceContainer.getCurrentlyTracedCall();
CurrentlyTracedCall currentTrace = aRunningTrace.callTraced() ? (CurrentlyTracedCall) aRunningTrace : null;
if (currentTrace != null) {
TraceStep cu... | java | private void addTrace(String statement, final boolean isSuccess, final long duration) {
TracedCall aRunningTrace = RunningTraceContainer.getCurrentlyTracedCall();
CurrentlyTracedCall currentTrace = aRunningTrace.callTraced() ? (CurrentlyTracedCall) aRunningTrace : null;
if (currentTrace != null) {
TraceStep cu... | [
"private",
"void",
"addTrace",
"(",
"String",
"statement",
",",
"final",
"boolean",
"isSuccess",
",",
"final",
"long",
"duration",
")",
"{",
"TracedCall",
"aRunningTrace",
"=",
"RunningTraceContainer",
".",
"getCurrentlyTracedCall",
"(",
")",
";",
"CurrentlyTracedCa... | Perform additional profiling - for Journey stuff.
@param statement prepared statement
@param isSuccess is success | [
"Perform",
"additional",
"profiling",
"-",
"for",
"Journey",
"stuff",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-sql/src/main/java/net/anotheria/moskito/sql/callingAspect/ConnectionCallAspect.java#L166-L177 | train |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/CounterAspect.java | CounterAspect.count | private Object count(ProceedingJoinPoint pjp, String aProducerId, String aSubsystem, String aCategory) throws Throwable {
return perform(false,
getMethodStatName(pjp.getSignature()),
pjp,
aProducerId,
aCategory,
aSubsystem);
} | java | private Object count(ProceedingJoinPoint pjp, String aProducerId, String aSubsystem, String aCategory) throws Throwable {
return perform(false,
getMethodStatName(pjp.getSignature()),
pjp,
aProducerId,
aCategory,
aSubsystem);
} | [
"private",
"Object",
"count",
"(",
"ProceedingJoinPoint",
"pjp",
",",
"String",
"aProducerId",
",",
"String",
"aSubsystem",
",",
"String",
"aCategory",
")",
"throws",
"Throwable",
"{",
"return",
"perform",
"(",
"false",
",",
"getMethodStatName",
"(",
"pjp",
".",... | Implementation for the @Count pointcut.
@param pjp ProceedingJoinPoint.
@param aProducerId producerId from annotation.
@param aSubsystem subsystem configured by annotation-
@param aCategory category configured by annotation.
@return
@throws Throwable | [
"Implementation",
"for",
"the"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/CounterAspect.java#L83-L91 | train |
anotheria/moskito | moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConfigBootstrapper.java | ConfigBootstrapper.bootstrapPlugin | void bootstrapPlugin(IProducerRegistry producerRegistry) throws PHPPluginBootstrapException {
config.setConfigChangedNotifier(new ConfigChangedNotifierImpl());
MappersRegistry mappersRegistry = new MappersRegistry();
listener = new OnProducerDataReceivedListenerImpl(mappersRegistry, producerReg... | java | void bootstrapPlugin(IProducerRegistry producerRegistry) throws PHPPluginBootstrapException {
config.setConfigChangedNotifier(new ConfigChangedNotifierImpl());
MappersRegistry mappersRegistry = new MappersRegistry();
listener = new OnProducerDataReceivedListenerImpl(mappersRegistry, producerReg... | [
"void",
"bootstrapPlugin",
"(",
"IProducerRegistry",
"producerRegistry",
")",
"throws",
"PHPPluginBootstrapException",
"{",
"config",
".",
"setConfigChangedNotifier",
"(",
"new",
"ConfigChangedNotifierImpl",
"(",
")",
")",
";",
"MappersRegistry",
"mappersRegistry",
"=",
"... | Bootstraps Moskito PHP plugin
@param producerRegistry producer registry to use
@throws PHPPluginBootstrapException on invalid configuration | [
"Bootstraps",
"Moskito",
"PHP",
"plugin"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-php/src/main/java/net/anotheria/extensions/php/ConfigBootstrapper.java#L88-L133 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/util/DeepLinkUtil.java | DeepLinkUtil.makeDeepLink | public static String makeDeepLink(String link){
if(link != null
// If getCurrentRemoteConnectionLink() == null means there is no current remote connection
&& getCurrentRemoteConnectionLink() != null
// If containsRemoteParameter(link) is true means link already c... | java | public static String makeDeepLink(String link){
if(link != null
// If getCurrentRemoteConnectionLink() == null means there is no current remote connection
&& getCurrentRemoteConnectionLink() != null
// If containsRemoteParameter(link) is true means link already c... | [
"public",
"static",
"String",
"makeDeepLink",
"(",
"String",
"link",
")",
"{",
"if",
"(",
"link",
"!=",
"null",
"// If getCurrentRemoteConnectionLink() == null means there is no current remote connection",
"&&",
"getCurrentRemoteConnectionLink",
"(",
")",
"!=",
"null",
"// ... | Adds remote connection parameter to link GET query,
if parameter yet not present in this link.
@param link link to add connection parameter
@return link with remote connection GET parameter | [
"Adds",
"remote",
"connection",
"parameter",
"to",
"link",
"GET",
"query",
"if",
"parameter",
"yet",
"not",
"present",
"in",
"this",
"link",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/util/DeepLinkUtil.java#L59-L73 | train |
anotheria/moskito | moskito-extensions/moskito-notification-providers/src/main/java/net/anotheria/moskito/extensions/notificationproviders/BulkSMSNotificationProvider.java | BulkSMSNotificationProvider.formatQuery | private String formatQuery(final ThresholdAlert alert) {
return String.format(SMS_QUERY_FORMAT, user, password, createMessage(alert, smsTemplate), recipients); // TODO: improve not to replace user/password/etc every time
} | java | private String formatQuery(final ThresholdAlert alert) {
return String.format(SMS_QUERY_FORMAT, user, password, createMessage(alert, smsTemplate), recipients); // TODO: improve not to replace user/password/etc every time
} | [
"private",
"String",
"formatQuery",
"(",
"final",
"ThresholdAlert",
"alert",
")",
"{",
"return",
"String",
".",
"format",
"(",
"SMS_QUERY_FORMAT",
",",
"user",
",",
"password",
",",
"createMessage",
"(",
"alert",
",",
"smsTemplate",
")",
",",
"recipients",
")"... | Formats query.
@param alert {@link net.anotheria.moskito.core.threshold.alerts.ThresholdAlert}
@return query | [
"Formats",
"query",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-notification-providers/src/main/java/net/anotheria/moskito/extensions/notificationproviders/BulkSMSNotificationProvider.java#L123-L125 | train |
anotheria/moskito | moskito-extensions/moskito-notification-providers/src/main/java/net/anotheria/moskito/extensions/notificationproviders/BulkSMSNotificationProvider.java | BulkSMSNotificationProvider.createMessage | private static String createMessage(final ThresholdAlert alert, final String template) {
// TODO: message should be encoded to apropriate encoding
//return alert.getThreshold().getName() + ": " + alert.getOldStatus() + "->" + alert.getNewStatus();
String message;
if(!StringUtils.isEmpty(... | java | private static String createMessage(final ThresholdAlert alert, final String template) {
// TODO: message should be encoded to apropriate encoding
//return alert.getThreshold().getName() + ": " + alert.getOldStatus() + "->" + alert.getNewStatus();
String message;
if(!StringUtils.isEmpty(... | [
"private",
"static",
"String",
"createMessage",
"(",
"final",
"ThresholdAlert",
"alert",
",",
"final",
"String",
"template",
")",
"{",
"// TODO: message should be encoded to apropriate encoding",
"//return alert.getThreshold().getName() + \": \" + alert.getOldStatus() + \"->\" + alert.... | Create SMS message.
@param alert {@link net.anotheria.moskito.core.threshold.alerts.ThresholdAlert}
@param template {@link net.anotheria.moskito.extensions.notificationproviders.BulkSMSNotificationProvider#smsTemplate}
@return SMS | [
"Create",
"SMS",
"message",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-notification-providers/src/main/java/net/anotheria/moskito/extensions/notificationproviders/BulkSMSNotificationProvider.java#L134-L145 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/decorators/predefined/GenericStatsDecorator.java | GenericStatsDecorator.addCaption | public void addCaption(String name, String type) {
captions.add(new StatCaptionBean(name, name + " as " + type, ""));
} | java | public void addCaption(String name, String type) {
captions.add(new StatCaptionBean(name, name + " as " + type, ""));
} | [
"public",
"void",
"addCaption",
"(",
"String",
"name",
",",
"String",
"type",
")",
"{",
"captions",
".",
"add",
"(",
"new",
"StatCaptionBean",
"(",
"name",
",",
"name",
"+",
"\" as \"",
"+",
"type",
",",
"\"\"",
")",
")",
";",
"}"
] | Add a caption value.
@param name the caption
@param type short description | [
"Add",
"a",
"caption",
"value",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/decorators/predefined/GenericStatsDecorator.java#L83-L85 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java | Storage.putAll | public void putAll(Storage<? extends K, ? extends V> anotherStorage){
wrapper.putAll(anotherStorage.getWrapper());
stats.setSize(wrapper.size());
} | java | public void putAll(Storage<? extends K, ? extends V> anotherStorage){
wrapper.putAll(anotherStorage.getWrapper());
stats.setSize(wrapper.size());
} | [
"public",
"void",
"putAll",
"(",
"Storage",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"anotherStorage",
")",
"{",
"wrapper",
".",
"putAll",
"(",
"anotherStorage",
".",
"getWrapper",
"(",
")",
")",
";",
"stats",
".",
"setSize",
"(",
"wrap... | Puts all elements from anotherStorage to this storage.
@param anotherStorage | [
"Puts",
"all",
"elements",
"from",
"anotherStorage",
"to",
"this",
"storage",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java#L166-L169 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java | Storage.fillMap | public Map<K,V> fillMap(Map<K,V> toFill){
return wrapper.fillMap(toFill);
} | java | public Map<K,V> fillMap(Map<K,V> toFill){
return wrapper.fillMap(toFill);
} | [
"public",
"Map",
"<",
"K",
",",
"V",
">",
"fillMap",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"toFill",
")",
"{",
"return",
"wrapper",
".",
"fillMap",
"(",
"toFill",
")",
";",
"}"
] | Puts all elements into a given map.
@param toFill map to fill to.
@return the map. | [
"Puts",
"all",
"elements",
"into",
"a",
"given",
"map",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java#L212-L214 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java | Storage.createHashtableStorage | public static <K,V> Storage<K,V> createHashtableStorage(){
return new Storage<K,V>(new MapStorageWrapper<K, V>(new HashMap<K, V>()));
} | java | public static <K,V> Storage<K,V> createHashtableStorage(){
return new Storage<K,V>(new MapStorageWrapper<K, V>(new HashMap<K, V>()));
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Storage",
"<",
"K",
",",
"V",
">",
"createHashtableStorage",
"(",
")",
"{",
"return",
"new",
"Storage",
"<",
"K",
",",
"V",
">",
"(",
"new",
"MapStorageWrapper",
"<",
"K",
",",
"V",
">",
"(",
"new",
"... | Factory method to create a new storage backed by a hashtable.
@param <K>
@param <V>
@return | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"storage",
"backed",
"by",
"a",
"hashtable",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java#L372-L374 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java | Storage.createTreeMapStorage | public static <K,V> Storage<K,V> createTreeMapStorage(String name){
return new Storage<K, V>(name, new MapStorageWrapper<K, V>(new TreeMap<K, V>()));
} | java | public static <K,V> Storage<K,V> createTreeMapStorage(String name){
return new Storage<K, V>(name, new MapStorageWrapper<K, V>(new TreeMap<K, V>()));
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Storage",
"<",
"K",
",",
"V",
">",
"createTreeMapStorage",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"Storage",
"<",
"K",
",",
"V",
">",
"(",
"name",
",",
"new",
"MapStorageWrapper",
"<",
"K",
"... | Creates a new TreeMap backed Storage.
@param name name of the map
@param <K>
@param <V>
@return | [
"Creates",
"a",
"new",
"TreeMap",
"backed",
"Storage",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java#L417-L419 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/StatValueTypeUtility.java | StatValueTypeUtility.createValueHolderFactory | protected static IValueHolderFactory createValueHolderFactory(StatValueTypes aType) {
switch (aType) {
case LONG:
return longValueHolderFactory;
case INT:
return intValueHolderFactory;
case STRING:
return stringValueHolderFactory;
case COUNTER:
return counterValueHolderFactory;
case DOUBLE:
... | java | protected static IValueHolderFactory createValueHolderFactory(StatValueTypes aType) {
switch (aType) {
case LONG:
return longValueHolderFactory;
case INT:
return intValueHolderFactory;
case STRING:
return stringValueHolderFactory;
case COUNTER:
return counterValueHolderFactory;
case DOUBLE:
... | [
"protected",
"static",
"IValueHolderFactory",
"createValueHolderFactory",
"(",
"StatValueTypes",
"aType",
")",
"{",
"switch",
"(",
"aType",
")",
"{",
"case",
"LONG",
":",
"return",
"longValueHolderFactory",
";",
"case",
"INT",
":",
"return",
"intValueHolderFactory",
... | This method creates the responsible ValueHolderFactory from the given internal type representation.
@param aType the type that should be supported by the new factory
@return the new factory instance
@throws RuntimeException if the type is unknown or not supported | [
"This",
"method",
"creates",
"the",
"responsible",
"ValueHolderFactory",
"from",
"the",
"given",
"internal",
"type",
"representation",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/StatValueTypeUtility.java#L83-L100 | train |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/TracingUtil.java | TracingUtil.buildCall | @Deprecated
public static String buildCall(final Method method, final Object[] parameters) {
if (method == null) {
throw new IllegalArgumentException("Parameter method can't be null");
}
return buildCall(method.getDeclaringClass().getSimpleName(), method.getName(), parameters, null).toString();
} | java | @Deprecated
public static String buildCall(final Method method, final Object[] parameters) {
if (method == null) {
throw new IllegalArgumentException("Parameter method can't be null");
}
return buildCall(method.getDeclaringClass().getSimpleName(), method.getName(), parameters, null).toString();
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"buildCall",
"(",
"final",
"Method",
"method",
",",
"final",
"Object",
"[",
"]",
"parameters",
")",
"{",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Paramet... | Builds call.
@param method source {@link Method}, can't be null
@param parameters method parameters
@return call | [
"Builds",
"call",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/calltrace/TracingUtil.java#L29-L36 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/util/TagsUtil.java | TagsUtil.tagsMapToTagEntries | public static List<TagEntryAO> tagsMapToTagEntries(Map<String, String> tagsMap) {
if (tagsMap==null)
return Collections.EMPTY_LIST;
List<TagEntryAO> tagEntries = new ArrayList<>(tagsMap.size());
for (Map.Entry<String,String> entry : tagsMap.entrySet())
tagEntries.add(
... | java | public static List<TagEntryAO> tagsMapToTagEntries(Map<String, String> tagsMap) {
if (tagsMap==null)
return Collections.EMPTY_LIST;
List<TagEntryAO> tagEntries = new ArrayList<>(tagsMap.size());
for (Map.Entry<String,String> entry : tagsMap.entrySet())
tagEntries.add(
... | [
"public",
"static",
"List",
"<",
"TagEntryAO",
">",
"tagsMapToTagEntries",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"tagsMap",
")",
"{",
"if",
"(",
"tagsMap",
"==",
"null",
")",
"return",
"Collections",
".",
"EMPTY_LIST",
";",
"List",
"<",
"TagEntryA... | Creates tags info beans from given
tags map with tag names as keys and tag values as map values
@param tagsMap map of tag names and values
@return list of tag entries | [
"Creates",
"tags",
"info",
"beans",
"from",
"given",
"tags",
"map",
"with",
"tag",
"names",
"as",
"keys",
"and",
"tag",
"values",
"as",
"map",
"values"
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/util/TagsUtil.java#L23-L37 | train |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/api/ProducerAPIImpl.java | ProducerAPIImpl.apiAfterConfiguration | private void apiAfterConfiguration(){
ProducerFilterConfig filterConfig[] = WebUIConfig.getInstance().getFilters();
if (filterConfig==null || filterConfig.length==0)
return;
List<ProducerFilter> newProducerFilters = new ArrayList<>(filterConfig.length);
for (ProducerFilterConfig pfc : filterConfig){
try {... | java | private void apiAfterConfiguration(){
ProducerFilterConfig filterConfig[] = WebUIConfig.getInstance().getFilters();
if (filterConfig==null || filterConfig.length==0)
return;
List<ProducerFilter> newProducerFilters = new ArrayList<>(filterConfig.length);
for (ProducerFilterConfig pfc : filterConfig){
try {... | [
"private",
"void",
"apiAfterConfiguration",
"(",
")",
"{",
"ProducerFilterConfig",
"filterConfig",
"[",
"]",
"=",
"WebUIConfig",
".",
"getInstance",
"(",
")",
".",
"getFilters",
"(",
")",
";",
"if",
"(",
"filterConfig",
"==",
"null",
"||",
"filterConfig",
".",... | Called after the configuration has been read. | [
"Called",
"after",
"the",
"configuration",
"has",
"been",
"read",
"."
] | 0fdb79053b98a6ece610fa159f59bc3331e4cf05 | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/api/ProducerAPIImpl.java#L56-L96 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.