id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
160,500 | adyliu/jafka | src/main/java/io/jafka/log/Log.java | Log.validateSegments | private void validateSegments(List<LogSegment> segments) {
synchronized (lock) {
for (int i = 0; i < segments.size() - 1; i++) {
LogSegment curr = segments.get(i);
LogSegment next = segments.get(i + 1);
if (curr.start() + curr.size() != next.start()) {... | java | private void validateSegments(List<LogSegment> segments) {
synchronized (lock) {
for (int i = 0; i < segments.size() - 1; i++) {
LogSegment curr = segments.get(i);
LogSegment next = segments.get(i + 1);
if (curr.start() + curr.size() != next.start()) {... | [
"private",
"void",
"validateSegments",
"(",
"List",
"<",
"LogSegment",
">",
"segments",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"segments",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
"++",
... | Check that the ranges and sizes add up, otherwise we have lost some data somewhere | [
"Check",
"that",
"the",
"ranges",
"and",
"sizes",
"add",
"up",
"otherwise",
"we",
"have",
"lost",
"some",
"data",
"somewhere"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/log/Log.java#L151-L162 |
160,501 | adyliu/jafka | src/main/java/io/jafka/log/Log.java | Log.read | public MessageSet read(long offset, int length) throws IOException {
List<LogSegment> views = segments.getView();
LogSegment found = findRange(views, offset, views.size());
if (found == null) {
if (logger.isTraceEnabled()) {
logger.trace(format("NOT FOUND MessageSet f... | java | public MessageSet read(long offset, int length) throws IOException {
List<LogSegment> views = segments.getView();
LogSegment found = findRange(views, offset, views.size());
if (found == null) {
if (logger.isTraceEnabled()) {
logger.trace(format("NOT FOUND MessageSet f... | [
"public",
"MessageSet",
"read",
"(",
"long",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"List",
"<",
"LogSegment",
">",
"views",
"=",
"segments",
".",
"getView",
"(",
")",
";",
"LogSegment",
"found",
"=",
"findRange",
"(",
"views",
... | read messages beginning from offset
@param offset next message offset
@param length the max package size
@return a MessageSet object with length data or empty
@see MessageSet#Empty
@throws IOException any exception | [
"read",
"messages",
"beginning",
"from",
"offset"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/log/Log.java#L203-L213 |
160,502 | adyliu/jafka | src/main/java/io/jafka/log/Log.java | Log.flush | public void flush() throws IOException {
if (unflushed.get() == 0) return;
synchronized (lock) {
if (logger.isTraceEnabled()) {
logger.debug("Flushing log '" + name + "' last flushed: " + getLastFlushedTime() + " current time: " + System
.currentTimeM... | java | public void flush() throws IOException {
if (unflushed.get() == 0) return;
synchronized (lock) {
if (logger.isTraceEnabled()) {
logger.debug("Flushing log '" + name + "' last flushed: " + getLastFlushedTime() + " current time: " + System
.currentTimeM... | [
"public",
"void",
"flush",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"unflushed",
".",
"get",
"(",
")",
"==",
"0",
")",
"return",
";",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"... | Flush this log file to the physical disk
@throws IOException file read error | [
"Flush",
"this",
"log",
"file",
"to",
"the",
"physical",
"disk"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/log/Log.java#L308-L320 |
160,503 | adyliu/jafka | src/main/java/io/jafka/log/Log.java | Log.findRange | public static <T extends Range> T findRange(List<T> ranges, long value, int arraySize) {
if (ranges.size() < 1) return null;
T first = ranges.get(0);
T last = ranges.get(arraySize - 1);
// check out of bounds
if (value < first.start() || value > last.start() + last.size()) {
... | java | public static <T extends Range> T findRange(List<T> ranges, long value, int arraySize) {
if (ranges.size() < 1) return null;
T first = ranges.get(0);
T last = ranges.get(arraySize - 1);
// check out of bounds
if (value < first.start() || value > last.start() + last.size()) {
... | [
"public",
"static",
"<",
"T",
"extends",
"Range",
">",
"T",
"findRange",
"(",
"List",
"<",
"T",
">",
"ranges",
",",
"long",
"value",
",",
"int",
"arraySize",
")",
"{",
"if",
"(",
"ranges",
".",
"size",
"(",
")",
"<",
"1",
")",
"return",
"null",
"... | Find a given range object in a list of ranges by a value in that range. Does a binary
search over the ranges but instead of checking for equality looks within the range.
Takes the array size as an option in case the array grows while searching happens
@param <T> Range type
@param ranges data list
@param value value in ... | [
"Find",
"a",
"given",
"range",
"object",
"in",
"a",
"list",
"of",
"ranges",
"by",
"a",
"value",
"in",
"that",
"range",
".",
"Does",
"a",
"binary",
"search",
"over",
"the",
"ranges",
"but",
"instead",
"of",
"checking",
"for",
"equality",
"looks",
"within"... | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/log/Log.java#L334-L361 |
160,504 | adyliu/jafka | src/main/java/io/jafka/log/Log.java | Log.nameFromOffset | public static String nameFromOffset(long offset) {
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumIntegerDigits(20);
nf.setMaximumFractionDigits(0);
nf.setGroupingUsed(false);
return nf.format(offset) + Log.FileSuffix;
} | java | public static String nameFromOffset(long offset) {
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumIntegerDigits(20);
nf.setMaximumFractionDigits(0);
nf.setGroupingUsed(false);
return nf.format(offset) + Log.FileSuffix;
} | [
"public",
"static",
"String",
"nameFromOffset",
"(",
"long",
"offset",
")",
"{",
"NumberFormat",
"nf",
"=",
"NumberFormat",
".",
"getInstance",
"(",
")",
";",
"nf",
".",
"setMinimumIntegerDigits",
"(",
"20",
")",
";",
"nf",
".",
"setMaximumFractionDigits",
"("... | Make log segment file name from offset bytes. All this does is pad out the offset number
with zeros so that ls sorts the files numerically
@param offset offset value (padding with zero)
@return filename with offset | [
"Make",
"log",
"segment",
"file",
"name",
"from",
"offset",
"bytes",
".",
"All",
"this",
"does",
"is",
"pad",
"out",
"the",
"offset",
"number",
"with",
"zeros",
"so",
"that",
"ls",
"sorts",
"the",
"files",
"numerically"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/log/Log.java#L373-L379 |
160,505 | adyliu/jafka | src/main/java/io/jafka/log/Log.java | Log.markDeletedWhile | List<LogSegment> markDeletedWhile(LogSegmentFilter filter) throws IOException {
synchronized (lock) {
List<LogSegment> view = segments.getView();
List<LogSegment> deletable = new ArrayList<LogSegment>();
for (LogSegment seg : view) {
if (filter.filter(seg)) {
... | java | List<LogSegment> markDeletedWhile(LogSegmentFilter filter) throws IOException {
synchronized (lock) {
List<LogSegment> view = segments.getView();
List<LogSegment> deletable = new ArrayList<LogSegment>();
for (LogSegment seg : view) {
if (filter.filter(seg)) {
... | [
"List",
"<",
"LogSegment",
">",
"markDeletedWhile",
"(",
"LogSegmentFilter",
"filter",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"List",
"<",
"LogSegment",
">",
"view",
"=",
"segments",
".",
"getView",
"(",
")",
";",
"List",
... | Delete any log segments matching the given predicate function
@throws IOException | [
"Delete",
"any",
"log",
"segments",
"matching",
"the",
"given",
"predicate",
"function"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/log/Log.java#L415-L442 |
160,506 | adyliu/jafka | src/main/java/io/jafka/message/ByteBufferMessageSet.java | ByteBufferMessageSet.verifyMessageSize | public void verifyMessageSize(int maxMessageSize) {
Iterator<MessageAndOffset> shallowIter = internalIterator(true);
while(shallowIter.hasNext()) {
MessageAndOffset messageAndOffset = shallowIter.next();
int payloadSize = messageAndOffset.message.payloadSize();
if(payload... | java | public void verifyMessageSize(int maxMessageSize) {
Iterator<MessageAndOffset> shallowIter = internalIterator(true);
while(shallowIter.hasNext()) {
MessageAndOffset messageAndOffset = shallowIter.next();
int payloadSize = messageAndOffset.message.payloadSize();
if(payload... | [
"public",
"void",
"verifyMessageSize",
"(",
"int",
"maxMessageSize",
")",
"{",
"Iterator",
"<",
"MessageAndOffset",
">",
"shallowIter",
"=",
"internalIterator",
"(",
"true",
")",
";",
"while",
"(",
"shallowIter",
".",
"hasNext",
"(",
")",
")",
"{",
"MessageAnd... | check max size of each message
@param maxMessageSize the max size for each message | [
"check",
"max",
"size",
"of",
"each",
"message"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/message/ByteBufferMessageSet.java#L206-L215 |
160,507 | adyliu/jafka | src/main/java/io/jafka/network/SocketServer.java | SocketServer.close | public void close() {
Closer.closeQuietly(acceptor);
for (Processor processor : processors) {
Closer.closeQuietly(processor);
}
} | java | public void close() {
Closer.closeQuietly(acceptor);
for (Processor processor : processors) {
Closer.closeQuietly(processor);
}
} | [
"public",
"void",
"close",
"(",
")",
"{",
"Closer",
".",
"closeQuietly",
"(",
"acceptor",
")",
";",
"for",
"(",
"Processor",
"processor",
":",
"processors",
")",
"{",
"Closer",
".",
"closeQuietly",
"(",
"processor",
")",
";",
"}",
"}"
] | Shutdown the socket server | [
"Shutdown",
"the",
"socket",
"server"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/network/SocketServer.java#L69-L74 |
160,508 | adyliu/jafka | src/main/java/io/jafka/network/SocketServer.java | SocketServer.startup | public void startup() throws InterruptedException {
final int maxCacheConnectionPerThread = serverConfig.getMaxConnections() / processors.length;
logger.debug("start {} Processor threads",processors.length);
for (int i = 0; i < processors.length; i++) {
processors[i] = new Processor(... | java | public void startup() throws InterruptedException {
final int maxCacheConnectionPerThread = serverConfig.getMaxConnections() / processors.length;
logger.debug("start {} Processor threads",processors.length);
for (int i = 0; i < processors.length; i++) {
processors[i] = new Processor(... | [
"public",
"void",
"startup",
"(",
")",
"throws",
"InterruptedException",
"{",
"final",
"int",
"maxCacheConnectionPerThread",
"=",
"serverConfig",
".",
"getMaxConnections",
"(",
")",
"/",
"processors",
".",
"length",
";",
"logger",
".",
"debug",
"(",
"\"start {} Pr... | Start the socket server and waiting for finished
@throws InterruptedException thread interrupted | [
"Start",
"the",
"socket",
"server",
"and",
"waiting",
"for",
"finished"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/network/SocketServer.java#L81-L90 |
160,509 | adyliu/jafka | src/main/java/io/jafka/utils/zookeeper/ZkUtils.java | ZkUtils.getChildrenParentMayNotExist | public static List<String> getChildrenParentMayNotExist(ZkClient zkClient, String path) {
try {
return zkClient.getChildren(path);
} catch (ZkNoNodeException e) {
return null;
}
} | java | public static List<String> getChildrenParentMayNotExist(ZkClient zkClient, String path) {
try {
return zkClient.getChildren(path);
} catch (ZkNoNodeException e) {
return null;
}
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getChildrenParentMayNotExist",
"(",
"ZkClient",
"zkClient",
",",
"String",
"path",
")",
"{",
"try",
"{",
"return",
"zkClient",
".",
"getChildren",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"ZkNoNodeException",
... | get children nodes name
@param zkClient zkClient
@param path full path
@return children nodes name or null while path not exist | [
"get",
"children",
"nodes",
"name"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/zookeeper/ZkUtils.java#L60-L66 |
160,510 | adyliu/jafka | src/main/java/io/jafka/utils/zookeeper/ZkUtils.java | ZkUtils.getCluster | public static Cluster getCluster(ZkClient zkClient) {
Cluster cluster = new Cluster();
List<String> nodes = getChildrenParentMayNotExist(zkClient, BrokerIdsPath);
for (String node : nodes) {
final String brokerInfoString = readData(zkClient, BrokerIdsPath + "/" + node);
c... | java | public static Cluster getCluster(ZkClient zkClient) {
Cluster cluster = new Cluster();
List<String> nodes = getChildrenParentMayNotExist(zkClient, BrokerIdsPath);
for (String node : nodes) {
final String brokerInfoString = readData(zkClient, BrokerIdsPath + "/" + node);
c... | [
"public",
"static",
"Cluster",
"getCluster",
"(",
"ZkClient",
"zkClient",
")",
"{",
"Cluster",
"cluster",
"=",
"new",
"Cluster",
"(",
")",
";",
"List",
"<",
"String",
">",
"nodes",
"=",
"getChildrenParentMayNotExist",
"(",
"zkClient",
",",
"BrokerIdsPath",
")"... | read all brokers in the zookeeper
@param zkClient zookeeper client
@return all brokers | [
"read",
"all",
"brokers",
"in",
"the",
"zookeeper"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/zookeeper/ZkUtils.java#L102-L110 |
160,511 | adyliu/jafka | src/main/java/io/jafka/utils/zookeeper/ZkUtils.java | ZkUtils.getPartitionsForTopics | public static Map<String, List<String>> getPartitionsForTopics(ZkClient zkClient, Collection<String> topics) {
Map<String, List<String>> ret = new HashMap<String, List<String>>();
for (String topic : topics) {
List<String> partList = new ArrayList<String>();
List<String> brokers ... | java | public static Map<String, List<String>> getPartitionsForTopics(ZkClient zkClient, Collection<String> topics) {
Map<String, List<String>> ret = new HashMap<String, List<String>>();
for (String topic : topics) {
List<String> partList = new ArrayList<String>();
List<String> brokers ... | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getPartitionsForTopics",
"(",
"ZkClient",
"zkClient",
",",
"Collection",
"<",
"String",
">",
"topics",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
... | read broker info for watching topics
@param zkClient the zookeeper client
@param topics topic names
@return topic->(brokerid-0,brokerid-1...brokerid2-0,brokerid2-1...) | [
"read",
"broker",
"info",
"for",
"watching",
"topics"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/zookeeper/ZkUtils.java#L125-L143 |
160,512 | adyliu/jafka | src/main/java/io/jafka/utils/zookeeper/ZkUtils.java | ZkUtils.getConsumersPerTopic | public static Map<String, List<String>> getConsumersPerTopic(ZkClient zkClient, String group) {
ZkGroupDirs dirs = new ZkGroupDirs(group);
List<String> consumers = getChildrenParentMayNotExist(zkClient, dirs.consumerRegistryDir);
//
Map<String, List<String>> consumersPerTopicMap = new Ha... | java | public static Map<String, List<String>> getConsumersPerTopic(ZkClient zkClient, String group) {
ZkGroupDirs dirs = new ZkGroupDirs(group);
List<String> consumers = getChildrenParentMayNotExist(zkClient, dirs.consumerRegistryDir);
//
Map<String, List<String>> consumersPerTopicMap = new Ha... | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"getConsumersPerTopic",
"(",
"ZkClient",
"zkClient",
",",
"String",
"group",
")",
"{",
"ZkGroupDirs",
"dirs",
"=",
"new",
"ZkGroupDirs",
"(",
"group",
")",
";",
"List",
"<",
... | get all consumers for the group
@param zkClient the zookeeper client
@param group the group name
@return topic->(consumerIdStringA-0,consumerIdStringA-1...consumerIdStringB-0,consumerIdStringB-1) | [
"get",
"all",
"consumers",
"for",
"the",
"group"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/zookeeper/ZkUtils.java#L152-L177 |
160,513 | adyliu/jafka | src/main/java/io/jafka/utils/zookeeper/ZkUtils.java | ZkUtils.createEphemeralPath | public static void createEphemeralPath(ZkClient zkClient, String path, String data) {
try {
zkClient.createEphemeral(path, Utils.getBytes(data));
} catch (ZkNoNodeException e) {
createParentPath(zkClient, path);
zkClient.createEphemeral(path, Utils.getBytes(data));
... | java | public static void createEphemeralPath(ZkClient zkClient, String path, String data) {
try {
zkClient.createEphemeral(path, Utils.getBytes(data));
} catch (ZkNoNodeException e) {
createParentPath(zkClient, path);
zkClient.createEphemeral(path, Utils.getBytes(data));
... | [
"public",
"static",
"void",
"createEphemeralPath",
"(",
"ZkClient",
"zkClient",
",",
"String",
"path",
",",
"String",
"data",
")",
"{",
"try",
"{",
"zkClient",
".",
"createEphemeral",
"(",
"path",
",",
"Utils",
".",
"getBytes",
"(",
"data",
")",
")",
";",
... | Create an ephemeral node with the given path and data. Create parents if necessary.
@param zkClient client of zookeeper
@param path node path of zookeeper
@param data node data | [
"Create",
"an",
"ephemeral",
"node",
"with",
"the",
"given",
"path",
"and",
"data",
".",
"Create",
"parents",
"if",
"necessary",
"."
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/zookeeper/ZkUtils.java#L197-L204 |
160,514 | adyliu/jafka | src/main/java/io/jafka/producer/ProducerPool.java | ProducerPool.addProducer | public void addProducer(Broker broker) {
Properties props = new Properties();
props.put("host", broker.host);
props.put("port", "" + broker.port);
props.putAll(config.getProperties());
if (sync) {
SyncProducer producer = new SyncProducer(new SyncProducerConfig(props))... | java | public void addProducer(Broker broker) {
Properties props = new Properties();
props.put("host", broker.host);
props.put("port", "" + broker.port);
props.putAll(config.getProperties());
if (sync) {
SyncProducer producer = new SyncProducer(new SyncProducerConfig(props))... | [
"public",
"void",
"addProducer",
"(",
"Broker",
"broker",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"props",
".",
"put",
"(",
"\"host\"",
",",
"broker",
".",
"host",
")",
";",
"props",
".",
"put",
"(",
"\"port\"",
",",
... | add a new producer, either synchronous or asynchronous, connecting
to the specified broker
@param broker broker to producer | [
"add",
"a",
"new",
"producer",
"either",
"synchronous",
"or",
"asynchronous",
"connecting",
"to",
"the",
"specified",
"broker"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/producer/ProducerPool.java#L117-L138 |
160,515 | adyliu/jafka | src/main/java/io/jafka/producer/ProducerPool.java | ProducerPool.send | public void send(ProducerPoolData<V> ppd) {
if (logger.isDebugEnabled()) {
logger.debug("send message: " + ppd);
}
if (sync) {
Message[] messages = new Message[ppd.data.size()];
int index = 0;
for (V v : ppd.data) {
messages[index] ... | java | public void send(ProducerPoolData<V> ppd) {
if (logger.isDebugEnabled()) {
logger.debug("send message: " + ppd);
}
if (sync) {
Message[] messages = new Message[ppd.data.size()];
int index = 0;
for (V v : ppd.data) {
messages[index] ... | [
"public",
"void",
"send",
"(",
"ProducerPoolData",
"<",
"V",
">",
"ppd",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"send message: \"",
"+",
"ppd",
")",
";",
"}",
"if",
"(",
"sync",
")",
... | selects either a synchronous or an asynchronous producer, for the
specified broker id and calls the send API on the selected producer
to publish the data to the specified broker partition
@param ppd the producer pool request object | [
"selects",
"either",
"a",
"synchronous",
"or",
"an",
"asynchronous",
"producer",
"for",
"the",
"specified",
"broker",
"id",
"and",
"calls",
"the",
"send",
"API",
"on",
"the",
"selected",
"producer",
"to",
"publish",
"the",
"data",
"to",
"the",
"specified",
"... | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/producer/ProducerPool.java#L147-L172 |
160,516 | adyliu/jafka | src/main/java/io/jafka/producer/ProducerPool.java | ProducerPool.close | public void close() {
logger.info("Closing all sync producers");
if (sync) {
for (SyncProducer p : syncProducers.values()) {
p.close();
}
} else {
for (AsyncProducer<V> p : asyncProducers.values()) {
p.close();
}
... | java | public void close() {
logger.info("Closing all sync producers");
if (sync) {
for (SyncProducer p : syncProducers.values()) {
p.close();
}
} else {
for (AsyncProducer<V> p : asyncProducers.values()) {
p.close();
}
... | [
"public",
"void",
"close",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Closing all sync producers\"",
")",
";",
"if",
"(",
"sync",
")",
"{",
"for",
"(",
"SyncProducer",
"p",
":",
"syncProducers",
".",
"values",
"(",
")",
")",
"{",
"p",
".",
"close",
... | Closes all the producers in the pool | [
"Closes",
"all",
"the",
"producers",
"in",
"the",
"pool"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/producer/ProducerPool.java#L226-L238 |
160,517 | adyliu/jafka | src/main/java/io/jafka/producer/ProducerPool.java | ProducerPool.getProducerPoolData | public ProducerPoolData<V> getProducerPoolData(String topic, Partition bidPid, List<V> data) {
return new ProducerPoolData<V>(topic, bidPid, data);
} | java | public ProducerPoolData<V> getProducerPoolData(String topic, Partition bidPid, List<V> data) {
return new ProducerPoolData<V>(topic, bidPid, data);
} | [
"public",
"ProducerPoolData",
"<",
"V",
">",
"getProducerPoolData",
"(",
"String",
"topic",
",",
"Partition",
"bidPid",
",",
"List",
"<",
"V",
">",
"data",
")",
"{",
"return",
"new",
"ProducerPoolData",
"<",
"V",
">",
"(",
"topic",
",",
"bidPid",
",",
"d... | This constructs and returns the request object for the producer pool
@param topic the topic to which the data should be published
@param bidPid the broker id and partition id
@param data the data to be published
@return producer data of builder | [
"This",
"constructs",
"and",
"returns",
"the",
"request",
"object",
"for",
"the",
"producer",
"pool"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/producer/ProducerPool.java#L248-L250 |
160,518 | adyliu/jafka | src/main/java/io/jafka/api/ProducerRequest.java | ProducerRequest.readFrom | public static ProducerRequest readFrom(ByteBuffer buffer) {
String topic = Utils.readShortString(buffer);
int partition = buffer.getInt();
int messageSetSize = buffer.getInt();
ByteBuffer messageSetBuffer = buffer.slice();
messageSetBuffer.limit(messageSetSize);
buffer.po... | java | public static ProducerRequest readFrom(ByteBuffer buffer) {
String topic = Utils.readShortString(buffer);
int partition = buffer.getInt();
int messageSetSize = buffer.getInt();
ByteBuffer messageSetBuffer = buffer.slice();
messageSetBuffer.limit(messageSetSize);
buffer.po... | [
"public",
"static",
"ProducerRequest",
"readFrom",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"String",
"topic",
"=",
"Utils",
".",
"readShortString",
"(",
"buffer",
")",
";",
"int",
"partition",
"=",
"buffer",
".",
"getInt",
"(",
")",
";",
"int",
"messageSetSiz... | read a producer request from buffer
@param buffer data buffer
@return parsed producer request | [
"read",
"a",
"producer",
"request",
"from",
"buffer"
] | cc14d2ed60c039b12d7b106bb5269ef21d0add7e | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/api/ProducerRequest.java#L57-L65 |
160,519 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandTemplate.java | CommandTemplate.getExpectedMessage | protected String getExpectedMessage() {
StringBuilder syntax = new StringBuilder("<tag> ");
syntax.append(getName());
String args = getArgSyntax();
if (args != null && args.length() > 0) {
syntax.append(' ');
syntax.append(args);
}
retu... | java | protected String getExpectedMessage() {
StringBuilder syntax = new StringBuilder("<tag> ");
syntax.append(getName());
String args = getArgSyntax();
if (args != null && args.length() > 0) {
syntax.append(' ');
syntax.append(args);
}
retu... | [
"protected",
"String",
"getExpectedMessage",
"(",
")",
"{",
"StringBuilder",
"syntax",
"=",
"new",
"StringBuilder",
"(",
"\"<tag> \"",
")",
";",
"syntax",
".",
"append",
"(",
"getName",
"(",
")",
")",
";",
"String",
"args",
"=",
"getArgSyntax",
"(",
")",
"... | Provides a message which describes the expected format and arguments
for this command. This is used to provide user feedback when a command
request is malformed.
@return A message describing the command protocol format. | [
"Provides",
"a",
"message",
"which",
"describes",
"the",
"expected",
"format",
"and",
"arguments",
"for",
"this",
"command",
".",
"This",
"is",
"used",
"to",
"provide",
"user",
"feedback",
"when",
"a",
"command",
"request",
"is",
"malformed",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandTemplate.java#L93-L104 |
160,520 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/ServerSetup.java | ServerSetup.createCopy | public ServerSetup createCopy(String bindAddress) {
ServerSetup setup = new ServerSetup(getPort(), bindAddress, getProtocol());
setup.setServerStartupTimeout(getServerStartupTimeout());
setup.setConnectionTimeout(getConnectionTimeout());
setup.setReadTimeout(getReadTimeout());
... | java | public ServerSetup createCopy(String bindAddress) {
ServerSetup setup = new ServerSetup(getPort(), bindAddress, getProtocol());
setup.setServerStartupTimeout(getServerStartupTimeout());
setup.setConnectionTimeout(getConnectionTimeout());
setup.setReadTimeout(getReadTimeout());
... | [
"public",
"ServerSetup",
"createCopy",
"(",
"String",
"bindAddress",
")",
"{",
"ServerSetup",
"setup",
"=",
"new",
"ServerSetup",
"(",
"getPort",
"(",
")",
",",
"bindAddress",
",",
"getProtocol",
"(",
")",
")",
";",
"setup",
".",
"setServerStartupTimeout",
"("... | Create a deep copy.
@param bindAddress overwrites bind address when creating deep copy.
@return a copy of the server setup configuration. | [
"Create",
"a",
"deep",
"copy",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/ServerSetup.java#L300-L309 |
160,521 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/ServerSetup.java | ServerSetup.verbose | public static ServerSetup[] verbose(ServerSetup[] serverSetups) {
ServerSetup[] copies = new ServerSetup[serverSetups.length];
for (int i = 0; i < serverSetups.length; i++) {
copies[i] = serverSetups[i].createCopy().setVerbose(true);
}
return copies;
} | java | public static ServerSetup[] verbose(ServerSetup[] serverSetups) {
ServerSetup[] copies = new ServerSetup[serverSetups.length];
for (int i = 0; i < serverSetups.length; i++) {
copies[i] = serverSetups[i].createCopy().setVerbose(true);
}
return copies;
} | [
"public",
"static",
"ServerSetup",
"[",
"]",
"verbose",
"(",
"ServerSetup",
"[",
"]",
"serverSetups",
")",
"{",
"ServerSetup",
"[",
"]",
"copies",
"=",
"new",
"ServerSetup",
"[",
"serverSetups",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Creates a copy with verbose mode enabled.
@param serverSetups the server setups.
@return copies of server setups with verbose mode enabled. | [
"Creates",
"a",
"copy",
"with",
"verbose",
"mode",
"enabled",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/ServerSetup.java#L317-L323 |
160,522 | greenmail-mail-test/greenmail | greenmail-standalone/src/main/java/com/icegreen/greenmail/standalone/GreenMailStandaloneRunner.java | GreenMailStandaloneRunner.doRun | public void doRun(Properties properties) {
ServerSetup[] serverSetup = new PropertiesBasedServerSetupBuilder().build(properties);
if (serverSetup.length == 0) {
printUsage(System.out);
} else {
greenMail = new GreenMail(serverSetup);
log.info("Starting Green... | java | public void doRun(Properties properties) {
ServerSetup[] serverSetup = new PropertiesBasedServerSetupBuilder().build(properties);
if (serverSetup.length == 0) {
printUsage(System.out);
} else {
greenMail = new GreenMail(serverSetup);
log.info("Starting Green... | [
"public",
"void",
"doRun",
"(",
"Properties",
"properties",
")",
"{",
"ServerSetup",
"[",
"]",
"serverSetup",
"=",
"new",
"PropertiesBasedServerSetupBuilder",
"(",
")",
".",
"build",
"(",
"properties",
")",
";",
"if",
"(",
"serverSetup",
".",
"length",
"==",
... | Start and configure GreenMail using given properties.
@param properties the properties such as System.getProperties() | [
"Start",
"and",
"configure",
"GreenMail",
"using",
"given",
"properties",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-standalone/src/main/java/com/icegreen/greenmail/standalone/GreenMailStandaloneRunner.java#L34-L47 |
160,523 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/mail/MailAddress.java | MailAddress.decodeStr | private String decodeStr(String str) {
try {
return MimeUtility.decodeText(str);
} catch (UnsupportedEncodingException e) {
return str;
}
} | java | private String decodeStr(String str) {
try {
return MimeUtility.decodeText(str);
} catch (UnsupportedEncodingException e) {
return str;
}
} | [
"private",
"String",
"decodeStr",
"(",
"String",
"str",
")",
"{",
"try",
"{",
"return",
"MimeUtility",
".",
"decodeText",
"(",
"str",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",
"return",
"str",
";",
"}",
"}"
] | Returns the decoded string, in case it contains non us-ascii characters.
Returns the same string if it doesn't or the passed value in case
of an UnsupportedEncodingException.
@param str string to be decoded
@return the decoded string, in case it contains non us-ascii characters;
or the same string if it doesn't or the... | [
"Returns",
"the",
"decoded",
"string",
"in",
"case",
"it",
"contains",
"non",
"us",
"-",
"ascii",
"characters",
".",
"Returns",
"the",
"same",
"string",
"if",
"it",
"doesn",
"t",
"or",
"the",
"passed",
"value",
"in",
"case",
"of",
"an",
"UnsupportedEncodin... | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/mail/MailAddress.java#L72-L78 |
160,524 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.copyStream | public static void copyStream(final InputStream src, OutputStream dest) throws IOException {
byte[] buffer = new byte[1024];
int read;
while ((read = src.read(buffer)) > -1) {
dest.write(buffer, 0, read);
}
dest.flush();
} | java | public static void copyStream(final InputStream src, OutputStream dest) throws IOException {
byte[] buffer = new byte[1024];
int read;
while ((read = src.read(buffer)) > -1) {
dest.write(buffer, 0, read);
}
dest.flush();
} | [
"public",
"static",
"void",
"copyStream",
"(",
"final",
"InputStream",
"src",
",",
"OutputStream",
"dest",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"1024",
"]",
";",
"int",
"read",
";",
"while",
"(",
"(",
... | Writes the content of an input stream to an output stream
@throws IOException | [
"Writes",
"the",
"content",
"of",
"an",
"input",
"stream",
"to",
"an",
"output",
"stream"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L56-L63 |
160,525 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.getLineCount | public static int getLineCount(String str) {
if (null == str || str.isEmpty()) {
return 0;
}
int count = 1;
for (char c : str.toCharArray()) {
if ('\n' == c) {
count++;
}
}
return count;
} | java | public static int getLineCount(String str) {
if (null == str || str.isEmpty()) {
return 0;
}
int count = 1;
for (char c : str.toCharArray()) {
if ('\n' == c) {
count++;
}
}
return count;
} | [
"public",
"static",
"int",
"getLineCount",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"null",
"==",
"str",
"||",
"str",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"int",
"count",
"=",
"1",
";",
"for",
"(",
"char",
"c",
":",
"s... | Counts the number of lines.
@param str the input string
@return Returns the number of lines terminated by '\n' in string | [
"Counts",
"the",
"number",
"of",
"lines",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L113-L124 |
160,526 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.sendTextEmail | public static void sendTextEmail(String to, String from, String subject, String msg, final ServerSetup setup) {
sendMimeMessage(createTextEmail(to, from, subject, msg, setup));
} | java | public static void sendTextEmail(String to, String from, String subject, String msg, final ServerSetup setup) {
sendMimeMessage(createTextEmail(to, from, subject, msg, setup));
} | [
"public",
"static",
"void",
"sendTextEmail",
"(",
"String",
"to",
",",
"String",
"from",
",",
"String",
"subject",
",",
"String",
"msg",
",",
"final",
"ServerSetup",
"setup",
")",
"{",
"sendMimeMessage",
"(",
"createTextEmail",
"(",
"to",
",",
"from",
",",
... | Sends a text message using given server setup for SMTP.
@param to the to address.
@param from the from address.
@param subject the subject.
@param msg the test message.
@param setup the SMTP setup. | [
"Sends",
"a",
"text",
"message",
"using",
"given",
"server",
"setup",
"for",
"SMTP",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L262-L264 |
160,527 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.sendMimeMessage | public static void sendMimeMessage(MimeMessage mimeMessage) {
try {
Transport.send(mimeMessage);
} catch (MessagingException e) {
throw new IllegalStateException("Can not send message " + mimeMessage, e);
}
} | java | public static void sendMimeMessage(MimeMessage mimeMessage) {
try {
Transport.send(mimeMessage);
} catch (MessagingException e) {
throw new IllegalStateException("Can not send message " + mimeMessage, e);
}
} | [
"public",
"static",
"void",
"sendMimeMessage",
"(",
"MimeMessage",
"mimeMessage",
")",
"{",
"try",
"{",
"Transport",
".",
"send",
"(",
"mimeMessage",
")",
";",
"}",
"catch",
"(",
"MessagingException",
"e",
")",
"{",
"throw",
"new",
"IllegalStateException",
"("... | Send the message using the JavaMail session defined in the message
@param mimeMessage Message to send | [
"Send",
"the",
"message",
"using",
"the",
"JavaMail",
"session",
"defined",
"in",
"the",
"message"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L271-L277 |
160,528 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.sendMessageBody | public static void sendMessageBody(String to, String from, String subject, Object body, String contentType, ServerSetup serverSetup) {
try {
Session smtpSession = getSession(serverSetup);
MimeMessage mimeMessage = new MimeMessage(smtpSession);
mimeMessage.setRecipients(... | java | public static void sendMessageBody(String to, String from, String subject, Object body, String contentType, ServerSetup serverSetup) {
try {
Session smtpSession = getSession(serverSetup);
MimeMessage mimeMessage = new MimeMessage(smtpSession);
mimeMessage.setRecipients(... | [
"public",
"static",
"void",
"sendMessageBody",
"(",
"String",
"to",
",",
"String",
"from",
",",
"String",
"subject",
",",
"Object",
"body",
",",
"String",
"contentType",
",",
"ServerSetup",
"serverSetup",
")",
"{",
"try",
"{",
"Session",
"smtpSession",
"=",
... | Send the message with the given attributes and the given body using the specified SMTP settings
@param to Destination address(es)
@param from Sender address
@param subject Message subject
@param body Message content. May either be a MimeMultipart or another body that java mail recognizes
@pa... | [
"Send",
"the",
"message",
"with",
"the",
"given",
"attributes",
"and",
"the",
"given",
"body",
"using",
"the",
"specified",
"SMTP",
"settings"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L289-L302 |
160,529 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.createMultipartWithAttachment | public static MimeMultipart createMultipartWithAttachment(String msg, final byte[] attachment, final String contentType,
final String filename, String description) {
try {
MimeMultipart multiPart = new MimeMultipart();
... | java | public static MimeMultipart createMultipartWithAttachment(String msg, final byte[] attachment, final String contentType,
final String filename, String description) {
try {
MimeMultipart multiPart = new MimeMultipart();
... | [
"public",
"static",
"MimeMultipart",
"createMultipartWithAttachment",
"(",
"String",
"msg",
",",
"final",
"byte",
"[",
"]",
"attachment",
",",
"final",
"String",
"contentType",
",",
"final",
"String",
"filename",
",",
"String",
"description",
")",
"{",
"try",
"{... | Create new multipart with a text part and an attachment
@param msg Message text
@param attachment Attachment data
@param contentType MIME content type of body
@param filename File name of the attachment
@param description Description of the attachment
@return New multipart | [
"Create",
"new",
"multipart",
"with",
"a",
"text",
"part",
"and",
"an",
"attachment"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L322-L364 |
160,530 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.getSession | public static Session getSession(final ServerSetup setup, Properties mailProps) {
Properties props = setup.configureJavaMailSessionProperties(mailProps, false);
log.debug("Mail session properties are {}", props);
return Session.getInstance(props, null);
} | java | public static Session getSession(final ServerSetup setup, Properties mailProps) {
Properties props = setup.configureJavaMailSessionProperties(mailProps, false);
log.debug("Mail session properties are {}", props);
return Session.getInstance(props, null);
} | [
"public",
"static",
"Session",
"getSession",
"(",
"final",
"ServerSetup",
"setup",
",",
"Properties",
"mailProps",
")",
"{",
"Properties",
"props",
"=",
"setup",
".",
"configureJavaMailSessionProperties",
"(",
"mailProps",
",",
"false",
")",
";",
"log",
".",
"de... | Gets a JavaMail Session for given server type such as IMAP and additional props for JavaMail.
@param setup the setup type, such as <code>ServerSetup.IMAP</code>
@param mailProps additional mail properties.
@return the JavaMail session. | [
"Gets",
"a",
"JavaMail",
"Session",
"for",
"given",
"server",
"type",
"such",
"as",
"IMAP",
"and",
"additional",
"props",
"for",
"JavaMail",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L377-L383 |
160,531 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.setQuota | public static void setQuota(final GreenMailUser user, final Quota quota) {
Session session = GreenMailUtil.getSession(ServerSetupTest.IMAP);
try {
Store store = session.getStore("imap");
store.connect(user.getEmail(), user.getPassword());
try {
(... | java | public static void setQuota(final GreenMailUser user, final Quota quota) {
Session session = GreenMailUtil.getSession(ServerSetupTest.IMAP);
try {
Store store = session.getStore("imap");
store.connect(user.getEmail(), user.getPassword());
try {
(... | [
"public",
"static",
"void",
"setQuota",
"(",
"final",
"GreenMailUser",
"user",
",",
"final",
"Quota",
"quota",
")",
"{",
"Session",
"session",
"=",
"GreenMailUtil",
".",
"getSession",
"(",
"ServerSetupTest",
".",
"IMAP",
")",
";",
"try",
"{",
"Store",
"store... | Sets a quota for a users.
@param user the user.
@param quota the quota. | [
"Sets",
"a",
"quota",
"for",
"a",
"users",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L391-L405 |
160,532 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/user/UserManager.java | UserManager.hasUser | public boolean hasUser(String userId) {
String normalized = normalizerUserName(userId);
return loginToUser.containsKey(normalized) || emailToUser.containsKey(normalized);
} | java | public boolean hasUser(String userId) {
String normalized = normalizerUserName(userId);
return loginToUser.containsKey(normalized) || emailToUser.containsKey(normalized);
} | [
"public",
"boolean",
"hasUser",
"(",
"String",
"userId",
")",
"{",
"String",
"normalized",
"=",
"normalizerUserName",
"(",
"userId",
")",
";",
"return",
"loginToUser",
".",
"containsKey",
"(",
"normalized",
")",
"||",
"emailToUser",
".",
"containsKey",
"(",
"n... | Checks if user exists.
@param userId the user id, which can be an email or the login.
@return true, if user exists. | [
"Checks",
"if",
"user",
"exists",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/user/UserManager.java#L110-L113 |
160,533 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/server/AbstractServer.java | AbstractServer.closeServerSocket | protected void closeServerSocket() {
// Close server socket, we do not accept new requests anymore.
// This also terminates the server thread if blocking on socket.accept.
if (null != serverSocket) {
try {
if (!serverSocket.isClosed()) {
serverSock... | java | protected void closeServerSocket() {
// Close server socket, we do not accept new requests anymore.
// This also terminates the server thread if blocking on socket.accept.
if (null != serverSocket) {
try {
if (!serverSocket.isClosed()) {
serverSock... | [
"protected",
"void",
"closeServerSocket",
"(",
")",
"{",
"// Close server socket, we do not accept new requests anymore.",
"// This also terminates the server thread if blocking on socket.accept.",
"if",
"(",
"null",
"!=",
"serverSocket",
")",
"{",
"try",
"{",
"if",
"(",
"!",
... | Closes the server socket. | [
"Closes",
"the",
"server",
"socket",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/server/AbstractServer.java#L126-L143 |
160,534 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/server/AbstractServer.java | AbstractServer.quit | protected synchronized void quit() {
log.debug("Stopping {}", getName());
closeServerSocket();
// Close all handlers. Handler threads terminate if run loop exits
synchronized (handlers) {
for (ProtocolHandler handler : handlers) {
handler.close();
... | java | protected synchronized void quit() {
log.debug("Stopping {}", getName());
closeServerSocket();
// Close all handlers. Handler threads terminate if run loop exits
synchronized (handlers) {
for (ProtocolHandler handler : handlers) {
handler.close();
... | [
"protected",
"synchronized",
"void",
"quit",
"(",
")",
"{",
"log",
".",
"debug",
"(",
"\"Stopping {}\"",
",",
"getName",
"(",
")",
")",
";",
"closeServerSocket",
"(",
")",
";",
"// Close all handlers. Handler threads terminate if run loop exits",
"synchronized",
"(",
... | Quits server by closing server socket and closing client socket handlers. | [
"Quits",
"server",
"by",
"closing",
"server",
"socket",
"and",
"closing",
"client",
"socket",
"handlers",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/server/AbstractServer.java#L186-L198 |
160,535 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/server/AbstractServer.java | AbstractServer.stopService | @Override
public final synchronized void stopService(long millis) {
running = false;
try {
if (keepRunning) {
keepRunning = false;
interrupt();
quit();
if (0L == millis) {
join();
} else {... | java | @Override
public final synchronized void stopService(long millis) {
running = false;
try {
if (keepRunning) {
keepRunning = false;
interrupt();
quit();
if (0L == millis) {
join();
} else {... | [
"@",
"Override",
"public",
"final",
"synchronized",
"void",
"stopService",
"(",
"long",
"millis",
")",
"{",
"running",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"keepRunning",
")",
"{",
"keepRunning",
"=",
"false",
";",
"interrupt",
"(",
")",
";",
"quit"... | Stops the service. If a timeout is given and the service has still not
gracefully been stopped after timeout ms the service is stopped by force.
@param millis value in ms | [
"Stops",
"the",
"service",
".",
"If",
"a",
"timeout",
"is",
"given",
"and",
"the",
"service",
"has",
"still",
"not",
"gracefully",
"been",
"stopped",
"after",
"timeout",
"ms",
"the",
"service",
"is",
"stopped",
"by",
"force",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/server/AbstractServer.java#L255-L275 |
160,536 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java | SimpleMessageAttributes.getSentDate | private static Date getSentDate(MimeMessage msg, Date defaultVal) {
if (msg == null) {
return defaultVal;
}
try {
Date sentDate = msg.getSentDate();
if (sentDate == null) {
return defaultVal;
} else {
return... | java | private static Date getSentDate(MimeMessage msg, Date defaultVal) {
if (msg == null) {
return defaultVal;
}
try {
Date sentDate = msg.getSentDate();
if (sentDate == null) {
return defaultVal;
} else {
return... | [
"private",
"static",
"Date",
"getSentDate",
"(",
"MimeMessage",
"msg",
",",
"Date",
"defaultVal",
")",
"{",
"if",
"(",
"msg",
"==",
"null",
")",
"{",
"return",
"defaultVal",
";",
"}",
"try",
"{",
"Date",
"sentDate",
"=",
"msg",
".",
"getSentDate",
"(",
... | Compute "sent" date
@param msg Message to take sent date from. May be null to use default
@param defaultVal Default if sent date is not present
@return Sent date or now if no date could be found | [
"Compute",
"sent",
"date"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java#L102-L116 |
160,537 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java | SimpleMessageAttributes.parseEnvelope | private String parseEnvelope() {
List<String> response = new ArrayList<>();
//1. Date ---------------
response.add(LB + Q + sentDateEnvelopeString + Q + SP);
//2. Subject ---------------
if (subject != null && (subject.length() != 0)) {
response.add(Q + escapeHe... | java | private String parseEnvelope() {
List<String> response = new ArrayList<>();
//1. Date ---------------
response.add(LB + Q + sentDateEnvelopeString + Q + SP);
//2. Subject ---------------
if (subject != null && (subject.length() != 0)) {
response.add(Q + escapeHe... | [
"private",
"String",
"parseEnvelope",
"(",
")",
"{",
"List",
"<",
"String",
">",
"response",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"//1. Date ---------------\r",
"response",
".",
"add",
"(",
"LB",
"+",
"Q",
"+",
"sentDateEnvelopeString",
"+",
"Q",
... | Builds IMAP envelope String from pre-parsed data. | [
"Builds",
"IMAP",
"envelope",
"String",
"from",
"pre",
"-",
"parsed",
"data",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java#L276-L320 |
160,538 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java | SimpleMessageAttributes.parseAddress | private String parseAddress(String address) {
try {
StringBuilder buf = new StringBuilder();
InternetAddress[] netAddrs = InternetAddress.parseHeader(address, false);
for (InternetAddress netAddr : netAddrs) {
if (buf.length() > 0) {
... | java | private String parseAddress(String address) {
try {
StringBuilder buf = new StringBuilder();
InternetAddress[] netAddrs = InternetAddress.parseHeader(address, false);
for (InternetAddress netAddr : netAddrs) {
if (buf.length() > 0) {
... | [
"private",
"String",
"parseAddress",
"(",
"String",
"address",
")",
"{",
"try",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"InternetAddress",
"[",
"]",
"netAddrs",
"=",
"InternetAddress",
".",
"parseHeader",
"(",
"address",
",",
... | Parses a String email address to an IMAP address string. | [
"Parses",
"a",
"String",
"email",
"address",
"to",
"an",
"IMAP",
"address",
"string",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java#L361-L397 |
160,539 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java | SimpleMessageAttributes.decodeContentType | void decodeContentType(String rawLine) {
int slash = rawLine.indexOf('/');
if (slash == -1) {
// if (DEBUG) getLogger().debug("decoding ... no slash found");
return;
} else {
primaryType = rawLine.substring(0, slash).trim();
}
int semico... | java | void decodeContentType(String rawLine) {
int slash = rawLine.indexOf('/');
if (slash == -1) {
// if (DEBUG) getLogger().debug("decoding ... no slash found");
return;
} else {
primaryType = rawLine.substring(0, slash).trim();
}
int semico... | [
"void",
"decodeContentType",
"(",
"String",
"rawLine",
")",
"{",
"int",
"slash",
"=",
"rawLine",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"slash",
"==",
"-",
"1",
")",
"{",
"// if (DEBUG) getLogger().debug(\"decoding ... no slash found\");\r"... | Decode a content Type header line into types and parameters pairs | [
"Decode",
"a",
"content",
"Type",
"header",
"line",
"into",
"types",
"and",
"parameters",
"pairs"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/store/SimpleMessageAttributes.java#L402-L420 |
160,540 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/configuration/ConfiguredGreenMail.java | ConfiguredGreenMail.doConfigure | protected void doConfigure() {
if (config != null) {
for (UserBean user : config.getUsersToCreate()) {
setUser(user.getEmail(), user.getLogin(), user.getPassword());
}
getManagers().getUserManager().setAuthRequired(!config.isAuthenticationDisabled());
... | java | protected void doConfigure() {
if (config != null) {
for (UserBean user : config.getUsersToCreate()) {
setUser(user.getEmail(), user.getLogin(), user.getPassword());
}
getManagers().getUserManager().setAuthRequired(!config.isAuthenticationDisabled());
... | [
"protected",
"void",
"doConfigure",
"(",
")",
"{",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"for",
"(",
"UserBean",
"user",
":",
"config",
".",
"getUsersToCreate",
"(",
")",
")",
"{",
"setUser",
"(",
"user",
".",
"getEmail",
"(",
")",
",",
"user"... | This method can be used by child classes to apply the configuration that is stored in config. | [
"This",
"method",
"can",
"be",
"used",
"by",
"child",
"classes",
"to",
"apply",
"the",
"configuration",
"that",
"is",
"stored",
"in",
"config",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/configuration/ConfiguredGreenMail.java#L20-L27 |
160,541 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/InternetPrintWriter.java | InternetPrintWriter.createForEncoding | public static InternetPrintWriter createForEncoding(OutputStream outputStream, boolean autoFlush, Charset charset) {
return new InternetPrintWriter(new OutputStreamWriter(outputStream, charset), autoFlush);
} | java | public static InternetPrintWriter createForEncoding(OutputStream outputStream, boolean autoFlush, Charset charset) {
return new InternetPrintWriter(new OutputStreamWriter(outputStream, charset), autoFlush);
} | [
"public",
"static",
"InternetPrintWriter",
"createForEncoding",
"(",
"OutputStream",
"outputStream",
",",
"boolean",
"autoFlush",
",",
"Charset",
"charset",
")",
"{",
"return",
"new",
"InternetPrintWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"outputStream",
",",
"... | Creates a new InternetPrintWriter for given charset encoding.
@param outputStream the wrapped output stream.
@param charset the charset.
@return a new InternetPrintWriter. | [
"Creates",
"a",
"new",
"InternetPrintWriter",
"for",
"given",
"charset",
"encoding",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/InternetPrintWriter.java#L79-L81 |
160,542 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMail.java | GreenMail.createServices | protected Map<String, AbstractServer> createServices(ServerSetup[] config, Managers mgr) {
Map<String, AbstractServer> srvc = new HashMap<>();
for (ServerSetup setup : config) {
if (srvc.containsKey(setup.getProtocol())) {
throw new IllegalArgumentException("Server '" + s... | java | protected Map<String, AbstractServer> createServices(ServerSetup[] config, Managers mgr) {
Map<String, AbstractServer> srvc = new HashMap<>();
for (ServerSetup setup : config) {
if (srvc.containsKey(setup.getProtocol())) {
throw new IllegalArgumentException("Server '" + s... | [
"protected",
"Map",
"<",
"String",
",",
"AbstractServer",
">",
"createServices",
"(",
"ServerSetup",
"[",
"]",
"config",
",",
"Managers",
"mgr",
")",
"{",
"Map",
"<",
"String",
",",
"AbstractServer",
">",
"srvc",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";... | Create the required services according to the server setup
@param config Service configuration
@return Services map | [
"Create",
"the",
"required",
"services",
"according",
"to",
"the",
"server",
"setup"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMail.java#L138-L154 |
160,543 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapResponse.java | ImapResponse.okResponse | public void okResponse(String responseCode, String message) {
untagged();
message(OK);
responseCode(responseCode);
message(message);
end();
} | java | public void okResponse(String responseCode, String message) {
untagged();
message(OK);
responseCode(responseCode);
message(message);
end();
} | [
"public",
"void",
"okResponse",
"(",
"String",
"responseCode",
",",
"String",
"message",
")",
"{",
"untagged",
"(",
")",
";",
"message",
"(",
"OK",
")",
";",
"responseCode",
"(",
"responseCode",
")",
";",
"message",
"(",
"message",
")",
";",
"end",
"(",
... | Writes an untagged OK response, with the supplied response code,
and an optional message.
@param responseCode The response code, included in [].
@param message The message to follow the [] | [
"Writes",
"an",
"untagged",
"OK",
"response",
"with",
"the",
"supplied",
"response",
"code",
"and",
"an",
"optional",
"message",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapResponse.java#L129-L135 |
160,544 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapHandler.java | ImapHandler.close | @Override
public void close() {
// Use monitor to avoid race between external close and handler thread run()
synchronized (closeMonitor) {
// Close and clear streams, sockets etc.
if (socket != null) {
try {
// Terminates thread bloc... | java | @Override
public void close() {
// Use monitor to avoid race between external close and handler thread run()
synchronized (closeMonitor) {
// Close and clear streams, sockets etc.
if (socket != null) {
try {
// Terminates thread bloc... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"// Use monitor to avoid race between external close and handler thread run()\r",
"synchronized",
"(",
"closeMonitor",
")",
"{",
"// Close and clear streams, sockets etc.\r",
"if",
"(",
"socket",
"!=",
"null",
")",
... | Resets the handler data to a basic state. | [
"Resets",
"the",
"handler",
"data",
"to",
"a",
"basic",
"state",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapHandler.java#L85-L106 |
160,545 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/EncodingUtil.java | EncodingUtil.toStream | public static InputStream toStream(String content, Charset charset) {
byte[] bytes = content.getBytes(charset);
return new ByteArrayInputStream(bytes);
} | java | public static InputStream toStream(String content, Charset charset) {
byte[] bytes = content.getBytes(charset);
return new ByteArrayInputStream(bytes);
} | [
"public",
"static",
"InputStream",
"toStream",
"(",
"String",
"content",
",",
"Charset",
"charset",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"content",
".",
"getBytes",
"(",
"charset",
")",
";",
"return",
"new",
"ByteArrayInputStream",
"(",
"bytes",
")",
... | Converts the string of given content to an input stream.
@param content the string content.
@param charset the charset for conversion.
@return the stream (should be closed by invoker). | [
"Converts",
"the",
"string",
"of",
"given",
"content",
"to",
"an",
"input",
"stream",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/EncodingUtil.java#L33-L36 |
160,546 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilder.java | PropertiesBasedGreenMailConfigurationBuilder.build | public GreenMailConfiguration build(Properties properties) {
GreenMailConfiguration configuration = new GreenMailConfiguration();
String usersParam = properties.getProperty(GREENMAIL_USERS);
if (null != usersParam) {
String[] usersArray = usersParam.split(",");
for (Strin... | java | public GreenMailConfiguration build(Properties properties) {
GreenMailConfiguration configuration = new GreenMailConfiguration();
String usersParam = properties.getProperty(GREENMAIL_USERS);
if (null != usersParam) {
String[] usersArray = usersParam.split(",");
for (Strin... | [
"public",
"GreenMailConfiguration",
"build",
"(",
"Properties",
"properties",
")",
"{",
"GreenMailConfiguration",
"configuration",
"=",
"new",
"GreenMailConfiguration",
"(",
")",
";",
"String",
"usersParam",
"=",
"properties",
".",
"getProperty",
"(",
"GREENMAIL_USERS",... | Builds a configuration object based on given properties.
@param properties the properties.
@return a configuration and never null. | [
"Builds",
"a",
"configuration",
"object",
"based",
"on",
"given",
"properties",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/configuration/PropertiesBasedGreenMailConfigurationBuilder.java#L36-L50 |
160,547 | greenmail-mail-test/greenmail | greenmail-spring/src/main/java/com/icegreen/greenmail/spring/GreenMailBean.java | GreenMailBean.createServerSetup | private ServerSetup[] createServerSetup() {
List<ServerSetup> setups = new ArrayList<>();
if (smtpProtocol) {
smtpServerSetup = createTestServerSetup(ServerSetup.SMTP);
setups.add(smtpServerSetup);
}
if (smtpsProtocol) {
smtpsServerSetup = createTestSe... | java | private ServerSetup[] createServerSetup() {
List<ServerSetup> setups = new ArrayList<>();
if (smtpProtocol) {
smtpServerSetup = createTestServerSetup(ServerSetup.SMTP);
setups.add(smtpServerSetup);
}
if (smtpsProtocol) {
smtpsServerSetup = createTestSe... | [
"private",
"ServerSetup",
"[",
"]",
"createServerSetup",
"(",
")",
"{",
"List",
"<",
"ServerSetup",
">",
"setups",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"smtpProtocol",
")",
"{",
"smtpServerSetup",
"=",
"createTestServerSetup",
"(",
"Serve... | Creates the server setup, depending on the protocol flags.
@return the configured server setups. | [
"Creates",
"the",
"server",
"setup",
"depending",
"on",
"the",
"protocol",
"flags",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-spring/src/main/java/com/icegreen/greenmail/spring/GreenMailBean.java#L102-L125 |
160,548 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.tag | public String tag(ImapRequestLineReader request) throws ProtocolException {
CharacterValidator validator = new TagCharValidator();
return consumeWord(request, validator);
} | java | public String tag(ImapRequestLineReader request) throws ProtocolException {
CharacterValidator validator = new TagCharValidator();
return consumeWord(request, validator);
} | [
"public",
"String",
"tag",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"CharacterValidator",
"validator",
"=",
"new",
"TagCharValidator",
"(",
")",
";",
"return",
"consumeWord",
"(",
"request",
",",
"validator",
")",
";",
"}"
... | Reads a command "tag" from the request. | [
"Reads",
"a",
"command",
"tag",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L47-L50 |
160,549 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.astring | public String astring(ImapRequestLineReader request) throws ProtocolException {
char next = request.nextWordChar();
switch (next) {
case '"':
return consumeQuoted(request);
case '{':
return consumeLiteral(request);
default:
... | java | public String astring(ImapRequestLineReader request) throws ProtocolException {
char next = request.nextWordChar();
switch (next) {
case '"':
return consumeQuoted(request);
case '{':
return consumeLiteral(request);
default:
... | [
"public",
"String",
"astring",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"char",
"next",
"=",
"request",
".",
"nextWordChar",
"(",
")",
";",
"switch",
"(",
"next",
")",
"{",
"case",
"'",
"'",
":",
"return",
"consumeQuo... | Reads an argument of type "astring" from the request. | [
"Reads",
"an",
"argument",
"of",
"type",
"astring",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L55-L65 |
160,550 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.nstring | public String nstring(ImapRequestLineReader request) throws ProtocolException {
char next = request.nextWordChar();
switch (next) {
case '"':
return consumeQuoted(request);
case '{':
return consumeLiteral(request);
default:
... | java | public String nstring(ImapRequestLineReader request) throws ProtocolException {
char next = request.nextWordChar();
switch (next) {
case '"':
return consumeQuoted(request);
case '{':
return consumeLiteral(request);
default:
... | [
"public",
"String",
"nstring",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"char",
"next",
"=",
"request",
".",
"nextWordChar",
"(",
")",
";",
"switch",
"(",
"next",
")",
"{",
"case",
"'",
"'",
":",
"return",
"consumeQuo... | Reads an argument of type "nstring" from the request. | [
"Reads",
"an",
"argument",
"of",
"type",
"nstring",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L70-L85 |
160,551 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.dateTime | public Date dateTime(ImapRequestLineReader request) throws ProtocolException {
char next = request.nextWordChar();
String dateString;
// From https://tools.ietf.org/html/rfc3501 :
// date-time = DQUOTE date-day-fixed "-" date-month "-" date-year
// SP time... | java | public Date dateTime(ImapRequestLineReader request) throws ProtocolException {
char next = request.nextWordChar();
String dateString;
// From https://tools.ietf.org/html/rfc3501 :
// date-time = DQUOTE date-day-fixed "-" date-month "-" date-year
// SP time... | [
"public",
"Date",
"dateTime",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"char",
"next",
"=",
"request",
".",
"nextWordChar",
"(",
")",
";",
"String",
"dateString",
";",
"// From https://tools.ietf.org/html/rfc3501 :",
"// date-tim... | Reads a "date-time" argument from the request. | [
"Reads",
"a",
"date",
"-",
"time",
"argument",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L109-L128 |
160,552 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.consumeWord | protected String consumeWord(ImapRequestLineReader request,
CharacterValidator validator)
throws ProtocolException {
StringBuilder atom = new StringBuilder();
char next = request.nextWordChar();
while (!isWhitespace(next)) {
if (validator... | java | protected String consumeWord(ImapRequestLineReader request,
CharacterValidator validator)
throws ProtocolException {
StringBuilder atom = new StringBuilder();
char next = request.nextWordChar();
while (!isWhitespace(next)) {
if (validator... | [
"protected",
"String",
"consumeWord",
"(",
"ImapRequestLineReader",
"request",
",",
"CharacterValidator",
"validator",
")",
"throws",
"ProtocolException",
"{",
"StringBuilder",
"atom",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"char",
"next",
"=",
"request",
".",
... | Reads the next "word from the request, comprising all characters up to the next SPACE.
Characters are tested by the supplied CharacterValidator, and an exception is thrown
if invalid characters are encountered. | [
"Reads",
"the",
"next",
"word",
"from",
"the",
"request",
"comprising",
"all",
"characters",
"up",
"to",
"the",
"next",
"SPACE",
".",
"Characters",
"are",
"tested",
"by",
"the",
"supplied",
"CharacterValidator",
"and",
"an",
"exception",
"is",
"thrown",
"if",
... | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L135-L151 |
160,553 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.consumeChar | protected void consumeChar(ImapRequestLineReader request, char expected)
throws ProtocolException {
char consumed = request.consume();
if (consumed != expected) {
throw new ProtocolException("Expected:'" + expected + "' found:'" + consumed + '\'');
}
} | java | protected void consumeChar(ImapRequestLineReader request, char expected)
throws ProtocolException {
char consumed = request.consume();
if (consumed != expected) {
throw new ProtocolException("Expected:'" + expected + "' found:'" + consumed + '\'');
}
} | [
"protected",
"void",
"consumeChar",
"(",
"ImapRequestLineReader",
"request",
",",
"char",
"expected",
")",
"throws",
"ProtocolException",
"{",
"char",
"consumed",
"=",
"request",
".",
"consume",
"(",
")",
";",
"if",
"(",
"consumed",
"!=",
"expected",
")",
"{",... | Consumes the next character in the request, checking that it matches the
expected one. This method should be used when the | [
"Consumes",
"the",
"next",
"character",
"in",
"the",
"request",
"checking",
"that",
"it",
"matches",
"the",
"expected",
"one",
".",
"This",
"method",
"should",
"be",
"used",
"when",
"the"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L237-L243 |
160,554 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.consumeQuoted | protected String consumeQuoted(ImapRequestLineReader request)
throws ProtocolException {
// The 1st character must be '"'
consumeChar(request, '"');
StringBuilder quoted = new StringBuilder();
char next = request.nextChar();
while (next != '"') {
if (next... | java | protected String consumeQuoted(ImapRequestLineReader request)
throws ProtocolException {
// The 1st character must be '"'
consumeChar(request, '"');
StringBuilder quoted = new StringBuilder();
char next = request.nextChar();
while (next != '"') {
if (next... | [
"protected",
"String",
"consumeQuoted",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"// The 1st character must be '\"'",
"consumeChar",
"(",
"request",
",",
"'",
"'",
")",
";",
"StringBuilder",
"quoted",
"=",
"new",
"StringBuilder",... | Reads a quoted string value from the request. | [
"Reads",
"a",
"quoted",
"string",
"value",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L248-L272 |
160,555 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.flagList | public Flags flagList(ImapRequestLineReader request) throws ProtocolException {
Flags flags = new Flags();
request.nextWordChar();
consumeChar(request, '(');
CharacterValidator validator = new NoopCharValidator();
String nextWord = consumeWord(request, validator);
while (... | java | public Flags flagList(ImapRequestLineReader request) throws ProtocolException {
Flags flags = new Flags();
request.nextWordChar();
consumeChar(request, '(');
CharacterValidator validator = new NoopCharValidator();
String nextWord = consumeWord(request, validator);
while (... | [
"public",
"Flags",
"flagList",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"Flags",
"flags",
"=",
"new",
"Flags",
"(",
")",
";",
"request",
".",
"nextWordChar",
"(",
")",
";",
"consumeChar",
"(",
"request",
",",
"'",
"'"... | Reads a "flags" argument from the request. | [
"Reads",
"a",
"flags",
"argument",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L277-L293 |
160,556 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.number | public long number(ImapRequestLineReader request) throws ProtocolException {
String digits = consumeWord(request, new DigitCharValidator());
return Long.parseLong(digits);
} | java | public long number(ImapRequestLineReader request) throws ProtocolException {
String digits = consumeWord(request, new DigitCharValidator());
return Long.parseLong(digits);
} | [
"public",
"long",
"number",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"String",
"digits",
"=",
"consumeWord",
"(",
"request",
",",
"new",
"DigitCharValidator",
"(",
")",
")",
";",
"return",
"Long",
".",
"parseLong",
"(",
... | Reads an argument of type "number" from the request. | [
"Reads",
"an",
"argument",
"of",
"type",
"number",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L317-L320 |
160,557 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.parseIdRange | public IdRange[] parseIdRange(ImapRequestLineReader request)
throws ProtocolException {
CharacterValidator validator = new MessageSetCharValidator();
String nextWord = consumeWord(request, validator);
int commaPos = nextWord.indexOf(',');
if (commaPos == -1) {
re... | java | public IdRange[] parseIdRange(ImapRequestLineReader request)
throws ProtocolException {
CharacterValidator validator = new MessageSetCharValidator();
String nextWord = consumeWord(request, validator);
int commaPos = nextWord.indexOf(',');
if (commaPos == -1) {
re... | [
"public",
"IdRange",
"[",
"]",
"parseIdRange",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"CharacterValidator",
"validator",
"=",
"new",
"MessageSetCharValidator",
"(",
")",
";",
"String",
"nextWord",
"=",
"consumeWord",
"(",
"... | Reads a "message set" argument, and parses into an IdSet.
Currently only supports a single range of values. | [
"Reads",
"a",
"message",
"set",
"argument",
"and",
"parses",
"into",
"an",
"IdSet",
".",
"Currently",
"only",
"supports",
"a",
"single",
"range",
"of",
"values",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L372-L395 |
160,558 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/PropertiesBasedServerSetupBuilder.java | PropertiesBasedServerSetupBuilder.build | public ServerSetup[] build(Properties properties) {
List<ServerSetup> serverSetups = new ArrayList<>();
String hostname = properties.getProperty("greenmail.hostname", ServerSetup.getLocalHostAddress());
long serverStartupTimeout =
Long.parseLong(properties.getProperty("greenmail... | java | public ServerSetup[] build(Properties properties) {
List<ServerSetup> serverSetups = new ArrayList<>();
String hostname = properties.getProperty("greenmail.hostname", ServerSetup.getLocalHostAddress());
long serverStartupTimeout =
Long.parseLong(properties.getProperty("greenmail... | [
"public",
"ServerSetup",
"[",
"]",
"build",
"(",
"Properties",
"properties",
")",
"{",
"List",
"<",
"ServerSetup",
">",
"serverSetups",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"String",
"hostname",
"=",
"properties",
".",
"getProperty",
"(",
"\"greenma... | Creates a server setup based on provided properties.
@param properties the properties.
@return the server setup, or an empty array. | [
"Creates",
"a",
"server",
"setup",
"based",
"on",
"provided",
"properties",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/PropertiesBasedServerSetupBuilder.java#L58-L86 |
160,559 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/store/MessageFlags.java | MessageFlags.format | public static String format(Flags flags) {
StringBuilder buf = new StringBuilder();
buf.append('(');
if (flags.contains(Flags.Flag.ANSWERED)) {
buf.append("\\Answered ");
}
if (flags.contains(Flags.Flag.DELETED)) {
buf.append("\\Deleted ");
... | java | public static String format(Flags flags) {
StringBuilder buf = new StringBuilder();
buf.append('(');
if (flags.contains(Flags.Flag.ANSWERED)) {
buf.append("\\Answered ");
}
if (flags.contains(Flags.Flag.DELETED)) {
buf.append("\\Deleted ");
... | [
"public",
"static",
"String",
"format",
"(",
"Flags",
"flags",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"buf",
".",
"append",
"(",
"'",
"'",
")",
";",
"if",
"(",
"flags",
".",
"contains",
"(",
"Flags",
".",
"Flag"... | Returns IMAP formatted String of MessageFlags for named user | [
"Returns",
"IMAP",
"formatted",
"String",
"of",
"MessageFlags",
"for",
"named",
"user"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/store/MessageFlags.java#L47-L80 |
160,560 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java | ImapRequestLineReader.eol | public void eol() throws ProtocolException {
char next = nextChar();
// Ignore trailing spaces.
while (next == ' ') {
consume();
next = nextChar();
}
// handle DOS and unix end-of-lines
if (next == '\r') {
consume();
... | java | public void eol() throws ProtocolException {
char next = nextChar();
// Ignore trailing spaces.
while (next == ' ') {
consume();
next = nextChar();
}
// handle DOS and unix end-of-lines
if (next == '\r') {
consume();
... | [
"public",
"void",
"eol",
"(",
")",
"throws",
"ProtocolException",
"{",
"char",
"next",
"=",
"nextChar",
"(",
")",
";",
"// Ignore trailing spaces.\r",
"while",
"(",
"next",
"==",
"'",
"'",
")",
"{",
"consume",
"(",
")",
";",
"next",
"=",
"nextChar",
"(",... | Moves the request line reader to end of the line, checking that no non-space
character are found.
@throws ProtocolException If more non-space tokens are found in this line,
or the end-of-file is reached. | [
"Moves",
"the",
"request",
"line",
"reader",
"to",
"end",
"of",
"the",
"line",
"checking",
"that",
"no",
"non",
"-",
"space",
"character",
"are",
"found",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java#L104-L124 |
160,561 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java | ImapRequestLineReader.read | public void read(byte[] holder) throws ProtocolException {
int readTotal = 0;
try {
while (readTotal < holder.length) {
int count = input.read(holder, readTotal, holder.length - readTotal);
if (count == -1) {
throw new ProtocolExcepti... | java | public void read(byte[] holder) throws ProtocolException {
int readTotal = 0;
try {
while (readTotal < holder.length) {
int count = input.read(holder, readTotal, holder.length - readTotal);
if (count == -1) {
throw new ProtocolExcepti... | [
"public",
"void",
"read",
"(",
"byte",
"[",
"]",
"holder",
")",
"throws",
"ProtocolException",
"{",
"int",
"readTotal",
"=",
"0",
";",
"try",
"{",
"while",
"(",
"readTotal",
"<",
"holder",
".",
"length",
")",
"{",
"int",
"count",
"=",
"input",
".",
"... | Reads and consumes a number of characters from the underlying reader,
filling the byte array provided.
@param holder A byte array which will be filled with bytes read from the underlying reader.
@throws ProtocolException If a char can't be read into each array element. | [
"Reads",
"and",
"consumes",
"a",
"number",
"of",
"characters",
"from",
"the",
"underlying",
"reader",
"filling",
"the",
"byte",
"array",
"provided",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java#L150-L166 |
160,562 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java | ImapRequestLineReader.commandContinuationRequest | public void commandContinuationRequest()
throws ProtocolException {
try {
output.write('+');
output.write(' ');
output.write('O');
output.write('K');
output.write('\r');
output.write('\n');
output.flush();
... | java | public void commandContinuationRequest()
throws ProtocolException {
try {
output.write('+');
output.write(' ');
output.write('O');
output.write('K');
output.write('\r');
output.write('\n');
output.flush();
... | [
"public",
"void",
"commandContinuationRequest",
"(",
")",
"throws",
"ProtocolException",
"{",
"try",
"{",
"output",
".",
"write",
"(",
"'",
"'",
")",
";",
"output",
".",
"write",
"(",
"'",
"'",
")",
";",
"output",
".",
"write",
"(",
"'",
"'",
")",
";... | Sends a server command continuation request '+' back to the client,
requesting more data to be sent. | [
"Sends",
"a",
"server",
"command",
"continuation",
"request",
"+",
"back",
"to",
"the",
"client",
"requesting",
"more",
"data",
"to",
"be",
"sent",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java#L172-L185 |
160,563 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/UserUtil.java | UserUtil.createUsers | public static void createUsers(GreenMailOperations greenMail, InternetAddress... addresses) {
for (InternetAddress address : addresses) {
greenMail.setUser(address.getAddress(), address.getAddress());
}
} | java | public static void createUsers(GreenMailOperations greenMail, InternetAddress... addresses) {
for (InternetAddress address : addresses) {
greenMail.setUser(address.getAddress(), address.getAddress());
}
} | [
"public",
"static",
"void",
"createUsers",
"(",
"GreenMailOperations",
"greenMail",
",",
"InternetAddress",
"...",
"addresses",
")",
"{",
"for",
"(",
"InternetAddress",
"address",
":",
"addresses",
")",
"{",
"greenMail",
".",
"setUser",
"(",
"address",
".",
"get... | Create users for the given array of addresses. The passwords will be set to the email addresses.
@param greenMail Greenmail instance to create users for
@param addresses Addresses | [
"Create",
"users",
"for",
"the",
"given",
"array",
"of",
"addresses",
".",
"The",
"passwords",
"will",
"be",
"set",
"to",
"the",
"email",
"addresses",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/UserUtil.java#L23-L27 |
160,564 | greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/IdRange.java | IdRange.containsUid | public static boolean containsUid(IdRange[] idRanges, long uid) {
if (null != idRanges && idRanges.length > 0) {
for (IdRange range : idRanges) {
if (range.includes(uid)) {
return true;
}
}
}
return false;
} | java | public static boolean containsUid(IdRange[] idRanges, long uid) {
if (null != idRanges && idRanges.length > 0) {
for (IdRange range : idRanges) {
if (range.includes(uid)) {
return true;
}
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsUid",
"(",
"IdRange",
"[",
"]",
"idRanges",
",",
"long",
"uid",
")",
"{",
"if",
"(",
"null",
"!=",
"idRanges",
"&&",
"idRanges",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"IdRange",
"range",
":",
"idRanges",... | Checks if ranges contain the uid
@param idRanges the id ranges
@param uid the uid
@return true, if ranges contain given uid | [
"Checks",
"if",
"ranges",
"contain",
"the",
"uid"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/IdRange.java#L149-L158 |
160,565 | osiegmar/logback-gelf | src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java | SimpleJsonEncoder.appendToJSON | SimpleJsonEncoder appendToJSON(final String key, final Object value) {
if (closed) {
throw new IllegalStateException("Encoder already closed");
}
if (value != null) {
appendKey(key);
if (value instanceof Number) {
sb.append(value.toString());
... | java | SimpleJsonEncoder appendToJSON(final String key, final Object value) {
if (closed) {
throw new IllegalStateException("Encoder already closed");
}
if (value != null) {
appendKey(key);
if (value instanceof Number) {
sb.append(value.toString());
... | [
"SimpleJsonEncoder",
"appendToJSON",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"closed",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Encoder already closed\"",
")",
";",
"}",
"if",
"(",
"value",
"!=",
... | Append field with quotes and escape characters added, if required.
@return this | [
"Append",
"field",
"with",
"quotes",
"and",
"escape",
"characters",
"added",
"if",
"required",
"."
] | 35c41eda363db803c8c4570f31d518451e9a879b | https://github.com/osiegmar/logback-gelf/blob/35c41eda363db803c8c4570f31d518451e9a879b/src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java#L53-L66 |
160,566 | osiegmar/logback-gelf | src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java | SimpleJsonEncoder.appendToJSONUnquoted | SimpleJsonEncoder appendToJSONUnquoted(final String key, final Object value) {
if (closed) {
throw new IllegalStateException("Encoder already closed");
}
if (value != null) {
appendKey(key);
sb.append(value);
}
return this;
} | java | SimpleJsonEncoder appendToJSONUnquoted(final String key, final Object value) {
if (closed) {
throw new IllegalStateException("Encoder already closed");
}
if (value != null) {
appendKey(key);
sb.append(value);
}
return this;
} | [
"SimpleJsonEncoder",
"appendToJSONUnquoted",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"closed",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Encoder already closed\"",
")",
";",
"}",
"if",
"(",
"value",
... | Append field with quotes and escape characters added in the key, if required.
The value is added without quotes and any escape characters.
@return this | [
"Append",
"field",
"with",
"quotes",
"and",
"escape",
"characters",
"added",
"in",
"the",
"key",
"if",
"required",
".",
"The",
"value",
"is",
"added",
"without",
"quotes",
"and",
"any",
"escape",
"characters",
"."
] | 35c41eda363db803c8c4570f31d518451e9a879b | https://github.com/osiegmar/logback-gelf/blob/35c41eda363db803c8c4570f31d518451e9a879b/src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java#L74-L83 |
160,567 | osiegmar/logback-gelf | src/main/java/de/siegmar/logbackgelf/GelfTcpAppender.java | GelfTcpAppender.sendMessage | @SuppressWarnings("checkstyle:illegalcatch")
private boolean sendMessage(final byte[] messageToSend) {
try {
connectionPool.execute(new PooledObjectConsumer<TcpConnection>() {
@Override
public void accept(final TcpConnection tcpConnection) throws IOException {
... | java | @SuppressWarnings("checkstyle:illegalcatch")
private boolean sendMessage(final byte[] messageToSend) {
try {
connectionPool.execute(new PooledObjectConsumer<TcpConnection>() {
@Override
public void accept(final TcpConnection tcpConnection) throws IOException {
... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:illegalcatch\"",
")",
"private",
"boolean",
"sendMessage",
"(",
"final",
"byte",
"[",
"]",
"messageToSend",
")",
"{",
"try",
"{",
"connectionPool",
".",
"execute",
"(",
"new",
"PooledObjectConsumer",
"<",
"TcpConnection",
... | Send message to socket's output stream.
@param messageToSend message to send.
@return {@code true} if message was sent successfully, {@code false} otherwise. | [
"Send",
"message",
"to",
"socket",
"s",
"output",
"stream",
"."
] | 35c41eda363db803c8c4570f31d518451e9a879b | https://github.com/osiegmar/logback-gelf/blob/35c41eda363db803c8c4570f31d518451e9a879b/src/main/java/de/siegmar/logbackgelf/GelfTcpAppender.java#L170-L187 |
160,568 | brettwooldridge/NuProcess | src/main/java/com/zaxxer/nuprocess/internal/BaseEventProcessor.java | BaseEventProcessor.run | @Override
public void run()
{
try {
startBarrier.await();
int idleCount = 0;
while (!isRunning.compareAndSet(idleCount > lingerIterations && pidToProcessMap.isEmpty(), false)) {
idleCount = (!shutdown && process()) ? 0 : (idleCount + 1);
}
}
catch... | java | @Override
public void run()
{
try {
startBarrier.await();
int idleCount = 0;
while (!isRunning.compareAndSet(idleCount > lingerIterations && pidToProcessMap.isEmpty(), false)) {
idleCount = (!shutdown && process()) ? 0 : (idleCount + 1);
}
}
catch... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"startBarrier",
".",
"await",
"(",
")",
";",
"int",
"idleCount",
"=",
"0",
";",
"while",
"(",
"!",
"isRunning",
".",
"compareAndSet",
"(",
"idleCount",
">",
"lingerIterations",
"&&",
... | The primary run loop of the event processor. | [
"The",
"primary",
"run",
"loop",
"of",
"the",
"event",
"processor",
"."
] | d4abdd195367fce7375a0b45cb2f5eeff1c74d03 | https://github.com/brettwooldridge/NuProcess/blob/d4abdd195367fce7375a0b45cb2f5eeff1c74d03/src/main/java/com/zaxxer/nuprocess/internal/BaseEventProcessor.java#L70-L85 |
160,569 | brettwooldridge/NuProcess | src/main/java/com/zaxxer/nuprocess/internal/HexDumpElf.java | HexDumpElf.dump | public static String dump(final int displayOffset, final byte[] data, final int offset, final int len)
{
StringBuilder sb = new StringBuilder();
Formatter formatter = new Formatter(sb);
StringBuilder ascii = new StringBuilder();
int dataNdx = offset;
final int maxDataNdx = offset + len... | java | public static String dump(final int displayOffset, final byte[] data, final int offset, final int len)
{
StringBuilder sb = new StringBuilder();
Formatter formatter = new Formatter(sb);
StringBuilder ascii = new StringBuilder();
int dataNdx = offset;
final int maxDataNdx = offset + len... | [
"public",
"static",
"String",
"dump",
"(",
"final",
"int",
"displayOffset",
",",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
... | Dump an array of bytes in hexadecimal.
@param displayOffset the display offset (left column)
@param data the byte array of data
@param offset the offset to start dumping in the byte array
@param len the length of data to dump
@return the dump string | [
"Dump",
"an",
"array",
"of",
"bytes",
"in",
"hexadecimal",
"."
] | d4abdd195367fce7375a0b45cb2f5eeff1c74d03 | https://github.com/brettwooldridge/NuProcess/blob/d4abdd195367fce7375a0b45cb2f5eeff1c74d03/src/main/java/com/zaxxer/nuprocess/internal/HexDumpElf.java#L44-L79 |
160,570 | brettwooldridge/NuProcess | src/main/java/com/zaxxer/nuprocess/windows/ProcessCompletions.java | ProcessCompletions.run | @Override
public void run()
{
try {
startBarrier.await();
int idleCount = 0;
while (!isRunning.compareAndSet(idleCount > LINGER_ITERATIONS && deadPool.isEmpty() && completionKeyToProcessMap.isEmpty(), false)) {
idleCount = (!shutdown && process()) ? 0 : (idleCount + 1... | java | @Override
public void run()
{
try {
startBarrier.await();
int idleCount = 0;
while (!isRunning.compareAndSet(idleCount > LINGER_ITERATIONS && deadPool.isEmpty() && completionKeyToProcessMap.isEmpty(), false)) {
idleCount = (!shutdown && process()) ? 0 : (idleCount + 1... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"startBarrier",
".",
"await",
"(",
")",
";",
"int",
"idleCount",
"=",
"0",
";",
"while",
"(",
"!",
"isRunning",
".",
"compareAndSet",
"(",
"idleCount",
">",
"LINGER_ITERATIONS",
"&&",
... | The primary run loop of the kqueue event processor. | [
"The",
"primary",
"run",
"loop",
"of",
"the",
"kqueue",
"event",
"processor",
"."
] | d4abdd195367fce7375a0b45cb2f5eeff1c74d03 | https://github.com/brettwooldridge/NuProcess/blob/d4abdd195367fce7375a0b45cb2f5eeff1c74d03/src/main/java/com/zaxxer/nuprocess/windows/ProcessCompletions.java#L88-L104 |
160,571 | nispok/snackbar | lib/src/main/java/com/nispok/snackbar/Snackbar.java | Snackbar.actionLabel | public Snackbar actionLabel(CharSequence actionButtonLabel) {
mActionLabel = actionButtonLabel;
if (snackbarAction != null) {
snackbarAction.setText(mActionLabel);
}
return this;
} | java | public Snackbar actionLabel(CharSequence actionButtonLabel) {
mActionLabel = actionButtonLabel;
if (snackbarAction != null) {
snackbarAction.setText(mActionLabel);
}
return this;
} | [
"public",
"Snackbar",
"actionLabel",
"(",
"CharSequence",
"actionButtonLabel",
")",
"{",
"mActionLabel",
"=",
"actionButtonLabel",
";",
"if",
"(",
"snackbarAction",
"!=",
"null",
")",
"{",
"snackbarAction",
".",
"setText",
"(",
"mActionLabel",
")",
";",
"}",
"re... | Sets the action label to be displayed, if any. Note that if this is not set, the action
button will not be displayed
@param actionButtonLabel
@return | [
"Sets",
"the",
"action",
"label",
"to",
"be",
"displayed",
"if",
"any",
".",
"Note",
"that",
"if",
"this",
"is",
"not",
"set",
"the",
"action",
"button",
"will",
"not",
"be",
"displayed"
] | a4e0449874423031107f6aaa7e97d0f1714a1d3b | https://github.com/nispok/snackbar/blob/a4e0449874423031107f6aaa7e97d0f1714a1d3b/lib/src/main/java/com/nispok/snackbar/Snackbar.java#L264-L270 |
160,572 | nispok/snackbar | lib/src/main/java/com/nispok/snackbar/Snackbar.java | Snackbar.setBackgroundDrawable | public static void setBackgroundDrawable(View view, Drawable drawable) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
view.setBackgroundDrawable(drawable);
} else {
view.setBackground(drawable);
}
} | java | public static void setBackgroundDrawable(View view, Drawable drawable) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
view.setBackgroundDrawable(drawable);
} else {
view.setBackground(drawable);
}
} | [
"public",
"static",
"void",
"setBackgroundDrawable",
"(",
"View",
"view",
",",
"Drawable",
"drawable",
")",
"{",
"if",
"(",
"android",
".",
"os",
".",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"android",
".",
"os",
".",
"Build",
".",
"VERSION_CODES",
... | Set a Background Drawable using the appropriate Android version api call
@param view
@param drawable | [
"Set",
"a",
"Background",
"Drawable",
"using",
"the",
"appropriate",
"Android",
"version",
"api",
"call"
] | a4e0449874423031107f6aaa7e97d0f1714a1d3b | https://github.com/nispok/snackbar/blob/a4e0449874423031107f6aaa7e97d0f1714a1d3b/lib/src/main/java/com/nispok/snackbar/Snackbar.java#L1222-L1228 |
160,573 | redkale/redkale | src/org/redkale/asm/ModuleVisitor.java | ModuleVisitor.visitRequire | public void visitRequire(String module, int access, String version) {
if (mv != null) {
mv.visitRequire(module, access, version);
}
} | java | public void visitRequire(String module, int access, String version) {
if (mv != null) {
mv.visitRequire(module, access, version);
}
} | [
"public",
"void",
"visitRequire",
"(",
"String",
"module",
",",
"int",
"access",
",",
"String",
"version",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitRequire",
"(",
"module",
",",
"access",
",",
"version",
")",
";",
"}",
"}"
... | Visits a dependence of the current module.
@param module the qualified name of the dependence.
@param access the access flag of the dependence among
ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC
and ACC_MANDATED.
@param version the module version at compile time or null. | [
"Visits",
"a",
"dependence",
"of",
"the",
"current",
"module",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ModuleVisitor.java#L145-L149 |
160,574 | redkale/redkale | src/org/redkale/asm/ModuleVisitor.java | ModuleVisitor.visitExport | public void visitExport(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitExport(packaze, access, modules);
}
} | java | public void visitExport(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitExport(packaze, access, modules);
}
} | [
"public",
"void",
"visitExport",
"(",
"String",
"packaze",
",",
"int",
"access",
",",
"String",
"...",
"modules",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitExport",
"(",
"packaze",
",",
"access",
",",
"modules",
")",
";",
"}... | Visit an exported package of the current module.
@param packaze the qualified name of the exported package.
@param access the access flag of the exported package,
valid values are among {@code ACC_SYNTHETIC} and
{@code ACC_MANDATED}.
@param modules the qualified names of the modules that can access to
the public class... | [
"Visit",
"an",
"exported",
"package",
"of",
"the",
"current",
"module",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ModuleVisitor.java#L162-L166 |
160,575 | redkale/redkale | src/org/redkale/asm/ModuleVisitor.java | ModuleVisitor.visitOpen | public void visitOpen(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitOpen(packaze, access, modules);
}
} | java | public void visitOpen(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitOpen(packaze, access, modules);
}
} | [
"public",
"void",
"visitOpen",
"(",
"String",
"packaze",
",",
"int",
"access",
",",
"String",
"...",
"modules",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitOpen",
"(",
"packaze",
",",
"access",
",",
"modules",
")",
";",
"}",
... | Visit an open package of the current module.
@param packaze the qualified name of the opened package.
@param access the access flag of the opened package,
valid values are among {@code ACC_SYNTHETIC} and
{@code ACC_MANDATED}.
@param modules the qualified names of the modules that can use deep
reflection to the classes... | [
"Visit",
"an",
"open",
"package",
"of",
"the",
"current",
"module",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ModuleVisitor.java#L179-L183 |
160,576 | redkale/redkale | src/org/redkale/asm/ClassReader.java | ClassReader.readTypeAnnotations | private int[] readTypeAnnotations(final MethodVisitor mv,
final Context context, int u, boolean visible) {
char[] c = context.buffer;
int[] offsets = new int[readUnsignedShort(u)];
u += 2;
for (int i = 0; i < offsets.length; ++i) {
offsets[i] = u;
int ... | java | private int[] readTypeAnnotations(final MethodVisitor mv,
final Context context, int u, boolean visible) {
char[] c = context.buffer;
int[] offsets = new int[readUnsignedShort(u)];
u += 2;
for (int i = 0; i < offsets.length; ++i) {
offsets[i] = u;
int ... | [
"private",
"int",
"[",
"]",
"readTypeAnnotations",
"(",
"final",
"MethodVisitor",
"mv",
",",
"final",
"Context",
"context",
",",
"int",
"u",
",",
"boolean",
"visible",
")",
"{",
"char",
"[",
"]",
"c",
"=",
"context",
".",
"buffer",
";",
"int",
"[",
"]"... | Parses a type annotation table to find the labels, and to visit the try
catch block annotations.
@param u
the start offset of a type annotation table.
@param mv
the method visitor to be used to visit the try catch block
annotations.
@param context
information about the class being parsed.
@param visible
if the type an... | [
"Parses",
"a",
"type",
"annotation",
"table",
"to",
"find",
"the",
"labels",
"and",
"to",
"visit",
"the",
"try",
"catch",
"block",
"annotations",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ClassReader.java#L1786-L1848 |
160,577 | redkale/redkale | src/org/redkale/asm/MethodWriter.java | MethodWriter.visitImplicitFirstFrame | private void visitImplicitFirstFrame() {
// There can be at most descriptor.length() + 1 locals
int frameIndex = startFrame(0, descriptor.length() + 1, 0);
if ((access & Opcodes.ACC_STATIC) == 0) {
if ((access & ACC_CONSTRUCTOR) == 0) {
frame[frameIndex++] = Frame.OBJ... | java | private void visitImplicitFirstFrame() {
// There can be at most descriptor.length() + 1 locals
int frameIndex = startFrame(0, descriptor.length() + 1, 0);
if ((access & Opcodes.ACC_STATIC) == 0) {
if ((access & ACC_CONSTRUCTOR) == 0) {
frame[frameIndex++] = Frame.OBJ... | [
"private",
"void",
"visitImplicitFirstFrame",
"(",
")",
"{",
"// There can be at most descriptor.length() + 1 locals",
"int",
"frameIndex",
"=",
"startFrame",
"(",
"0",
",",
"descriptor",
".",
"length",
"(",
")",
"+",
"1",
",",
"0",
")",
";",
"if",
"(",
"(",
"... | Visit the implicit first frame of this method. | [
"Visit",
"the",
"implicit",
"first",
"frame",
"of",
"this",
"method",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodWriter.java#L1809-L1864 |
160,578 | redkale/redkale | src/org/redkale/asm/ClassWriter.java | ClassWriter.newStringishItem | Item newStringishItem(final int type, final String value) {
key2.set(type, value, null, null);
Item result = get(key2);
if (result == null) {
pool.put12(type, newUTF8(value));
result = new Item(index++, key2);
put(result);
}
return result;
... | java | Item newStringishItem(final int type, final String value) {
key2.set(type, value, null, null);
Item result = get(key2);
if (result == null) {
pool.put12(type, newUTF8(value));
result = new Item(index++, key2);
put(result);
}
return result;
... | [
"Item",
"newStringishItem",
"(",
"final",
"int",
"type",
",",
"final",
"String",
"value",
")",
"{",
"key2",
".",
"set",
"(",
"type",
",",
"value",
",",
"null",
",",
"null",
")",
";",
"Item",
"result",
"=",
"get",
"(",
"key2",
")",
";",
"if",
"(",
... | Adds a string reference, a class reference, a method type, a module
or a package to the constant pool of the class being build.
Does nothing if the constant pool already contains a similar item.
@param type
a type among STR, CLASS, MTYPE, MODULE or PACKAGE
@param value
string value of the reference.
@return a new or a... | [
"Adds",
"a",
"string",
"reference",
"a",
"class",
"reference",
"a",
"method",
"type",
"a",
"module",
"or",
"a",
"package",
"to",
"the",
"constant",
"pool",
"of",
"the",
"class",
"being",
"build",
".",
"Does",
"nothing",
"if",
"the",
"constant",
"pool",
"... | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ClassWriter.java#L1188-L1197 |
160,579 | redkale/redkale | src/org/redkale/asm/MethodVisitor.java | MethodVisitor.visitParameter | public void visitParameter(String name, int access) {
if (mv != null) {
mv.visitParameter(name, access);
}
} | java | public void visitParameter(String name, int access) {
if (mv != null) {
mv.visitParameter(name, access);
}
} | [
"public",
"void",
"visitParameter",
"(",
"String",
"name",
",",
"int",
"access",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitParameter",
"(",
"name",
",",
"access",
")",
";",
"}",
"}"
] | Visits a parameter of this method.
@param name
parameter name or null if none is provided.
@param access
the parameter's access flags, only <tt>ACC_FINAL</tt>,
<tt>ACC_SYNTHETIC</tt> or/and <tt>ACC_MANDATED</tt> are
allowed (see {@link Opcodes}). | [
"Visits",
"a",
"parameter",
"of",
"this",
"method",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodVisitor.java#L139-L143 |
160,580 | redkale/redkale | src/org/redkale/asm/MethodVisitor.java | MethodVisitor.visitMethodInsn | public void visitMethodInsn(int opcode, String owner, String name,
String desc, boolean itf) {
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc, itf);
}
} | java | public void visitMethodInsn(int opcode, String owner, String name,
String desc, boolean itf) {
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc, itf);
}
} | [
"public",
"void",
"visitMethodInsn",
"(",
"int",
"opcode",
",",
"String",
"owner",
",",
"String",
"name",
",",
"String",
"desc",
",",
"boolean",
"itf",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitMethodInsn",
"(",
"opcode",
",",... | Visits a method instruction. A method instruction is an instruction that
invokes a method.
@param opcode
the opcode of the type instruction to be visited. This opcode
is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
INVOKEINTERFACE.
@param owner
the internal name of the method's owner class (see
{@link Type#get... | [
"Visits",
"a",
"method",
"instruction",
".",
"A",
"method",
"instruction",
"is",
"an",
"instruction",
"that",
"invokes",
"a",
"method",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodVisitor.java#L466-L471 |
160,581 | redkale/redkale | src/org/redkale/asm/MethodVisitor.java | MethodVisitor.visitLocalVariableAnnotation | public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
if (mv != null) {
return mv.visitLocalVariableAnnotation(typeRef, typePath, start,
end, index, de... | java | public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
if (mv != null) {
return mv.visitLocalVariableAnnotation(typeRef, typePath, start,
end, index, de... | [
"public",
"AnnotationVisitor",
"visitLocalVariableAnnotation",
"(",
"int",
"typeRef",
",",
"TypePath",
"typePath",
",",
"Label",
"[",
"]",
"start",
",",
"Label",
"[",
"]",
"end",
",",
"int",
"[",
"]",
"index",
",",
"String",
"desc",
",",
"boolean",
"visible"... | Visits an annotation on a local variable type.
@param typeRef
a reference to the annotated type. The sort of this type
reference must be {@link TypeReference#LOCAL_VARIABLE
LOCAL_VARIABLE} or {@link TypeReference#RESOURCE_VARIABLE
RESOURCE_VARIABLE}. See {@link TypeReference}.
@param typePath
the path to the annotated... | [
"Visits",
"an",
"annotation",
"on",
"a",
"local",
"variable",
"type",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodVisitor.java#L803-L811 |
160,582 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollection.java | MaterialCollection.setHeader | public void setHeader(String header) {
headerLabel.getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(header));
addStyleName(CssName.WITH_HEADER);
ListItem item = new ListItem(headerLabel);
UiHelper.addMousePressedHandlers(item);
item.setStyleName(CssName.COLLECTION_HEADER);
... | java | public void setHeader(String header) {
headerLabel.getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(header));
addStyleName(CssName.WITH_HEADER);
ListItem item = new ListItem(headerLabel);
UiHelper.addMousePressedHandlers(item);
item.setStyleName(CssName.COLLECTION_HEADER);
... | [
"public",
"void",
"setHeader",
"(",
"String",
"header",
")",
"{",
"headerLabel",
".",
"getElement",
"(",
")",
".",
"setInnerSafeHtml",
"(",
"SafeHtmlUtils",
".",
"fromString",
"(",
"header",
")",
")",
";",
"addStyleName",
"(",
"CssName",
".",
"WITH_HEADER",
... | Sets the header of the collection component. | [
"Sets",
"the",
"header",
"of",
"the",
"collection",
"component",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollection.java#L147-L154 |
160,583 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialTooltip.java | MaterialTooltip.setHtml | public void setHtml(String html) {
this.html = html;
if (widget != null) {
if (widget.isAttached()) {
tooltipElement.find("span")
.html(html != null ? html : "");
} else {
widget.addAttachHandler(event ->
... | java | public void setHtml(String html) {
this.html = html;
if (widget != null) {
if (widget.isAttached()) {
tooltipElement.find("span")
.html(html != null ? html : "");
} else {
widget.addAttachHandler(event ->
... | [
"public",
"void",
"setHtml",
"(",
"String",
"html",
")",
"{",
"this",
".",
"html",
"=",
"html",
";",
"if",
"(",
"widget",
"!=",
"null",
")",
"{",
"if",
"(",
"widget",
".",
"isAttached",
"(",
")",
")",
"{",
"tooltipElement",
".",
"find",
"(",
"\"spa... | Set the html as value inside the tooltip. | [
"Set",
"the",
"html",
"as",
"value",
"inside",
"the",
"tooltip",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialTooltip.java#L325-L340 |
160,584 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.addItem | public void addItem(T value, String text, boolean reload) {
values.add(value);
listBox.addItem(text, keyFactory.generateKey(value));
if (reload) {
reload();
}
} | java | public void addItem(T value, String text, boolean reload) {
values.add(value);
listBox.addItem(text, keyFactory.generateKey(value));
if (reload) {
reload();
}
} | [
"public",
"void",
"addItem",
"(",
"T",
"value",
",",
"String",
"text",
",",
"boolean",
"reload",
")",
"{",
"values",
".",
"add",
"(",
"value",
")",
";",
"listBox",
".",
"addItem",
"(",
"text",
",",
"keyFactory",
".",
"generateKey",
"(",
"value",
")",
... | Adds an item to the list box, specifying an initial value for the item.
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}; cannot be <code>null</code>
@param text the text of the item to be added
@param reload perform a 'material select' reload to update the DOM. | [
"Adds",
"an",
"item",
"to",
"the",
"list",
"box",
"specifying",
"an",
"initial",
"value",
"for",
"the",
"item",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L258-L265 |
160,585 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.addItem | public void addItem(T value, Direction dir, String text) {
addItem(value, dir, text, true);
} | java | public void addItem(T value, Direction dir, String text) {
addItem(value, dir, text, true);
} | [
"public",
"void",
"addItem",
"(",
"T",
"value",
",",
"Direction",
"dir",
",",
"String",
"text",
")",
"{",
"addItem",
"(",
"value",
",",
"dir",
",",
"text",
",",
"true",
")",
";",
"}"
] | Adds an item to the list box, specifying its direction and an initial
value for the item.
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}; cannot be <code>null</code>
@param dir the item's direction
@param text the text of the item to be added | [
"Adds",
"an",
"item",
"to",
"the",
"list",
"box",
"specifying",
"its",
"direction",
"and",
"an",
"initial",
"value",
"for",
"the",
"item",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L276-L278 |
160,586 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.removeValue | public void removeValue(T value, boolean reload) {
int idx = getIndex(value);
if (idx >= 0) {
removeItemInternal(idx, reload);
}
} | java | public void removeValue(T value, boolean reload) {
int idx = getIndex(value);
if (idx >= 0) {
removeItemInternal(idx, reload);
}
} | [
"public",
"void",
"removeValue",
"(",
"T",
"value",
",",
"boolean",
"reload",
")",
"{",
"int",
"idx",
"=",
"getIndex",
"(",
"value",
")",
";",
"if",
"(",
"idx",
">=",
"0",
")",
"{",
"removeItemInternal",
"(",
"idx",
",",
"reload",
")",
";",
"}",
"}... | Removes a value from the list box. Nothing is done if the value isn't on
the list box.
@param value the value to be removed from the list
@param reload perform a 'material select' reload to update the DOM. | [
"Removes",
"a",
"value",
"from",
"the",
"list",
"box",
".",
"Nothing",
"is",
"done",
"if",
"the",
"value",
"isn",
"t",
"on",
"the",
"list",
"box",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L507-L512 |
160,587 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.clear | @Override
public void clear() {
values.clear();
listBox.clear();
clearStatusText();
if (emptyPlaceHolder != null) {
insertEmptyPlaceHolder(emptyPlaceHolder);
}
reload();
if (isAllowBlank()) {
addBlankItemIfNeeded();
}
} | java | @Override
public void clear() {
values.clear();
listBox.clear();
clearStatusText();
if (emptyPlaceHolder != null) {
insertEmptyPlaceHolder(emptyPlaceHolder);
}
reload();
if (isAllowBlank()) {
addBlankItemIfNeeded();
}
} | [
"@",
"Override",
"public",
"void",
"clear",
"(",
")",
"{",
"values",
".",
"clear",
"(",
")",
";",
"listBox",
".",
"clear",
"(",
")",
";",
"clearStatusText",
"(",
")",
";",
"if",
"(",
"emptyPlaceHolder",
"!=",
"null",
")",
"{",
"insertEmptyPlaceHolder",
... | Removes all items from the list box. | [
"Removes",
"all",
"items",
"from",
"the",
"list",
"box",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L527-L540 |
160,588 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.getItemsSelected | public String[] getItemsSelected() {
List<String> selected = new LinkedList<>();
for (int i = getIndexOffset(); i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selected.add(listBox.getValue(i));
}
}
return selected.toArray(new S... | java | public String[] getItemsSelected() {
List<String> selected = new LinkedList<>();
for (int i = getIndexOffset(); i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selected.add(listBox.getValue(i));
}
}
return selected.toArray(new S... | [
"public",
"String",
"[",
"]",
"getItemsSelected",
"(",
")",
"{",
"List",
"<",
"String",
">",
"selected",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"getIndexOffset",
"(",
")",
";",
"i",
"<",
"listBox",
".",
"getItemCo... | Returns all selected values of the list box, or empty array if none.
@return the selected values of the list box | [
"Returns",
"all",
"selected",
"values",
"of",
"the",
"list",
"box",
"or",
"empty",
"array",
"if",
"none",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L977-L985 |
160,589 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.setValueSelected | public void setValueSelected(T value, boolean selected) {
int idx = getIndex(value);
if (idx >= 0) {
setItemSelectedInternal(idx, selected);
}
} | java | public void setValueSelected(T value, boolean selected) {
int idx = getIndex(value);
if (idx >= 0) {
setItemSelectedInternal(idx, selected);
}
} | [
"public",
"void",
"setValueSelected",
"(",
"T",
"value",
",",
"boolean",
"selected",
")",
"{",
"int",
"idx",
"=",
"getIndex",
"(",
"value",
")",
";",
"if",
"(",
"idx",
">=",
"0",
")",
"{",
"setItemSelectedInternal",
"(",
"idx",
",",
"selected",
")",
";... | Sets whether an individual list value is selected.
@param value the value of the item to be selected or unselected
@param selected <code>true</code> to select the item | [
"Sets",
"whether",
"an",
"individual",
"list",
"value",
"is",
"selected",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L1010-L1015 |
160,590 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.getIndex | public int getIndex(T value) {
int count = getItemCount();
for (int i = 0; i < count; i++) {
if (Objects.equals(getValue(i), value)) {
return i;
}
}
return -1;
} | java | public int getIndex(T value) {
int count = getItemCount();
for (int i = 0; i < count; i++) {
if (Objects.equals(getValue(i), value)) {
return i;
}
}
return -1;
} | [
"public",
"int",
"getIndex",
"(",
"T",
"value",
")",
"{",
"int",
"count",
"=",
"getItemCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Objects",
".",
"equals",
"(",
"getValu... | Gets the index of the specified value.
@param value the value of the item to be found
@return the index of the value | [
"Gets",
"the",
"index",
"of",
"the",
"specified",
"value",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L1023-L1031 |
160,591 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java | MaterialSearch.addSearchFinishHandler | @Override
public HandlerRegistration addSearchFinishHandler(final SearchFinishEvent.SearchFinishHandler handler) {
return addHandler(handler, SearchFinishEvent.TYPE);
} | java | @Override
public HandlerRegistration addSearchFinishHandler(final SearchFinishEvent.SearchFinishHandler handler) {
return addHandler(handler, SearchFinishEvent.TYPE);
} | [
"@",
"Override",
"public",
"HandlerRegistration",
"addSearchFinishHandler",
"(",
"final",
"SearchFinishEvent",
".",
"SearchFinishHandler",
"handler",
")",
"{",
"return",
"addHandler",
"(",
"handler",
",",
"SearchFinishEvent",
".",
"TYPE",
")",
";",
"}"
] | This handler will be triggered when search is finish | [
"This",
"handler",
"will",
"be",
"triggered",
"when",
"search",
"is",
"finish"
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java#L371-L374 |
160,592 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java | MaterialSearch.addSearchNoResultHandler | @Override
public HandlerRegistration addSearchNoResultHandler(final SearchNoResultEvent.SearchNoResultHandler handler) {
return addHandler(handler, SearchNoResultEvent.TYPE);
} | java | @Override
public HandlerRegistration addSearchNoResultHandler(final SearchNoResultEvent.SearchNoResultHandler handler) {
return addHandler(handler, SearchNoResultEvent.TYPE);
} | [
"@",
"Override",
"public",
"HandlerRegistration",
"addSearchNoResultHandler",
"(",
"final",
"SearchNoResultEvent",
".",
"SearchNoResultHandler",
"handler",
")",
"{",
"return",
"addHandler",
"(",
"handler",
",",
"SearchNoResultEvent",
".",
"TYPE",
")",
";",
"}"
] | This handler will be triggered when there's no search result | [
"This",
"handler",
"will",
"be",
"triggered",
"when",
"there",
"s",
"no",
"search",
"result"
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java#L379-L382 |
160,593 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java | AbstractButton.setSize | public void setSize(ButtonSize size) {
if (this.size != null) {
removeStyleName(this.size.getCssName());
}
this.size = size;
if (size != null) {
addStyleName(size.getCssName());
}
} | java | public void setSize(ButtonSize size) {
if (this.size != null) {
removeStyleName(this.size.getCssName());
}
this.size = size;
if (size != null) {
addStyleName(size.getCssName());
}
} | [
"public",
"void",
"setSize",
"(",
"ButtonSize",
"size",
")",
"{",
"if",
"(",
"this",
".",
"size",
"!=",
"null",
")",
"{",
"removeStyleName",
"(",
"this",
".",
"size",
".",
"getCssName",
"(",
")",
")",
";",
"}",
"this",
".",
"size",
"=",
"size",
";"... | Set the buttons size. | [
"Set",
"the",
"buttons",
"size",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java#L136-L145 |
160,594 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java | AbstractButton.setText | public void setText(String text) {
span.setText(text);
if (!span.isAttached()) {
add(span);
}
} | java | public void setText(String text) {
span.setText(text);
if (!span.isAttached()) {
add(span);
}
} | [
"public",
"void",
"setText",
"(",
"String",
"text",
")",
"{",
"span",
".",
"setText",
"(",
"text",
")",
";",
"if",
"(",
"!",
"span",
".",
"isAttached",
"(",
")",
")",
"{",
"add",
"(",
"span",
")",
";",
"}",
"}"
] | Set the buttons span text. | [
"Set",
"the",
"buttons",
"span",
"text",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java#L164-L170 |
160,595 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/helper/ColorHelper.java | ColorHelper.fromStyleName | public static <E extends Enum<? extends Style.HasCssName>> E fromStyleName(final String styleName,
final Class<E> enumClass,
final E defaultValue) {
retur... | java | public static <E extends Enum<? extends Style.HasCssName>> E fromStyleName(final String styleName,
final Class<E> enumClass,
final E defaultValue) {
retur... | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"?",
"extends",
"Style",
".",
"HasCssName",
">",
">",
"E",
"fromStyleName",
"(",
"final",
"String",
"styleName",
",",
"final",
"Class",
"<",
"E",
">",
"enumClass",
",",
"final",
"E",
"defaultValue",
"... | Returns first enum constant found..
@param styleName Space-separated list of styles
@param enumClass Type of enum
@param defaultValue Default value of no match was found
@return First enum constant found or default value | [
"Returns",
"first",
"enum",
"constant",
"found",
".."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/helper/ColorHelper.java#L40-L44 |
160,596 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/animate/MaterialAnimation.java | MaterialAnimation.stopAnimation | public void stopAnimation() {
if(widget != null) {
widget.removeStyleName("animated");
widget.removeStyleName(transition.getCssName());
widget.removeStyleName(CssName.INFINITE);
}
} | java | public void stopAnimation() {
if(widget != null) {
widget.removeStyleName("animated");
widget.removeStyleName(transition.getCssName());
widget.removeStyleName(CssName.INFINITE);
}
} | [
"public",
"void",
"stopAnimation",
"(",
")",
"{",
"if",
"(",
"widget",
"!=",
"null",
")",
"{",
"widget",
".",
"removeStyleName",
"(",
"\"animated\"",
")",
";",
"widget",
".",
"removeStyleName",
"(",
"transition",
".",
"getCssName",
"(",
")",
")",
";",
"w... | Stop an animation. | [
"Stop",
"an",
"animation",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/animate/MaterialAnimation.java#L182-L188 |
160,597 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java | MaterialValueBox.clear | public void clear() {
valueBoxBase.setText("");
clearStatusText();
if (getPlaceholder() == null || getPlaceholder().isEmpty()) {
label.removeStyleName(CssName.ACTIVE);
}
} | java | public void clear() {
valueBoxBase.setText("");
clearStatusText();
if (getPlaceholder() == null || getPlaceholder().isEmpty()) {
label.removeStyleName(CssName.ACTIVE);
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"valueBoxBase",
".",
"setText",
"(",
"\"\"",
")",
";",
"clearStatusText",
"(",
")",
";",
"if",
"(",
"getPlaceholder",
"(",
")",
"==",
"null",
"||",
"getPlaceholder",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"... | Resets the text box by removing its content and resetting visual state. | [
"Resets",
"the",
"text",
"box",
"by",
"removing",
"its",
"content",
"and",
"resetting",
"visual",
"state",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java#L154-L161 |
160,598 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java | MaterialValueBox.updateLabelActiveStyle | protected void updateLabelActiveStyle() {
if (this.valueBoxBase.getText() != null && !this.valueBoxBase.getText().isEmpty()) {
label.addStyleName(CssName.ACTIVE);
} else {
label.removeStyleName(CssName.ACTIVE);
}
} | java | protected void updateLabelActiveStyle() {
if (this.valueBoxBase.getText() != null && !this.valueBoxBase.getText().isEmpty()) {
label.addStyleName(CssName.ACTIVE);
} else {
label.removeStyleName(CssName.ACTIVE);
}
} | [
"protected",
"void",
"updateLabelActiveStyle",
"(",
")",
"{",
"if",
"(",
"this",
".",
"valueBoxBase",
".",
"getText",
"(",
")",
"!=",
"null",
"&&",
"!",
"this",
".",
"valueBoxBase",
".",
"getText",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"label",... | Updates the style of the field label according to the field value if the
field value is empty - null or "" - removes the label 'active' style else
will add the 'active' style to the field label. | [
"Updates",
"the",
"style",
"of",
"the",
"field",
"label",
"according",
"to",
"the",
"field",
"value",
"if",
"the",
"field",
"value",
"is",
"empty",
"-",
"null",
"or",
"-",
"removes",
"the",
"label",
"active",
"style",
"else",
"will",
"add",
"the",
"activ... | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java#L432-L438 |
160,599 | GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleBody.java | MaterialCollapsibleBody.checkActiveState | protected void checkActiveState(Widget child) {
// Check if this widget has a valid href
String href = child.getElement().getAttribute("href");
String url = Window.Location.getHref();
int pos = url.indexOf("#");
String location = pos >= 0 ? url.substring(pos, url.length()) : "";
... | java | protected void checkActiveState(Widget child) {
// Check if this widget has a valid href
String href = child.getElement().getAttribute("href");
String url = Window.Location.getHref();
int pos = url.indexOf("#");
String location = pos >= 0 ? url.substring(pos, url.length()) : "";
... | [
"protected",
"void",
"checkActiveState",
"(",
"Widget",
"child",
")",
"{",
"// Check if this widget has a valid href",
"String",
"href",
"=",
"child",
".",
"getElement",
"(",
")",
".",
"getAttribute",
"(",
"\"href\"",
")",
";",
"String",
"url",
"=",
"Window",
".... | Checks if this child holds the current active state.
If the child is or contains the active state it is applied. | [
"Checks",
"if",
"this",
"child",
"holds",
"the",
"current",
"active",
"state",
".",
"If",
"the",
"child",
"is",
"or",
"contains",
"the",
"active",
"state",
"it",
"is",
"applied",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleBody.java#L126-L144 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.