Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
294,100
boolean (PsiElement[] elements, int discardCost) { if (elements.length != myElementAnchors.length) { return false; } for (int i = 0; i < myElementAnchors.length; i++) { PsiElement one = myElementAnchors[i].retrieve(); PsiElement two = elements[i]; if (one == null || two == null || !myHasher.areTreesEqual(one, two, disc...
isEqual
294,101
void (@Nullable CustomPortService manager) { this.manager = manager; }
setManager
294,102
boolean () { return manager != null && manager.isBound(); }
isBound
294,103
void () { if (manager != null) { manager.rebind(); } }
portChanged
294,104
Object (@NotNull ComponentManager componentManager, @NotNull PluginDescriptor pluginDescriptor) { if (service == null) { return super.createInstance(componentManager, pluginDescriptor); } else { try { return ApplicationManager.getApplication().getService(Class.forName(service, true, pluginDescriptor.getPluginClassLoade...
createInstance
294,105
void (@NotNull Throwable e) { //noinspection CallToPrintStackTrace e.printStackTrace(); }
exceptionCaught
294,106
void (@NotNull Client client, @Nullable Map<String, List<String>> parameters) { }
connected
294,107
void (@NotNull Client client) { }
disconnected
294,108
EventLoop () { return channel.eventLoop(); }
getEventLoop
294,109
ByteBufAllocator () { return channel.alloc(); }
getByteBufAllocator
294,110
void (@NotNull ExceptionHandler exceptionHandler) { if (!messageCallbackMap.isEmpty()) { for (AsyncPromise<?> promise : messageCallbackMap.values()) { try { promise.setError("rejected"); } catch (Throwable e) { exceptionHandler.exceptionCaught(e); } } } }
rejectAsyncResults
294,111
JsonRpcServer () { return BinaryRequestHandler.EP_NAME.findExtension(RpcBinaryRequestHandler.class).getServer(); }
getRpcServerInstance
294,112
JsonRpcServer () { clientManager.getValue(); return rpcServer; }
getServer
294,113
UUID () { return ID; }
getId
294,114
ChannelHandler (@NotNull ChannelHandlerContext context) { SocketClient client = new SocketClient(context.channel()); context.channel().attr(ClientManagerKt.getCLIENT()).set(client); clientManager.getValue().addClient(client); connected(client, null); return new MyDecoder(client); }
getInboundHandler
294,115
void (@NotNull Throwable e) { LOG.error(e); }
exceptionCaught
294,116
void (@NotNull Client client, @Nullable Map<String, List<String>> parameters) { }
connected
294,117
void (@NotNull Client client) { }
disconnected
294,118
void (@NotNull ChannelHandlerContext context, @NotNull ByteBuf input) { while (true) { switch (state) { case LENGTH: { ByteBuf buffer = getBufferIfSufficient(input, 4, context); if (buffer == null) { return; } state = State.CONTENT; contentLength = buffer.readInt(); } case CONTENT: { CharSequence content = readChars(in...
messageReceived
294,119
void (ChannelHandlerContext context) { Client client = context.channel().attr(ClientManagerKt.getCLIENT()).get(); // if null, so, has already been explicitly removed if (client != null) { clientManager.getValue().disconnectClient(context.channel(), client, false); } }
channelInactive
294,120
ChannelFuture (@NotNull ByteBuf message) { if (channel.isOpen()) { ByteBuf lengthBuffer = channel.alloc().ioBuffer(4); lengthBuffer.writeInt(message.readableBytes()); channel.write(lengthBuffer); return channel.writeAndFlush(message); } else { return channel.newFailedFuture(new ClosedChannelException()); } }
send
294,121
void () { }
sendHeartbeat
294,122
boolean (@NotNull FullHttpRequest request) { return request.method() == HttpMethod.GET && "WebSocket".equalsIgnoreCase(request.headers().getAsString(HttpHeaderNames.UPGRADE)) && request.uri().length() > 2; }
isSupported
294,123
void (@NotNull ClientManager server) { }
serverCreated
294,124
void (@NotNull Throwable e) { NettyUtil.log(e, LOG); }
exceptionCaught
294,125
boolean (@NotNull QueryStringDecoder urlDecoder, @NotNull FullHttpRequest request, @NotNull ChannelHandlerContext context) { handleWebSocketRequest(context, request, urlDecoder); return true; }
process
294,126
void (@NotNull final ChannelHandlerContext context, @NotNull FullHttpRequest request, @NotNull final QueryStringDecoder uriDecoder) { WebSocketServerHandshakerFactory factory = new WebSocketServerHandshakerFactory("ws://" + request.headers().getAsString(HttpHeaderNames.HOST) + uriDecoder.path(), null, false, NettyUtil....
handleWebSocketRequest
294,127
void (ChannelFuture future) { if (future.isSuccess()) { ClientManager clientManager = WebSocketHandshakeHandler.this.clientManager.getValue(); clientManager.addClient(client); MessageChannelHandler messageChannelHandler = new MessageChannelHandler(clientManager, getMessageServer()); BuiltInServer.Companion.replaceDefau...
operationComplete
294,128
void (@NotNull Client client, @Nullable Map<String, List<String>> parameters) { }
connected
294,129
WebSocketServerOptions (int value) { heartbeatDelay = value; return this; }
heartbeatDelay
294,130
WebSocketServerOptions (int value) { closeTimeout = value; return this; }
closeTimeout
294,131
ChannelFuture (@NotNull ByteBuf message) { return sendFrame(message, false); }
send
294,132
ChannelFuture (@NotNull ByteBuf message, boolean binary) { if (channel.isOpen()) { return channel.writeAndFlush(binary ? new BinaryWebSocketFrame(message) : new TextWebSocketFrame(message)); } else { return channel.newFailedFuture(new ClosedChannelException()); } }
sendFrame
294,133
void () { channel.writeAndFlush(new PingWebSocketFrame()); }
sendHeartbeat
294,134
void (@NotNull CloseWebSocketFrame frame) { handshaker.close(channel, frame); }
disconnect
294,135
void (@NotNull Channel channel, @NotNull CloseWebSocketFrame message) { WebSocketClient client = (WebSocketClient)channel.attr(ClientManagerKt.getCLIENT()).get(); if (client == null) { super.closeFrameReceived(channel, message); } else { try { clientManager.disconnectClient(channel, client, false); } finally { client.d...
closeFrameReceived
294,136
void (@NotNull Channel channel, @NotNull TextWebSocketFrame message) { WebSocketClient client = (WebSocketClient)channel.attr(ClientManagerKt.getCLIENT()).get(); CharSequence chars; try { chars = readUtf8(message.content()); } catch (Throwable e) { try { message.release(); } finally { clientManager.getExceptionHandler(...
textFrameReceived
294,137
void (@NotNull ChannelHandlerContext context, @NotNull Throwable cause) { try { clientManager.getExceptionHandler().exceptionCaught(cause); } finally { super.exceptionCaught(context, cause); } }
exceptionCaught
294,138
ConsoleView (@NotNull NetService netService) { if (console == null) { createConsole(netService); } return console; }
getConsole
294,139
void (@NotNull final NetService netService) { TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject()); netService.configureConsole(consoleBuilder); console = consoleBuilder.getConsole(); ApplicationManager.getApplication().invokeLater(() -> { ActionGroup action...
createConsole
294,140
BuiltInServerOptions () { return ApplicationManager.getApplication().getService(BuiltInServerOptions.class); }
getInstance
294,141
BuiltInServerOptions () { return this; }
getState
294,142
void (@NotNull BuiltInServerOptions state) { XmlSerializerUtil.copyBean(state, this); }
loadState
294,143
int () { MyCustomPortServerManager portServerManager = CustomPortServerManager.EP_NAME.findExtensionOrFail(MyCustomPortServerManager.class); if (!portServerManager.isBound()) { return BuiltInServerManager.getInstance().getPort(); } return builtInServerPort; }
getEffectiveBuiltInServerPort
294,144
void (@NotNull Exception e, int port) { String message = BuiltInServerBundle.message("notification.content.cannot.start.built.in.http.server.on.custom.port", port, ApplicationNamesInfo.getInstance().getFullProductName()); new Notification(BuiltInServerManagerImpl.NOTIFICATION_GROUP, message, NotificationType.ERROR).not...
cannotBind
294,145
int () { int port = getInstance().builtInServerPort; return port == DEFAULT_PORT ? -1 : port; }
getPort
294,146
boolean () { return getInstance().builtInServerAvailableExternally; }
isAvailableExternally
294,147
void () { CustomPortServerManager.EP_NAME.forEachExtensionSafe(extension -> { CustomPortServerManagerBase baseManager = (CustomPortServerManagerBase) extension; if (baseManager != null) { baseManager.portChanged(); } }); }
onBuiltInServerPortChanged
294,148
String (Date date) { return simpleDateFormat.format(date); }
format
294,149
TimeZone () { return simpleDateFormat.getTimeZone(); }
getTimeZone
294,150
void (TimeZone timeZone) { simpleDateFormat.setTimeZone(timeZone); }
setTimeZone
294,151
String (String pattern) { boolean inside = false; boolean mark = false; boolean modifiedCommand = false; StringBuilder buf = new StringBuilder(); for (int i = 0; i < pattern.length(); i++) { char c = pattern.charAt(i); if (c == '%' && !mark) { mark = true; } else { if (mark) { if (modifiedCommand) { //don't do anything...
convertDateFormat
294,152
String (String str, boolean insideQuotes) { String retVal = str; if (!insideQuotes) { retVal = '\'' + retVal + '\''; } return retVal; }
quote
294,153
boolean (StringBuilder buf, String pattern, int index, boolean oldInside) { char firstChar = pattern.charAt(index); boolean newInside = oldInside; //O and E are modifiers, they mean to present an alternative representation of the next char //we just handle the next char as if the O or E wasn't there if (firstChar == 'O...
translateCommand
294,154
void (String configTimeFmt, boolean fromConstructor) { this.configTimeFmt = configTimeFmt; this.strftime = new Strftime(configTimeFmt, Locale.US); setDateVariables(fromConstructor); }
setConfigTimeFormat
294,155
String (String variableName) { return getVariableValue(variableName, "none"); }
getVariableValue
294,156
String (@NotNull String variableName, String encoding) { String variableValue = ssiExternalResolver.getVariableValue(variableName); return variableValue == null ? null : encode(variableValue, encoding); }
getVariableValue
294,157
String (String val) { // If it has no references or HTML entities then no work // need to be done if (val.indexOf('$') < 0 && val.indexOf('&') < 0) { return val; } val = val.replace("&lt;", "<"); val = val.replace("&gt;", ">"); val = val.replace("&quot;", "\""); val = val.replace("&amp;", "&"); StringBuilder sb = new S...
substituteVariables
294,158
void (boolean fromConstructor) { if (fromConstructor && alreadySet) { return; } alreadySet = true; Date date = new Date(); TimeZone timeZone = TimeZone.getTimeZone("GMT"); ssiExternalResolver.setVariableValue("DATE_GMT", formatDate(date, timeZone)); ssiExternalResolver.setVariableValue("DATE_LOCAL", formatDate(date, nu...
setDateVariables
294,159
String (@NotNull Date date, @Nullable TimeZone timeZone) { if (timeZone == null) { return strftime.format(date); } else { TimeZone oldTimeZone = strftime.getTimeZone(); strftime.setTimeZone(timeZone); String retVal = strftime.format(date); strftime.setTimeZone(oldTimeZone); return retVal; } }
formatDate
294,160
String (@NotNull String value, @NotNull String encoding) { if (encoding.equalsIgnoreCase("url")) { return urlEscaper.escape(value); } else if (encoding.equalsIgnoreCase("none")) { return value; } else if (encoding.equalsIgnoreCase("entity")) { return HtmlEscapers.htmlEscaper().escape(value); } else { throw new IllegalA...
encode
294,161
long (@NotNull SsiProcessingState state, @NotNull String commandName, @NotNull List<String> paramNames, String @NotNull [] paramValues, @NotNull ByteBufUtf8Writer writer) { long lastModified = 0; String configErrMsg = state.configErrorMessage; for (int i = 0; i < paramNames.size(); i++) { String paramName = paramNames....
process
294,162
String (long size, @NotNull String format) { if (format.equalsIgnoreCase("bytes")) { return new DecimalFormat("#,##0").format(size); } String result; if (size == 0) { result = "0k"; } else if (size < ONE_KILOBYTE) { result = "1k"; } else if (size < ONE_MEGABYTE) { result = (size + 512) / ONE_KILOBYTE + "k"; } else if (...
formatSize
294,163
boolean () { return root.evaluate(); }
evaluateTree
294,164
void (OppNode node) { // If node is null then it's just a group marker if (node == null) { oppStack.add(0, null); return; } while (true) { if (oppStack.size() == 0) break; OppNode top = oppStack.get(0); // If the top is a spacer then don't pop // anything if (top == null) break; // If the top node has a lower precedenc...
pushOpp
294,165
void () { OppNode top; while ((top = oppStack.remove(0)) != null) { // Let it fill its branches top.popValues(nodeStack); // Stick it on the resolved node stack nodeStack.add(0, top); } }
resolveGroup
294,166
String () { if (resolved == null) { resolved = ssiProcessingState.substituteVariables(value.toString()); } return resolved; }
getValue
294,167
boolean () { return !(getValue().length() == 0); }
evaluate
294,168
String () { return value.toString(); }
toString
294,169
void (List<Node> values) { right = values.remove(0); left = values.remove(0); }
popValues
294,170
boolean () { return !left.evaluate(); }
evaluate
294,171
int () { return PRECEDENCE_NOT; }
getPrecedence
294,172
void (List<Node> values) { left = values.remove(0); }
popValues
294,173
String () { return left + " NOT"; }
toString
294,174
boolean () { if (!left.evaluate()) // Short circuit { return false; } return right.evaluate(); }
evaluate
294,175
int () { return PRECEDENCE_LOGICAL; }
getPrecedence
294,176
String () { return left + " " + right + " AND"; }
toString
294,177
boolean () { if (left.evaluate()) // Short circuit { return true; } return right.evaluate(); }
evaluate
294,178
int () { return PRECEDENCE_LOGICAL; }
getPrecedence
294,179
String () { return left + " " + right + " OR"; }
toString
294,180
int () { String val1 = ((StringNode)left).getValue(); String val2 = ((StringNode)right).getValue(); int val2Len = val2.length(); if (val2Len > 1 && val2.charAt(0) == '/' && val2.charAt(val2Len - 1) == '/') { // Treat as a regular expression String expr = val2.substring(1, val2Len - 1); try { Pattern pattern = Pattern.c...
compareBranches
294,181
boolean () { return (compareBranches() == 0); }
evaluate
294,182
int () { return PRECEDENCE_COMPARE; }
getPrecedence
294,183
String () { return left + " " + right + " EQ"; }
toString
294,184
boolean () { return (compareBranches() > 0); }
evaluate
294,185
int () { return PRECEDENCE_COMPARE; }
getPrecedence
294,186
String () { return left + " " + right + " GT"; }
toString
294,187
boolean () { return (compareBranches() < 0); }
evaluate
294,188
int () { return PRECEDENCE_COMPARE; }
getPrecedence
294,189
String () { return left + " " + right + " LT"; }
toString
294,190
boolean () { return index < length; }
hasMoreTokens
294,191
int () { return index; }
getIndex
294,192
boolean (char c) { return Character.isWhitespace(c) || c == '(' || c == ')' || c == '!' || c == '<' || c == '>' || c == '|' || c == '&' || c == '='; }
isMetaChar
294,193
int () { // Skip any leading white space while (index < length && Character.isWhitespace(expr[index])) { index++; } // Clear the current token val tokenVal = null; if (index == length) return TOKEN_END; // End of string int start = index; char currentChar = expr[index]; char nextChar = (char)0; index++; if (index < len...
nextToken
294,194
String () { return tokenVal; }
getTokenValue
294,195
long (@NotNull SsiProcessingState ssiProcessingState, @NotNull String commandName, @NotNull List<String> paramNames, String @NotNull [] paramValues, @NotNull ByteBufUtf8Writer writer) { // Assume anything using conditionals was modified by it long lastModified = System.currentTimeMillis(); // Retrieve the current state...
process
294,196
boolean (@NotNull List<String> names, String @NotNull [] values, @NotNull SsiProcessingState ssiProcessingState) { String expression = "expr".equalsIgnoreCase(names.get(0)) ? values[0] : null; if (expression == null) { throw new SsiStopProcessingException(); } try { return new ExpressionParseTree(expression, ssiProcess...
evaluateArguments
294,197
ChangeApplier (@NotNull List<? extends @NotNull VFileEvent> events) { return WebServerPageConnectionService.Companion.getInstance() .reloadRelatedClients(ContainerUtil.mapNotNull(events, VFileEvent::getFile)); }
prepareChange
294,198
ProxySelector (String pacUrlForUse) { ProxySelector newProxySelector; if (pacUrlForUse == null) { ProxySearch proxySearch = ProxySearch.getDefaultProxySearch(); // cache 32 urls for up to 10 min proxySearch.setPacCacheSettings(32, 10 * 60 * 1000, BufferedProxySelector.CacheScope.CACHE_SCOPE_HOST); newProxySelector = pr...
getProxySelector
294,199
PowerStatus () { return PowerService.Companion.getService().status(); }
getPowerStatus