_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q155100
EnvUtil.verifyEnvironment
train
public static boolean verifyEnvironment() { if (!PRODUCTION.equals(getEnv())) { return true; } else { File tokenFile = new File("/etc/xian/xian_runtime_production.token"); if (tokenFile.exists() && tokenFile.isFile()) { String token = PlainFileUtil.rea...
java
{ "resource": "" }
q155101
CuratorFrameworkFactory.newClient
train
public static CuratorFramework newClient(String connectString, RetryPolicy retryPolicy) { return newClient(connectString, DEFAULT_SESSION_TIMEOUT_MS, DEFAULT_CONNECTION_TIMEOUT_MS, retryPolicy); }
java
{ "resource": "" }
q155102
CuratorFrameworkFactory.newClient
train
public static CuratorFramework newClient(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy) { return builder(). connectString(connectString). sessionTimeoutMs(sessionTimeoutMs). connectionTimeoutMs(connectionTimeoutMs). ...
java
{ "resource": "" }
q155103
SlackWebhooks.invokeSlackWebhook
train
@PostConstruct public void invokeSlackWebhook() { RestTemplate restTemplate = new RestTemplate(); RichMessage richMessage = new RichMessage("Just to test Slack's incoming webhooks."); // set attachments Attachment[] attachments = new Attachment[1]; attachments[0] = new Attach...
java
{ "resource": "" }
q155104
Bot.afterConnectionClosed
train
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) { logger.debug("WebSocket closed: {}, Close Status: {}", session, status.toString()); }
java
{ "resource": "" }
q155105
Bot.startRTMAndWebSocketConnection
train
@PostConstruct protected void startRTMAndWebSocketConnection() { slackService.connectRTM(getSlackToken()); if (slackService.getWebSocketUrl() != null) { webSocketManager = new WebSocketConnectionManager(client(), handler(), slackService.getWebSocketUrl()); webSocketManager.st...
java
{ "resource": "" }
q155106
FbBot.onReceiveQuickReply
train
@Controller(events = EventType.QUICK_REPLY, pattern = "(yes|no)") public void onReceiveQuickReply(Event event) { if ("yes".equals(event.getMessage().getQuickReply().getPayload())) { reply(event, "Cool! You can type: \n 1) Show Buttons \n 2) Show List \n 3) Setup meeting"); } else { ...
java
{ "resource": "" }
q155107
FbBot.showGithubLink
train
@Controller(events = EventType.MESSAGE, pattern = "(?i)(bye|tata|ttyl|cya|see you)") public void showGithubLink(Event event) { reply(event, new Message().setAttachment(new Attachment().setType("template").setPayload(new Payload() .setTemplateType("button").setText("Bye. Happy coding!").setBu...
java
{ "resource": "" }
q155108
SlackBot.onPinAdded
train
@Controller(events = EventType.PIN_ADDED) public void onPinAdded(WebSocketSession session, Event event) { reply(session, event, "Thanks for the pin! You can find all pinned items under channel details."); }
java
{ "resource": "" }
q155109
SlackService.connectRTM
train
public void connectRTM(String slackToken) { RTM rtm = restTemplate.getForEntity(slackApiEndpoints.getRtmConnectApi(), RTM.class, slackToken).getBody(); currentUser = rtm.getSelf(); webSocketUrl = rtm.getUrl(); getImChannels(slackToken, 200,""); }
java
{ "resource": "" }
q155110
SlackService.getImChannels
train
private void getImChannels(String slackToken, int limit, String nextCursor) { try { Event event = restTemplate.getForEntity(slackApiEndpoints.getImListApi(), Event.class, slackToken, limit, nextCursor).getBody(); imChannelIds.addAll(Arrays.stream(event.getIms()).map(C...
java
{ "resource": "" }
q155111
Bot.startConversation
train
protected final void startConversation(Event event, String methodName) { startConversation(event.getSender().getId(), methodName); }
java
{ "resource": "" }
q155112
Bot.invokeChainedMethod
train
private void invokeChainedMethod(Event event) { Queue<MethodWrapper> queue = conversationQueueMap.get(event.getSender().getId()); if (queue != null && !queue.isEmpty()) { MethodWrapper methodWrapper = queue.peek(); try { EventType[] eventTypes = methodWrapper.ge...
java
{ "resource": "" }
q155113
Bot.getPatternFromEventType
train
private String getPatternFromEventType(Event event) { switch (event.getType()) { case MESSAGE: return event.getMessage().getText(); case QUICK_REPLY: return event.getMessage().getQuickReply().getPayload(); case POSTBACK: return ...
java
{ "resource": "" }
q155114
BaseBot.formConversationQueue
train
private Queue<MethodWrapper> formConversationQueue(Queue<MethodWrapper> queue, String methodName) { MethodWrapper methodWrapper = methodNameMap.get(methodName); queue.add(methodWrapper); if (StringUtils.isEmpty(methodName)) { return queue; } else { return formConv...
java
{ "resource": "" }
q155115
KafkaUtils.murmur2
train
@SuppressWarnings("fallthrough") public static int murmur2(final byte[] data) { int length = data.length; int seed = 0x9747b28c; // 'm' and 'r' are mixing constants generated offline. // They're not really 'magic', they just happen to work well. final int m = 0x5bd1e995; final int r = 24; ...
java
{ "resource": "" }
q155116
OverridableStreamsPartitionAssignor.prepareTopic
train
private void prepareTopic(final Map<String, InternalTopicMetadata> topicPartitions) { log.debug("Starting to validate internal topics {} in partition assignor.", topicPartitions); // first construct the topics to make ready final Map<String, InternalTopicConfig> topicsToMakeReady = new HashMap<>(); fo...
java
{ "resource": "" }
q155117
ColumnRange.removeColumn
train
ColumnRange removeColumn(int column) { // first, let's see if this is a 1-column range that should // be destroyed if (isSingleCol()) { return null; } else if (column == left) { left++; return this; } else if (column + 1 == right) { ...
java
{ "resource": "" }
q155118
SvgPathData.checkh
train
private State checkh(State state) throws DatatypeException, IOException { if (state.context.length() == 0) { state = appendToContext(state); } state.current = state.reader.read(); state = appendToContext(state); state = skipSpaces(state); boolean expectNumber ...
java
{ "resource": "" }
q155119
SvgPathData.skipSubPath
train
private State skipSubPath(State state) throws IOException { for (;;) { switch (state.current) { case -1: case 'm': case 'M': return state; default: break; } state.current =...
java
{ "resource": "" }
q155120
SvgPathData.skipSpaces
train
private State skipSpaces(State state) throws IOException { for (;;) { switch (state.current) { default: return state; case 0x20: case 0x09: case 0x0D: case 0x0A: } state.curren...
java
{ "resource": "" }
q155121
Table.appendColumnRange
train
private void appendColumnRange(ColumnRange colRange) { if (last == null) { first = colRange; last = colRange; } else { last.setNext(colRange); last = colRange; } }
java
{ "resource": "" }
q155122
HtmlSerializer.characters
train
@Override public void characters(char[] ch, int start, int length) throws SAXException { try { for (int j = 0; j < length; j++) { char c = ch[start + j]; switch (c) { case '<': this.writer.write("&lt;"); ...
java
{ "resource": "" }
q155123
HtmlSerializer.endDocument
train
@Override public void endDocument() throws SAXException { try { this.writer.close(); } catch (IOException ioe) { throw (SAXException)new SAXException(ioe).initCause(ioe); } }
java
{ "resource": "" }
q155124
HtmlSerializer.endElement
train
@Override public void endElement(String namespaceURI, String localName, String qName) throws SAXException { try { if (XHTML_NS.equals(namespaceURI) && Arrays.binarySearch(emptyElements, localName) < 0) { this.writer.write("</"); thi...
java
{ "resource": "" }
q155125
HtmlSerializer.startDocument
train
@Override public void startDocument() throws SAXException { try { switch (doctype) { case NO_DOCTYPE: return; case DOCTYPE_HTML5: writer.write("<!DOCTYPE html>\n"); return; case DOCTYPE_HT...
java
{ "resource": "" }
q155126
HtmlSerializer.startElement
train
@Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { try { if (XHTML_NS.equals(namespaceURI)) { if ("meta".equals(localName) && ((atts.getIndex("", "http-equiv") != -1) ...
java
{ "resource": "" }
q155127
XmlParser.fatal
train
private void fatal(String message, char textFound, String textExpected) throws SAXException { fatal(message, Character.valueOf(textFound).toString(), textExpected); }
java
{ "resource": "" }
q155128
XmlParser.parseComment
train
private void parseComment() throws Exception { boolean saved = expandPE; expandPE = false; parseUntil(endDelimComment); require('>'); expandPE = saved; handler.comment(dataBuffer, 0, dataBufferPos); dataBufferPos = 0; }
java
{ "resource": "" }
q155129
XmlParser.parsePI
train
private void parsePI() throws SAXException, IOException { String name; boolean saved = expandPE; expandPE = false; name = readNmtoken(true); // NE08 if (name.indexOf(':') >= 0) { fatal("Illegal character(':') in processing instruction name ", ...
java
{ "resource": "" }
q155130
XmlParser.parseXMLDecl
train
private String parseXMLDecl(String encoding) throws SAXException, IOException { String version; String encodingName = null; String standalone = null; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; // Read the version. require("version"); ...
java
{ "resource": "" }
q155131
XmlParser.checkEncodingLiteral
train
private void checkEncodingLiteral(String encodingName) throws SAXException { if (encodingName == null) { return; } if (encodingName.length() == 0) { fatal("The empty string does not a legal encoding name."); } char c = encodingName.charAt(0); if (!...
java
{ "resource": "" }
q155132
XmlParser.parseTextDecl
train
private String parseTextDecl(String encoding) throws SAXException, IOException { String encodingName = null; int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; // Read an optional version. if (tryRead("version")) { String version; parse...
java
{ "resource": "" }
q155133
XmlParser.parseMisc
train
private void parseMisc() throws Exception { while (true) { skipWhitespace(); if (tryRead(startDelimPI)) { parsePI(); } else if (tryRead(startDelimComment)) { parseComment(); } else { return; } } ...
java
{ "resource": "" }
q155134
XmlParser.parseDoctypedecl
train
private void parseDoctypedecl() throws Exception { String rootName; ExternalIdentifiers ids; // Read the document type name. requireWhitespace(); rootName = readNmtoken(true); // Read the External subset's IDs skipWhitespace(); ids = readExternalIds(fals...
java
{ "resource": "" }
q155135
XmlParser.parseMarkupdecl
train
private void parseMarkupdecl() throws Exception { char[] saved = null; boolean savedPE = expandPE; // prevent "<%foo;" and ensures saved entity is right require('<'); unread('<'); expandPE = false; if (tryRead("<!ELEMENT")) { saved = readBuffer; ...
java
{ "resource": "" }
q155136
XmlParser.parseElement
train
private void parseElement(boolean maybeGetSubset) throws Exception { String gi; char c; int oldElementContent = currentElementContent; String oldElement = currentElement; ElementDecl element; // This is the (global) counter for the // array of specified attribute...
java
{ "resource": "" }
q155137
XmlParser.parseAttribute
train
private void parseAttribute(String name) throws Exception { String aname; String type; String value; int flags = LIT_ATTRIBUTE | LIT_ENTITY_REF; // Read the attribute name. aname = readNmtoken(true); type = getAttributeType(name, aname); // Parse '=' ...
java
{ "resource": "" }
q155138
XmlParser.parseContent
train
private void parseContent() throws Exception { char c; while (true) { // consume characters (or ignorable whitspace) until delimiter parseCharData(); // Handle delimiters c = readCh(); switch (c) { case '&': // Found "&" ...
java
{ "resource": "" }
q155139
XmlParser.parseElementDecl
train
private void parseElementDecl() throws Exception { String name; requireWhitespace(); // Read the element type name. name = readNmtoken(true); requireWhitespace(); // Read the content model. parseContentspec(name); skipWhitespace(); require('>');...
java
{ "resource": "" }
q155140
XmlParser.parseContentspec
train
private void parseContentspec(String name) throws Exception { // FIXME: move elementDecl() into setElement(), pass EMTPY/ANY ... if (tryRead("EMPTY")) { setElement(name, CONTENT_EMPTY, null, null); if (!skippedPE) { handler.getDeclHandler().elementDecl(name, "EMPT...
java
{ "resource": "" }
q155141
XmlParser.parseElements
train
private void parseElements(char[] saved) throws Exception { char c; char sep; // Parse the first content particle skipWhitespace(); parseCp(); // Check for end or for a separator. skipWhitespace(); c = readCh(); switch (c) { case ')':...
java
{ "resource": "" }
q155142
XmlParser.parseCp
train
private void parseCp() throws Exception { if (tryRead('(')) { dataBufferAppend('('); parseElements(readBuffer); } else { dataBufferAppend(readNmtoken(true)); char c = readCh(); switch (c) { case '?': case '*': ...
java
{ "resource": "" }
q155143
XmlParser.parseMixed
train
private void parseMixed(char[] saved) throws Exception { // Check for PCDATA alone. skipWhitespace(); if (tryRead(')')) { // VC: Proper Group/PE Nesting if (readBuffer != saved) { handler.verror("Illegal Group/PE nesting"); } dataB...
java
{ "resource": "" }
q155144
XmlParser.parseAttlistDecl
train
private void parseAttlistDecl() throws Exception { String elementName; requireWhitespace(); elementName = readNmtoken(true); boolean white = tryWhitespace(); while (!tryRead('>')) { if (!white) { fatal("whitespace required before attribute definition"...
java
{ "resource": "" }
q155145
XmlParser.parseAttDef
train
private void parseAttDef(String elementName) throws Exception { String name; String type; String enumer = null; // Read the attribute name. name = readNmtoken(true); // Read the attribute type. requireWhitespace(); type = readAttType(); // Get t...
java
{ "resource": "" }
q155146
XmlParser.readAttType
train
private String readAttType() throws Exception { if (tryRead('(')) { parseEnumeration(false); return "ENUMERATION"; } else { String typeString = readNmtoken(true); if (handler.stringInterning) { if ("NOTATION" == typeString) { ...
java
{ "resource": "" }
q155147
XmlParser.parseEnumeration
train
private void parseEnumeration(boolean isNames) throws Exception { dataBufferAppend('('); // Read the first token. skipWhitespace(); dataBufferAppend(readNmtoken(isNames)); // Read the remaining tokens. skipWhitespace(); while (!tryRead(')')) { require...
java
{ "resource": "" }
q155148
XmlParser.parseDefault
train
private void parseDefault(String elementName, String name, String type, String enumer) throws Exception { int valueType = ATTRIBUTE_DEFAULT_SPECIFIED; String value = null; int flags = LIT_ATTRIBUTE; boolean saved = expandPE; String defaultType = null; // LIT_...
java
{ "resource": "" }
q155149
XmlParser.parseConditionalSect
train
private void parseConditionalSect(char[] saved) throws Exception { skipWhitespace(); if (tryRead("INCLUDE")) { skipWhitespace(); require('['); // VC: Proper Conditional Section/PE Nesting if (readBuffer != saved) { handler.verror("Illegal C...
java
{ "resource": "" }
q155150
XmlParser.parseCharRef
train
private void parseCharRef(boolean doFlush) throws SAXException, IOException { int value = 0; char c; if (tryRead('x')) { loop1: while (true) { c = readCh(); if (c == ';') { break loop1; } else { ...
java
{ "resource": "" }
q155151
XmlParser.parseEntityRef
train
private void parseEntityRef(boolean externalAllowed) throws SAXException, IOException { String name; name = readNmtoken(true); require(';'); switch (getEntityType(name)) { case ENTITY_UNDECLARED: // NOTE: XML REC describes amazingly convoluted han...
java
{ "resource": "" }
q155152
XmlParser.parsePEReference
train
private void parsePEReference() throws SAXException, IOException { String name; name = "%" + readNmtoken(true); require(';'); switch (getEntityType(name)) { case ENTITY_UNDECLARED: // VC: Entity Declared handler.verror("reference to undeclared...
java
{ "resource": "" }
q155153
XmlParser.parseEntityDecl
train
private void parseEntityDecl() throws Exception { boolean peFlag = false; int flags = 0; // Check for a parameter entity. expandPE = false; requireWhitespace(); if (tryRead('%')) { peFlag = true; requireWhitespace(); } expandPE = t...
java
{ "resource": "" }
q155154
XmlParser.parseNotationDecl
train
private void parseNotationDecl() throws Exception { String nname; ExternalIdentifiers ids; requireWhitespace(); nname = readNmtoken(true); // NE08 if (nname.indexOf(':') >= 0) { fatal("Illegal character(':') in notation name ", nname, null); } ...
java
{ "resource": "" }
q155155
XmlParser.parseCharData
train
private void parseCharData() throws Exception { char c; int state = 0; boolean pureWhite = false; // assert (dataBufferPos == 0); // are we expecting pure whitespace? it might be dirty... if ((currentElementContent == CONTENT_ELEMENTS) && !isDirtyCurrent...
java
{ "resource": "" }
q155156
XmlParser.requireWhitespace
train
private void requireWhitespace() throws SAXException, IOException { char c = readCh(); if (isWhitespace(c)) { skipWhitespace(); } else { fatal("whitespace required", c, null); } }
java
{ "resource": "" }
q155157
XmlParser.skipWhitespace
train
private void skipWhitespace() throws SAXException, IOException { // OK, do it the slow way. char c = readCh(); while (isWhitespace(c)) { c = readCh(); } unread(c); }
java
{ "resource": "" }
q155158
XmlParser.readExternalIds
train
private ExternalIdentifiers readExternalIds(boolean inNotation, boolean isSubset) throws Exception { char c; ExternalIdentifiers ids = new ExternalIdentifiers(); int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF; if (tryRead("PUBLIC")) { requireWhi...
java
{ "resource": "" }
q155159
XmlParser.isWhitespace
train
private boolean isWhitespace(char c) { if (c > 0x20) { return false; } if ((c == 0x20) || (c == 0x0a) || (c == 0x09) || (c == 0x0d)) { return true; } return false; // illegal ... }
java
{ "resource": "" }
q155160
XmlParser.dataBufferAppend
train
private void dataBufferAppend(char c) { // Expand buffer if necessary. if (dataBufferPos >= dataBuffer.length) { dataBuffer = (char[]) extendArray(dataBuffer, dataBuffer.length, dataBufferPos); } dataBuffer[dataBufferPos++] = c; }
java
{ "resource": "" }
q155161
XmlParser.dataBufferNormalize
train
private void dataBufferNormalize() { int i = 0; int j = 0; int end = dataBufferPos; // Skip spaces at the start. while ((j < end) && (dataBuffer[j] == ' ')) { j++; } // Skip whitespace at the end. while ((end > j) && (dataBuffer[end - 1] == '...
java
{ "resource": "" }
q155162
XmlParser.dataBufferFlush
train
private void dataBufferFlush() throws SAXException { int saveLine = line; int saveColumn = column; line = linePrev; column = columnPrev; if ((currentElementContent == CONTENT_ELEMENTS) && (dataBufferPos > 0) && !inCDATA) { // We can't just trust the bu...
java
{ "resource": "" }
q155163
XmlParser.require
train
private void require(char delim) throws SAXException, IOException { char c = readCh(); if (c != delim) { fatal("required character", c, Character.valueOf(delim).toString()); } }
java
{ "resource": "" }
q155164
XmlParser.extendArray
train
private Object extendArray(Object array, int currentSize, int requiredSize) { if (requiredSize < currentSize) { return array; } else { Object newArray = null; int newSize = currentSize * 2; if (newSize <= requiredSize) { newSize = required...
java
{ "resource": "" }
q155165
XmlParser.filterCR
train
private void filterCR(boolean moreData) { int i, j; readBufferOverflow = -1; loop: for (i = j = readBufferPos; j < readBufferLength; i++, j++) { switch (readBuffer[j]) { case '\r': if (j == readBufferLength - 1) { if (more...
java
{ "resource": "" }
q155166
XmlParser.initializeVariables
train
private void initializeVariables() throws SAXException { prev = '\u0000'; // First line line = 0; column = 1; linePrev = 0; columnPrev = 1; nextCharOnNewLine = true; // Set up the buffers for data and names dataBufferPos = 0; dataBuffer = ...
java
{ "resource": "" }
q155167
NormalizationChecker.characters
train
@SuppressWarnings("deprecation") @Override public void characters(char[] ch, int start, int length) throws SAXException { if (alreadyComplainedAboutThisRun) { return; } if (atStartOfRun) { char c = ch[start]; if (pos == 1) { ...
java
{ "resource": "" }
q155168
NormalizationChecker.appendToBuf
train
private void appendToBuf(char[] ch, int start, int end) { if (start == end) { return; } int neededBufLen = pos + (end - start); if (neededBufLen > buf.length) { char[] newBuf = new char[neededBufLen]; System.arraycopy(buf, 0, newBuf, 0, pos); ...
java
{ "resource": "" }
q155169
SAXDriver.verror
train
void verror(String message) throws SAXException { SAXParseException err; err = new SAXParseException(message, this); errorHandler.error(err); }
java
{ "resource": "" }
q155170
PrudentHttpEntityResolver.setParams
train
public static void setParams(int connectionTimeout, int socketTimeout, int maxRequests) { PrudentHttpEntityResolver.maxRequests = maxRequests; PoolingHttpClientConnectionManager phcConnMgr; Registry<ConnectionSocketFactory> registry = // RegistryBuilder.<ConnectionSocketFacto...
java
{ "resource": "" }
q155171
Cell.errOnHorizontalOverlap
train
public void errOnHorizontalOverlap(Cell laterCell) throws SAXException { if (!((laterCell.right <= left) || (right <= laterCell.left))) { this.err("Table cell is overlapped by later table cell."); laterCell.err("Table cell overlaps an earlier table cell."); } }
java
{ "resource": "" }
q155172
Checker.warn
train
public void warn(String message) throws SAXException { if (errorHandler != null) { SAXParseException spe = new SAXParseException(message, locator); errorHandler.warning(spe); } }
java
{ "resource": "" }
q155173
Checker.warn
train
public void warn(String message, Locator overrideLocator) throws SAXException { if (errorHandler != null) { SAXParseException spe = new SAXParseException(message, overrideLocator); errorHandler.warning(spe); } }
java
{ "resource": "" }
q155174
Checker.err
train
public void err(String message, Locator overrideLocator) throws SAXException { if (errorHandler != null) { SAXParseException spe = new SAXParseException(message, overrideLocator); errorHandler.error(spe); } }
java
{ "resource": "" }
q155175
Checker.err
train
public void err(String message) throws SAXException { if (errorHandler != null) { SAXParseException spe = new SAXParseException(message, locator); errorHandler.error(spe); } }
java
{ "resource": "" }
q155176
EmbeddedValidator.validate
train
public String validate(Path path) throws IOException, SAXException { try (OneOffValidator validator = new OneOffValidator(asciiQuotes, detectLanguages, forceHTML, lineOffset, loadEntities, noStream, outputFormat, schemaUrl)) { return validator.validate(path); } }
java
{ "resource": "" }
q155177
EmbeddedValidator.validate
train
public String validate(InputStream in) throws IOException, SAXException { try (OneOffValidator validator = new OneOffValidator(asciiQuotes, detectLanguages, forceHTML, lineOffset, loadEntities, noStream, outputFormat, schemaUrl)) { return validator.validate(in); } }
java
{ "resource": "" }
q155178
TableChecker.pop
train
private void pop() throws SAXException { if (current == null) { throw new IllegalStateException("Bug!"); } current.end(); if (stack.isEmpty()) { current = null; } else { current = stack.removeLast(); } }
java
{ "resource": "" }
q155179
AttributeUtil.split
train
public static String[] split(String value) { if (value == null || "".equals(value)) { return EMPTY_STRING_ARRAY; } int len = value.length(); List<String> list = new LinkedList<>(); boolean collectingSpace = true; int start = 0; for (int i = 0; i < len;...
java
{ "resource": "" }
q155180
Shell.evaluate
train
public Object evaluate(Input input) { if (noInput(input)) { return NO_INPUT; } String line = input.words().stream().collect(Collectors.joining(" ")).trim(); String command = findLongestCommand(line); List<String> words = input.words(); if (command != null) { MethodTarget methodTarget = methodTargets...
java
{ "resource": "" }
q155181
TableBuilder.addOutlineBorder
train
public TableBuilder addOutlineBorder(BorderStyle style) { this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), OUTLINE, style); return this; }
java
{ "resource": "" }
q155182
TableBuilder.addHeaderBorder
train
public TableBuilder addHeaderBorder(BorderStyle style) { this.addBorder(0, 0, 1, model.getColumnCount(), OUTLINE, style); return addOutlineBorder(style); }
java
{ "resource": "" }
q155183
TableBuilder.addFullBorder
train
public TableBuilder addFullBorder(BorderStyle style) { this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), FULL, style); return this; }
java
{ "resource": "" }
q155184
TableBuilder.addHeaderAndVerticalsBorders
train
public TableBuilder addHeaderAndVerticalsBorders(BorderStyle style) { this.addBorder(0, 0, 1, model.getColumnCount(), OUTLINE, style); this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), OUTLINE | INNER_VERTICAL, style); return this; }
java
{ "resource": "" }
q155185
TableBuilder.addInnerBorder
train
public TableBuilder addInnerBorder(BorderStyle style) { this.addBorder(0, 0, model.getRowCount(), model.getColumnCount(), INNER, style); return this; }
java
{ "resource": "" }
q155186
Tables.configureKeyValueRendering
train
public static TableBuilder configureKeyValueRendering(TableBuilder builder, String delimiter) { return builder.on(CellMatchers.ofType(Map.class)) .addFormatter(new MapFormatter(delimiter)) .addAligner(new KeyValueHorizontalAligner(delimiter.trim())) .addSizer(new KeyValueSizeConstraints(delimiter)) .a...
java
{ "resource": "" }
q155187
InteractiveShellApplicationRunner.disable
train
public static void disable(ConfigurableEnvironment environment) { environment.getPropertySources().addFirst(new MapPropertySource("interactive.override", Collections.singletonMap(SPRING_SHELL_INTERACTIVE_ENABLED, "false"))); }
java
{ "resource": "" }
q155188
Utils.unCamelify
train
public static String unCamelify(CharSequence original) { StringBuilder result = new StringBuilder(original.length()); boolean wasLowercase = false; for (int i = 0; i < original.length(); i++) { char ch = original.charAt(i); if (Character.isUpperCase(ch) && wasLowercase) { result.append('-'); } was...
java
{ "resource": "" }
q155189
Utils.createMethodParameter
train
public static MethodParameter createMethodParameter(Executable executable, int i) { MethodParameter methodParameter; if (executable instanceof Method) { methodParameter = new MethodParameter((Method) executable, i); } else if (executable instanceof Constructor){ methodParameter = new MethodParameter((Constr...
java
{ "resource": "" }
q155190
JaxrsReader.hasCommonParameter
train
private boolean hasCommonParameter(Parameter parameter) { Parameter commonParameter = swagger.getParameter(parameter.getName()); return commonParameter != null && parameter.getIn().equals(commonParameter.getIn()); }
java
{ "resource": "" }
q155191
AbstractReader.getParameters
train
protected final List<Parameter> getParameters(Type type, List<Annotation> annotations) { return getParameters(type, annotations, typesToSkip); }
java
{ "resource": "" }
q155192
AbstractReader.getParameters
train
protected List<Parameter> getParameters(Type type, List<Annotation> annotations, Set<Type> typesToSkip) { if (!hasValidAnnotations(annotations) || isApiParamHidden(annotations)) { return Collections.emptyList(); } Iterator<SwaggerExtension> chain = SwaggerExtensions.chain(); ...
java
{ "resource": "" }
q155193
SpringUtils.getControllerResquestMapping
train
public static String[] getControllerResquestMapping(Class<?> controllerClazz) { String[] controllerRequestMappingValues = {}; // Determine if we will use class-level requestmapping or dummy string RequestMapping classRequestMapping = AnnotationUtils.findAnnotation(controllerClazz, RequestMapping.class); if (classR...
java
{ "resource": "" }
q155194
ApiDocumentMojo.validateConfiguration
train
private void validateConfiguration(ApiSource apiSource) throws GenerateException { if (apiSource == null) { throw new GenerateException("You do not configure any apiSource!"); } else if (apiSource.getInfo() == null) { throw new GenerateException("`<info>` is required by Swagger S...
java
{ "resource": "" }
q155195
AbstractDocumentSource.loadSwaggerExtensions
train
private void loadSwaggerExtensions(ApiSource apiSource) throws GenerateException { if (apiSource.getSwaggerExtensions() != null) { List<SwaggerExtension> extensions = SwaggerExtensions.getExtensions(); extensions.addAll(resolveSwaggerExtensions()); } }
java
{ "resource": "" }
q155196
Diagram.diagram
train
public static Diagram diagram( String name, Figure figure ) { return new Diagram( requireNonNull( name, "name" ), FigureBuilder.root( requireNonNull( figure, "figure" ) ) ); }
java
{ "resource": "" }
q155197
Reflection.defaultInvoker
train
public static MethodHandle defaultInvoker( Method method ) { if ( !method.isDefault() ) { throw new IllegalArgumentException( "Not a default method: " + method ); } try { return LOOKUP.unreflectSpecial( method, method.getDeclaringClass() ); } ...
java
{ "resource": "" }
q155198
Reflection.invoke
train
public static Object invoke( MethodHandle method, Object target ) { try { return method.invokeWithArguments( target ); } catch ( RuntimeException | Error e ) { throw e; } catch ( Throwable e ) { throw new RuntimeExce...
java
{ "resource": "" }
q155199
XmlFile.parse
train
public <T> T parse( XmlParser<T> parser ) throws ParserConfigurationException, SAXException, IOException { return resolver.parse( path, parser ); }
java
{ "resource": "" }