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
130,000
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/discovery/cloud/gcp/GoogleComputeInstanceMetadataResolver.java
GoogleComputeInstanceMetadataResolver.readGcMetadataUrl
@Deprecated protected JsonNode readGcMetadataUrl(URL url, int connectionTimeoutMs, int readTimeoutMs) throws IOException { return readMetadataUrl(url, connectionTimeoutMs, readTimeoutMs, objectMapper, Collections.emptyMap()); }
java
@Deprecated protected JsonNode readGcMetadataUrl(URL url, int connectionTimeoutMs, int readTimeoutMs) throws IOException { return readMetadataUrl(url, connectionTimeoutMs, readTimeoutMs, objectMapper, Collections.emptyMap()); }
[ "@", "Deprecated", "protected", "JsonNode", "readGcMetadataUrl", "(", "URL", "url", ",", "int", "connectionTimeoutMs", ",", "int", "readTimeoutMs", ")", "throws", "IOException", "{", "return", "readMetadataUrl", "(", "url", ",", "connectionTimeoutMs", ",", "readTime...
Get instance Metadata JSON. @param url The metadata URL @param connectionTimeoutMs connection timeout in millis @param readTimeoutMs read timeout in millis @return The Metadata JSON @throws IOException Failed or interrupted I/O operations while reading from input stream. @deprecated See {@link io...
[ "Get", "instance", "Metadata", "JSON", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/discovery/cloud/gcp/GoogleComputeInstanceMetadataResolver.java#L211-L214
130,001
micronaut-projects/micronaut-core
http-server-netty/src/main/java/io/micronaut/http/server/netty/HttpDataReference.java
HttpDataReference.addComponent
Component addComponent(Consumer<IOException> onError) { Component component; try { long readable = readableBytes(data); long offset = position.getAndUpdate(p -> readable); int length = new Long(readable - offset).intValue(); component = new Component(lengt...
java
Component addComponent(Consumer<IOException> onError) { Component component; try { long readable = readableBytes(data); long offset = position.getAndUpdate(p -> readable); int length = new Long(readable - offset).intValue(); component = new Component(lengt...
[ "Component", "addComponent", "(", "Consumer", "<", "IOException", ">", "onError", ")", "{", "Component", "component", ";", "try", "{", "long", "readable", "=", "readableBytes", "(", "data", ")", ";", "long", "offset", "=", "position", ".", "getAndUpdate", "(...
Adds a reference to a section of the http data. Should only be called after data has been added to the underlying http data. @param onError A consumer to call if an IOException occurs @return The newly added component, or null if an error occurred
[ "Adds", "a", "reference", "to", "a", "section", "of", "the", "http", "data", ".", "Should", "only", "be", "called", "after", "data", "has", "been", "added", "to", "the", "underlying", "http", "data", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/HttpDataReference.java#L86-L113
130,002
micronaut-projects/micronaut-core
http-server-netty/src/main/java/io/micronaut/http/server/netty/HttpDataReference.java
HttpDataReference.removeComponent
void removeComponent(int index) { Component component = components.get(index); components.remove(index); updateComponentOffsets(index); position.getAndUpdate((offset) -> offset - component.length); }
java
void removeComponent(int index) { Component component = components.get(index); components.remove(index); updateComponentOffsets(index); position.getAndUpdate((offset) -> offset - component.length); }
[ "void", "removeComponent", "(", "int", "index", ")", "{", "Component", "component", "=", "components", ".", "get", "(", "index", ")", ";", "components", ".", "remove", "(", "index", ")", ";", "updateComponentOffsets", "(", "index", ")", ";", "position", "....
Removes a section from the http data and updates the indices of the remaining components. @param index The index of the component to remove.
[ "Removes", "a", "section", "from", "the", "http", "data", "and", "updates", "the", "indices", "of", "the", "remaining", "components", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/HttpDataReference.java#L121-L126
130,003
micronaut-projects/micronaut-core
http-server-netty/src/main/java/io/micronaut/http/server/netty/HttpDataReference.java
HttpDataReference.destroy
void destroy() { fileAccess.getAndUpdate(channel -> { if (channel != null) { try { channel.close(); } catch (IOException e) { LOG.warn("Error closing file channel for disk file upload", e); } } ...
java
void destroy() { fileAccess.getAndUpdate(channel -> { if (channel != null) { try { channel.close(); } catch (IOException e) { LOG.warn("Error closing file channel for disk file upload", e); } } ...
[ "void", "destroy", "(", ")", "{", "fileAccess", ".", "getAndUpdate", "(", "channel", "->", "{", "if", "(", "channel", "!=", "null", ")", "{", "try", "{", "channel", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "LOG"...
Closes any file related access if the upload is on disk and releases the buffer for the file.
[ "Closes", "any", "file", "related", "access", "if", "the", "upload", "is", "on", "disk", "and", "releases", "the", "buffer", "for", "the", "file", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/HttpDataReference.java#L173-L185
130,004
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/util/StringUtils.java
StringUtils.convertDotToUnderscore
public static String convertDotToUnderscore(String dottedProperty, boolean uppercase) { if (dottedProperty == null) { return dottedProperty; } Optional<String> converted = Optional.of(dottedProperty) .map(value -> value.replace('.', '_')) .map(value -> upperca...
java
public static String convertDotToUnderscore(String dottedProperty, boolean uppercase) { if (dottedProperty == null) { return dottedProperty; } Optional<String> converted = Optional.of(dottedProperty) .map(value -> value.replace('.', '_')) .map(value -> upperca...
[ "public", "static", "String", "convertDotToUnderscore", "(", "String", "dottedProperty", ",", "boolean", "uppercase", ")", "{", "if", "(", "dottedProperty", "==", "null", ")", "{", "return", "dottedProperty", ";", "}", "Optional", "<", "String", ">", "converted"...
Replace the dots in the property with underscore and transform to uppercase based on given flag. @param dottedProperty The property with dots, example - a.b.c @param uppercase To transform to uppercase string @return The converted value
[ "Replace", "the", "dots", "in", "the", "property", "with", "underscore", "and", "transform", "to", "uppercase", "based", "on", "given", "flag", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StringUtils.java#L234-L242
130,005
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/util/StringUtils.java
StringUtils.capitalize
public static String capitalize(String str) { char[] array = str.toCharArray(); if (array.length > 0) { array[0] = Character.toUpperCase(array[0]); } return new String(array); }
java
public static String capitalize(String str) { char[] array = str.toCharArray(); if (array.length > 0) { array[0] = Character.toUpperCase(array[0]); } return new String(array); }
[ "public", "static", "String", "capitalize", "(", "String", "str", ")", "{", "char", "[", "]", "array", "=", "str", ".", "toCharArray", "(", ")", ";", "if", "(", "array", ".", "length", ">", "0", ")", "{", "array", "[", "0", "]", "=", "Character", ...
Capitalizes the first character of the provided string. @param str The string to capitalize @return The capitalized string
[ "Capitalizes", "the", "first", "character", "of", "the", "provided", "string", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StringUtils.java#L272-L278
130,006
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/exceptions/MessageUtils.java
MessageUtils.buildMessage
static String buildMessage(BeanResolutionContext resolutionContext, Argument argument, String message, boolean circular) { StringBuilder builder = new StringBuilder("Failed to inject value for parameter ["); String ls = System.getProperty("line.separator"); BeanResolutionContext.Path path = reso...
java
static String buildMessage(BeanResolutionContext resolutionContext, Argument argument, String message, boolean circular) { StringBuilder builder = new StringBuilder("Failed to inject value for parameter ["); String ls = System.getProperty("line.separator"); BeanResolutionContext.Path path = reso...
[ "static", "String", "buildMessage", "(", "BeanResolutionContext", "resolutionContext", ",", "Argument", "argument", ",", "String", "message", ",", "boolean", "circular", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", "\"Failed to inject value fo...
Builds an appropriate error message for a constructor argument. @param resolutionContext The resolution context @param argument The argument @param message The message @param circular Is the path circular @return The message
[ "Builds", "an", "appropriate", "error", "message", "for", "a", "constructor", "argument", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/exceptions/MessageUtils.java#L129-L143
130,007
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/annotation/AnnotationMetadataSupport.java
AnnotationMetadataSupport.registerAnnotationType
@SuppressWarnings("unchecked") static void registerAnnotationType(AnnotationClassValue<?> annotationClassValue) { final String name = annotationClassValue.getName(); if (!ANNOTATION_TYPES.containsKey(name)) { annotationClassValue.getType().ifPresent((Consumer<Class<?>>) aClass -> { ...
java
@SuppressWarnings("unchecked") static void registerAnnotationType(AnnotationClassValue<?> annotationClassValue) { final String name = annotationClassValue.getName(); if (!ANNOTATION_TYPES.containsKey(name)) { annotationClassValue.getType().ifPresent((Consumer<Class<?>>) aClass -> { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "static", "void", "registerAnnotationType", "(", "AnnotationClassValue", "<", "?", ">", "annotationClassValue", ")", "{", "final", "String", "name", "=", "annotationClassValue", ".", "getName", "(", ")", ";", "if...
Registers a annotation type. @param annotationClassValue the annotation class value
[ "Registers", "a", "annotation", "type", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AnnotationMetadataSupport.java#L191-L201
130,008
micronaut-projects/micronaut-core
http-server-netty/src/main/java/io/micronaut/http/server/netty/websocket/NettyServerWebSocketUpgradeHandler.java
NettyServerWebSocketUpgradeHandler.handleHandshake
protected ChannelFuture handleHandshake(ChannelHandlerContext ctx, NettyHttpRequest req, WebSocketBean<?> webSocketBean, MutableHttpResponse<?> response) { int maxFramePayloadLength = webSocketBean.messageMethod().flatMap(m -> m.getValue(OnMessage.class, "maxPayloadLength", Integer.class)).orElse(65536); ...
java
protected ChannelFuture handleHandshake(ChannelHandlerContext ctx, NettyHttpRequest req, WebSocketBean<?> webSocketBean, MutableHttpResponse<?> response) { int maxFramePayloadLength = webSocketBean.messageMethod().flatMap(m -> m.getValue(OnMessage.class, "maxPayloadLength", Integer.class)).orElse(65536); ...
[ "protected", "ChannelFuture", "handleHandshake", "(", "ChannelHandlerContext", "ctx", ",", "NettyHttpRequest", "req", ",", "WebSocketBean", "<", "?", ">", "webSocketBean", ",", "MutableHttpResponse", "<", "?", ">", "response", ")", "{", "int", "maxFramePayloadLength",...
Do the handshaking for WebSocket request. @param ctx The channel handler context @param req The request @param webSocketBean The web socket bean @param response The response @return The channel future
[ "Do", "the", "handshaking", "for", "WebSocket", "request", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/websocket/NettyServerWebSocketUpgradeHandler.java#L225-L256
130,009
micronaut-projects/micronaut-core
http-server-netty/src/main/java/io/micronaut/http/server/netty/websocket/NettyServerWebSocketUpgradeHandler.java
NettyServerWebSocketUpgradeHandler.getWebSocketURL
protected String getWebSocketURL(ChannelHandlerContext ctx, HttpRequest req) { boolean isSecure = ctx.pipeline().get(SslHandler.class) != null; return (isSecure ? SCHEME_SECURE_WEBSOCKET : SCHEME_WEBSOCKET) + req.getHeaders().get(HttpHeaderNames.HOST) + req.getUri() ; }
java
protected String getWebSocketURL(ChannelHandlerContext ctx, HttpRequest req) { boolean isSecure = ctx.pipeline().get(SslHandler.class) != null; return (isSecure ? SCHEME_SECURE_WEBSOCKET : SCHEME_WEBSOCKET) + req.getHeaders().get(HttpHeaderNames.HOST) + req.getUri() ; }
[ "protected", "String", "getWebSocketURL", "(", "ChannelHandlerContext", "ctx", ",", "HttpRequest", "req", ")", "{", "boolean", "isSecure", "=", "ctx", ".", "pipeline", "(", ")", ".", "get", "(", "SslHandler", ".", "class", ")", "!=", "null", ";", "return", ...
Obtains the web socket URL. @param ctx The context @param req The request @return The socket URL
[ "Obtains", "the", "web", "socket", "URL", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/websocket/NettyServerWebSocketUpgradeHandler.java#L266-L269
130,010
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/ResourceUtils.java
ResourceUtils.getClassName
public static String getClassName(Resource resource) { try { return getClassName(resource.getFile().getAbsolutePath()); } catch (IOException e) { return null; } }
java
public static String getClassName(Resource resource) { try { return getClassName(resource.getFile().getAbsolutePath()); } catch (IOException e) { return null; } }
[ "public", "static", "String", "getClassName", "(", "Resource", "resource", ")", "{", "try", "{", "return", "getClassName", "(", "resource", ".", "getFile", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", ...
Gets the class name of the specified Micronaut resource. @param resource The Spring Resource @return The class name or null if the resource is not a Micronaut class
[ "Gets", "the", "class", "name", "of", "the", "specified", "Micronaut", "resource", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/ResourceUtils.java#L173-L179
130,011
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/ResourceUtils.java
ResourceUtils.getClassName
public static String getClassName(String path) { for (Pattern pattern : patterns) { Matcher m = pattern.matcher(path); if (m.find()) { return m.group(1).replaceAll("[/\\\\]", "."); } } return null; }
java
public static String getClassName(String path) { for (Pattern pattern : patterns) { Matcher m = pattern.matcher(path); if (m.find()) { return m.group(1).replaceAll("[/\\\\]", "."); } } return null; }
[ "public", "static", "String", "getClassName", "(", "String", "path", ")", "{", "for", "(", "Pattern", "pattern", ":", "patterns", ")", "{", "Matcher", "m", "=", "pattern", ".", "matcher", "(", "path", ")", ";", "if", "(", "m", ".", "find", "(", ")", ...
Returns the class name for a resource. @param path The path to check @return The class name or null if it doesn't exist
[ "Returns", "the", "class", "name", "for", "a", "resource", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/ResourceUtils.java#L187-L195
130,012
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/ResourceUtils.java
ResourceUtils.isFileURL
public static boolean isFileURL(URL url) { String protocol = url.getProtocol(); return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS)); }
java
public static boolean isFileURL(URL url) { String protocol = url.getProtocol(); return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS)); }
[ "public", "static", "boolean", "isFileURL", "(", "URL", "url", ")", "{", "String", "protocol", "=", "url", ".", "getProtocol", "(", ")", ";", "return", "(", "URL_PROTOCOL_FILE", ".", "equals", "(", "protocol", ")", "||", "protocol", ".", "startsWith", "(",...
Determine whether the given URL points to a resource in the file system, that is, has protocol "file" or "vfs". @param url the URL to check @return whether the URL has been identified as a file system URL
[ "Determine", "whether", "the", "given", "URL", "points", "to", "a", "resource", "in", "the", "file", "system", "that", "is", "has", "protocol", "file", "or", "vfs", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/ResourceUtils.java#L282-L285
130,013
micronaut-projects/micronaut-core
spring/src/main/java/io/micronaut/spring/core/env/PropertyResolverAdapter.java
PropertyResolverAdapter.getPropertyAsClass
@Deprecated public <T> Class<T> getPropertyAsClass(String key, Class<T> targetType) { Optional<String> property = propertyResolver.getProperty(NameUtils.hyphenate(key), String.class); if (property.isPresent()) { Optional<Class> aClass = ClassUtils.forName(property.get(), Thread.currentTh...
java
@Deprecated public <T> Class<T> getPropertyAsClass(String key, Class<T> targetType) { Optional<String> property = propertyResolver.getProperty(NameUtils.hyphenate(key), String.class); if (property.isPresent()) { Optional<Class> aClass = ClassUtils.forName(property.get(), Thread.currentTh...
[ "@", "Deprecated", "public", "<", "T", ">", "Class", "<", "T", ">", "getPropertyAsClass", "(", "String", "key", ",", "Class", "<", "T", ">", "targetType", ")", "{", "Optional", "<", "String", ">", "property", "=", "propertyResolver", ".", "getProperty", ...
Return the property value converted to a class loaded by the current thread context class loader. @param key The property key @param targetType The class @param <T> The class type @return The class value
[ "Return", "the", "property", "value", "converted", "to", "a", "class", "loaded", "by", "the", "current", "thread", "context", "class", "loader", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/spring/src/main/java/io/micronaut/spring/core/env/PropertyResolverAdapter.java#L88-L99
130,014
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/DefaultBeanContext.java
DefaultBeanContext.start
@Override public synchronized BeanContext start() { if (!isRunning()) { if (initializing.compareAndSet(false, true)) { if (LOG.isDebugEnabled()) { LOG.debug("Starting BeanContext"); } readAllBeanConfigurations(); ...
java
@Override public synchronized BeanContext start() { if (!isRunning()) { if (initializing.compareAndSet(false, true)) { if (LOG.isDebugEnabled()) { LOG.debug("Starting BeanContext"); } readAllBeanConfigurations(); ...
[ "@", "Override", "public", "synchronized", "BeanContext", "start", "(", ")", "{", "if", "(", "!", "isRunning", "(", ")", ")", "{", "if", "(", "initializing", ".", "compareAndSet", "(", "false", ",", "true", ")", ")", "{", "if", "(", "LOG", ".", "isDe...
The start method will read all bean definition classes found on the classpath and initialize any pre-required state.
[ "The", "start", "method", "will", "read", "all", "bean", "definition", "classes", "found", "on", "the", "classpath", "and", "initialize", "any", "pre", "-", "required", "state", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L190-L222
130,015
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/DefaultBeanContext.java
DefaultBeanContext.streamOfType
protected <T> Stream<T> streamOfType(BeanResolutionContext resolutionContext, Class<T> beanType, Qualifier<T> qualifier) { return getBeansOfTypeInternal(resolutionContext, beanType, qualifier).stream(); }
java
protected <T> Stream<T> streamOfType(BeanResolutionContext resolutionContext, Class<T> beanType, Qualifier<T> qualifier) { return getBeansOfTypeInternal(resolutionContext, beanType, qualifier).stream(); }
[ "protected", "<", "T", ">", "Stream", "<", "T", ">", "streamOfType", "(", "BeanResolutionContext", "resolutionContext", ",", "Class", "<", "T", ">", "beanType", ",", "Qualifier", "<", "T", ">", "qualifier", ")", "{", "return", "getBeansOfTypeInternal", "(", ...
Obtains a stream of beans of the given type and qualifier. @param resolutionContext The bean resolution context @param beanType The bean type @param qualifier The qualifier @param <T> The bean concrete type @return A stream
[ "Obtains", "a", "stream", "of", "beans", "of", "the", "given", "type", "and", "qualifier", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L614-L616
130,016
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/DefaultBeanContext.java
DefaultBeanContext.processParallelBeans
protected void processParallelBeans() { new Thread(() -> { final List<BeanDefinitionReference> parallelBeans = beanDefinitionsClasses.stream() .filter(bd -> bd.getAnnotationMetadata().hasDeclaredStereotype(Parallel.class) && bd.isEnabled(this)) .collect(Collec...
java
protected void processParallelBeans() { new Thread(() -> { final List<BeanDefinitionReference> parallelBeans = beanDefinitionsClasses.stream() .filter(bd -> bd.getAnnotationMetadata().hasDeclaredStereotype(Parallel.class) && bd.isEnabled(this)) .collect(Collec...
[ "protected", "void", "processParallelBeans", "(", ")", "{", "new", "Thread", "(", "(", ")", "->", "{", "final", "List", "<", "BeanDefinitionReference", ">", "parallelBeans", "=", "beanDefinitionsClasses", ".", "stream", "(", ")", ".", "filter", "(", "bd", "-...
Processes parallel bean definitions.
[ "Processes", "parallel", "bean", "definitions", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L1603-L1648
130,017
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/DefaultBeanContext.java
DefaultBeanContext.findConcreteCandidate
@SuppressWarnings("unchecked") private <T> Optional<BeanDefinition<T>> findConcreteCandidate( Class<T> beanType, Qualifier<T> qualifier, boolean throwNonUnique, boolean includeProvided) { return (Optional) beanConcreteCandidateCache.computeIfAbsent(new BeanKey...
java
@SuppressWarnings("unchecked") private <T> Optional<BeanDefinition<T>> findConcreteCandidate( Class<T> beanType, Qualifier<T> qualifier, boolean throwNonUnique, boolean includeProvided) { return (Optional) beanConcreteCandidateCache.computeIfAbsent(new BeanKey...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "T", ">", "Optional", "<", "BeanDefinition", "<", "T", ">", ">", "findConcreteCandidate", "(", "Class", "<", "T", ">", "beanType", ",", "Qualifier", "<", "T", ">", "qualifier", ",", "boole...
Find a concrete candidate for the given qualifier. @param beanType The bean type @param qualifier The qualifier @param throwNonUnique Whether to throw an exception if the bean is not found @param includeProvided Whether to include provided resolution @param <T> The bean generic type @return T...
[ "Find", "a", "concrete", "candidate", "for", "the", "given", "qualifier", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L2043-L2052
130,018
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/io/scan/ClassPathAnnotationScanner.java
ClassPathAnnotationScanner.scan
@Override public Stream<Class> scan(String annotation, String pkg) { if (pkg == null) { return Stream.empty(); } List<Class> classes = doScan(annotation, pkg); return classes.stream(); }
java
@Override public Stream<Class> scan(String annotation, String pkg) { if (pkg == null) { return Stream.empty(); } List<Class> classes = doScan(annotation, pkg); return classes.stream(); }
[ "@", "Override", "public", "Stream", "<", "Class", ">", "scan", "(", "String", "annotation", ",", "String", "pkg", ")", "{", "if", "(", "pkg", "==", "null", ")", "{", "return", "Stream", ".", "empty", "(", ")", ";", "}", "List", "<", "Class", ">", ...
Scan the given packages. @param annotation The annotation to scan for @param pkg The package to scan @return A stream of classes
[ "Scan", "the", "given", "packages", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/scan/ClassPathAnnotationScanner.java#L90-L97
130,019
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/scheduling/io/watch/DefaultWatchThread.java
DefaultWatchThread.closeWatchService
protected void closeWatchService() { try { getWatchService().close(); } catch (IOException e) { if (LOG.isErrorEnabled()) { LOG.error("Error stopping file watch service: " + e.getMessage(), e); } } }
java
protected void closeWatchService() { try { getWatchService().close(); } catch (IOException e) { if (LOG.isErrorEnabled()) { LOG.error("Error stopping file watch service: " + e.getMessage(), e); } } }
[ "protected", "void", "closeWatchService", "(", ")", "{", "try", "{", "getWatchService", "(", ")", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "if", "(", "LOG", ".", "isErrorEnabled", "(", ")", ")", "{", "LOG", ".", ...
Closes the watch service.
[ "Closes", "the", "watch", "service", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/scheduling/io/watch/DefaultWatchThread.java#L157-L165
130,020
micronaut-projects/micronaut-core
router/src/main/java/io/micronaut/web/router/DefaultRouteBuilder.java
DefaultRouteBuilder.buildRoute
protected UriRoute buildRoute(HttpMethod httpMethod, String uri, Class<?> type, String method, Class... parameterTypes) { Optional<? extends MethodExecutionHandle<?, Object>> executionHandle = executionHandleLocator.findExecutionHandle(type, method, parameterTypes); MethodExecutionHandle<?, Object> exe...
java
protected UriRoute buildRoute(HttpMethod httpMethod, String uri, Class<?> type, String method, Class... parameterTypes) { Optional<? extends MethodExecutionHandle<?, Object>> executionHandle = executionHandleLocator.findExecutionHandle(type, method, parameterTypes); MethodExecutionHandle<?, Object> exe...
[ "protected", "UriRoute", "buildRoute", "(", "HttpMethod", "httpMethod", ",", "String", "uri", ",", "Class", "<", "?", ">", "type", ",", "String", "method", ",", "Class", "...", "parameterTypes", ")", "{", "Optional", "<", "?", "extends", "MethodExecutionHandle...
Build a route. @param httpMethod The HTTP method @param uri The URI @param type The type @param method The method @param parameterTypes Parameters @return an {@link UriRoute}
[ "Build", "a", "route", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/router/src/main/java/io/micronaut/web/router/DefaultRouteBuilder.java#L376-L384
130,021
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/order/OrderUtil.java
OrderUtil.sort
public static <T> Stream<T> sort(Stream<T> list) { return list.sorted(COMPARATOR); }
java
public static <T> Stream<T> sort(Stream<T> list) { return list.sorted(COMPARATOR); }
[ "public", "static", "<", "T", ">", "Stream", "<", "T", ">", "sort", "(", "Stream", "<", "T", ">", "list", ")", "{", "return", "list", ".", "sorted", "(", "COMPARATOR", ")", ";", "}" ]
Sort the given list. @param list The list to sort @param <T> The stream generic type @return The sorted stream
[ "Sort", "the", "given", "list", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/order/OrderUtil.java#L62-L64
130,022
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/env/DefaultPropertyPlaceholderResolver.java
DefaultPropertyPlaceholderResolver.buildSegments
public List<Segment> buildSegments(String str) { List<Segment> segments = new ArrayList<>(); String value = str; int i = value.indexOf(PREFIX); while (i > -1) { //the text before the prefix if (i > 0) { String rawSegment = value.substring(0, i); ...
java
public List<Segment> buildSegments(String str) { List<Segment> segments = new ArrayList<>(); String value = str; int i = value.indexOf(PREFIX); while (i > -1) { //the text before the prefix if (i > 0) { String rawSegment = value.substring(0, i); ...
[ "public", "List", "<", "Segment", ">", "buildSegments", "(", "String", "str", ")", "{", "List", "<", "Segment", ">", "segments", "=", "new", "ArrayList", "<>", "(", ")", ";", "String", "value", "=", "str", ";", "int", "i", "=", "value", ".", "indexOf...
Split a placeholder value into logic segments. @param str The placeholder @return The list of segments
[ "Split", "a", "placeholder", "value", "into", "logic", "segments", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/env/DefaultPropertyPlaceholderResolver.java#L116-L144
130,023
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/env/DefaultPropertyPlaceholderResolver.java
DefaultPropertyPlaceholderResolver.resolveReplacement
@Deprecated protected boolean resolveReplacement(StringBuilder builder, String str, String expr) { if (environment.containsProperty(expr)) { builder.append(environment.getProperty(expr, String.class).orElseThrow(() -> new ConfigurationException("Could not resolve placeholder ${" + expr + "} in v...
java
@Deprecated protected boolean resolveReplacement(StringBuilder builder, String str, String expr) { if (environment.containsProperty(expr)) { builder.append(environment.getProperty(expr, String.class).orElseThrow(() -> new ConfigurationException("Could not resolve placeholder ${" + expr + "} in v...
[ "@", "Deprecated", "protected", "boolean", "resolveReplacement", "(", "StringBuilder", "builder", ",", "String", "str", ",", "String", "expr", ")", "{", "if", "(", "environment", ".", "containsProperty", "(", "expr", ")", ")", "{", "builder", ".", "append", ...
Resolves a replacement for the given expression. Returning true if the replacement was resolved. @deprecated No longer used internally. See {@link #resolveExpression(String, String, Class)} @param builder The builder @param str The full string @param expr The current expression @return True if a placeholder was resolv...
[ "Resolves", "a", "replacement", "for", "the", "given", "expression", ".", "Returning", "true", "if", "the", "replacement", "was", "resolved", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/env/DefaultPropertyPlaceholderResolver.java#L155-L162
130,024
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/env/DefaultPropertyPlaceholderResolver.java
DefaultPropertyPlaceholderResolver.resolveExpression
@Nullable protected <T> T resolveExpression(String context, String expression, Class<T> type) { if (environment.containsProperty(expression)) { return environment.getProperty(expression, type) .orElseThrow(() -> new ConfigurationException("Could no...
java
@Nullable protected <T> T resolveExpression(String context, String expression, Class<T> type) { if (environment.containsProperty(expression)) { return environment.getProperty(expression, type) .orElseThrow(() -> new ConfigurationException("Could no...
[ "@", "Nullable", "protected", "<", "T", ">", "T", "resolveExpression", "(", "String", "context", ",", "String", "expression", ",", "Class", "<", "T", ">", "type", ")", "{", "if", "(", "environment", ".", "containsProperty", "(", "expression", ")", ")", "...
Resolves a single expression. @param context The context of the expression @param expression The expression @param type The class @param <T> The type the expression should be converted to @return The resolved and converted expression
[ "Resolves", "a", "single", "expression", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/env/DefaultPropertyPlaceholderResolver.java#L173-L189
130,025
micronaut-projects/micronaut-core
http/src/main/java/io/micronaut/http/bind/DefaultRequestBinderRegistry.java
DefaultRequestBinderRegistry.registerDefaultConverters
protected void registerDefaultConverters(ConversionService<?> conversionService) { conversionService.addConverter( CharSequence.class, MediaType.class, (object, targetType, context) -> { if (StringUtils.isEmpty(object)) { return Optional.empty(...
java
protected void registerDefaultConverters(ConversionService<?> conversionService) { conversionService.addConverter( CharSequence.class, MediaType.class, (object, targetType, context) -> { if (StringUtils.isEmpty(object)) { return Optional.empty(...
[ "protected", "void", "registerDefaultConverters", "(", "ConversionService", "<", "?", ">", "conversionService", ")", "{", "conversionService", ".", "addConverter", "(", "CharSequence", ".", "class", ",", "MediaType", ".", "class", ",", "(", "object", ",", "targetT...
Registers a default converter. @param conversionService The conversion service
[ "Registers", "a", "default", "converter", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/bind/DefaultRequestBinderRegistry.java#L186-L203
130,026
micronaut-projects/micronaut-core
management/src/main/java/io/micronaut/management/health/monitor/HealthMonitorTask.java
HealthMonitorTask.monitor
@Scheduled( fixedDelay = "${micronaut.health.monitor.interval:1m}", initialDelay = "${micronaut.health.monitor.initial-delay:1m}") void monitor() { if (LOG.isDebugEnabled()) { LOG.debug("Starting health monitor check"); } List<Publisher<HealthResult>> healthResult...
java
@Scheduled( fixedDelay = "${micronaut.health.monitor.interval:1m}", initialDelay = "${micronaut.health.monitor.initial-delay:1m}") void monitor() { if (LOG.isDebugEnabled()) { LOG.debug("Starting health monitor check"); } List<Publisher<HealthResult>> healthResult...
[ "@", "Scheduled", "(", "fixedDelay", "=", "\"${micronaut.health.monitor.interval:1m}\"", ",", "initialDelay", "=", "\"${micronaut.health.monitor.initial-delay:1m}\"", ")", "void", "monitor", "(", ")", "{", "if", "(", "LOG", ".", "isDebugEnabled", "(", ")", ")", "{", ...
Start the continuous health monitor.
[ "Start", "the", "continuous", "health", "monitor", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/management/src/main/java/io/micronaut/management/health/monitor/HealthMonitorTask.java#L78-L131
130,027
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/util/CollectionUtils.java
CollectionUtils.setOf
public static <T> Set<T> setOf(T... objects) { if (objects == null || objects.length == 0) { return Collections.emptySet(); } return new HashSet<>(Arrays.asList(objects)); }
java
public static <T> Set<T> setOf(T... objects) { if (objects == null || objects.length == 0) { return Collections.emptySet(); } return new HashSet<>(Arrays.asList(objects)); }
[ "public", "static", "<", "T", ">", "Set", "<", "T", ">", "setOf", "(", "T", "...", "objects", ")", "{", "if", "(", "objects", "==", "null", "||", "objects", ".", "length", "==", "0", ")", "{", "return", "Collections", ".", "emptySet", "(", ")", "...
Creates a set of the given objects. @param objects The objects @param <T> The type @return The set
[ "Creates", "a", "set", "of", "the", "given", "objects", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/CollectionUtils.java#L190-L195
130,028
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/cli/CommandLineParser.java
CommandLineParser.addOption
@Override public CommandLineParser addOption(String name, String description) { int length = name.length(); if (length > longestOptionNameLength) { longestOptionNameLength = length; } declaredOptions.put(name, new Option(name, description)); return this; }
java
@Override public CommandLineParser addOption(String name, String description) { int length = name.length(); if (length > longestOptionNameLength) { longestOptionNameLength = length; } declaredOptions.put(name, new Option(name, description)); return this; }
[ "@", "Override", "public", "CommandLineParser", "addOption", "(", "String", "name", ",", "String", "description", ")", "{", "int", "length", "=", "name", ".", "length", "(", ")", ";", "if", "(", "length", ">", "longestOptionNameLength", ")", "{", "longestOpt...
Adds a declared option. @param name The name of the option @param description The description
[ "Adds", "a", "declared", "option", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/cli/CommandLineParser.java#L52-L60
130,029
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/cli/CommandLineParser.java
CommandLineParser.parse
CommandLine parse(DefaultCommandLine cl, String[] args) { parseInternal(cl, args, true); return cl; }
java
CommandLine parse(DefaultCommandLine cl, String[] args) { parseInternal(cl, args, true); return cl; }
[ "CommandLine", "parse", "(", "DefaultCommandLine", "cl", ",", "String", "[", "]", "args", ")", "{", "parseInternal", "(", "cl", ",", "args", ",", "true", ")", ";", "return", "cl", ";", "}" ]
Parse the command line entry. @param cl commandLine @param args args passed in @return commandLine
[ "Parse", "the", "command", "line", "entry", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/cli/CommandLineParser.java#L81-L84
130,030
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/cli/CommandLineParser.java
CommandLineParser.getOptionsHelpMessage
public String getOptionsHelpMessage() { String ls = System.getProperty("line.separator"); usageMessage = "Available options:"; StringBuilder sb = new StringBuilder(usageMessage); sb.append(ls); for (Option option : declaredOptions.values()) { String name = option.getN...
java
public String getOptionsHelpMessage() { String ls = System.getProperty("line.separator"); usageMessage = "Available options:"; StringBuilder sb = new StringBuilder(usageMessage); sb.append(ls); for (Option option : declaredOptions.values()) { String name = option.getN...
[ "public", "String", "getOptionsHelpMessage", "(", ")", "{", "String", "ls", "=", "System", ".", "getProperty", "(", "\"line.separator\"", ")", ";", "usageMessage", "=", "\"Available options:\"", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "usageM...
Build the options message. @return message
[ "Build", "the", "options", "message", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/cli/CommandLineParser.java#L90-L106
130,031
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/cli/CommandLineParser.java
CommandLineParser.processOption
protected String processOption(DefaultCommandLine cl, String arg) { if (arg.length() < 2) { return null; } if (arg.charAt(1) == 'D' && arg.contains("=")) { processSystemArg(cl, arg); return null; } arg = (arg.charAt(1) == '-' ? arg.substring(...
java
protected String processOption(DefaultCommandLine cl, String arg) { if (arg.length() < 2) { return null; } if (arg.charAt(1) == 'D' && arg.contains("=")) { processSystemArg(cl, arg); return null; } arg = (arg.charAt(1) == '-' ? arg.substring(...
[ "protected", "String", "processOption", "(", "DefaultCommandLine", "cl", ",", "String", "arg", ")", "{", "if", "(", "arg", ".", "length", "(", ")", "<", "2", ")", "{", "return", "null", ";", "}", "if", "(", "arg", ".", "charAt", "(", "1", ")", "=="...
Process the passed in options. @param cl cl @param arg arg @return argument processed
[ "Process", "the", "passed", "in", "options", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/cli/CommandLineParser.java#L153-L185
130,032
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/cli/CommandLineParser.java
CommandLineParser.processSystemArg
protected void processSystemArg(DefaultCommandLine cl, String arg) { int i = arg.indexOf("="); String name = arg.substring(2, i); String value = arg.substring(i + 1, arg.length()); cl.addSystemProperty(name, value); }
java
protected void processSystemArg(DefaultCommandLine cl, String arg) { int i = arg.indexOf("="); String name = arg.substring(2, i); String value = arg.substring(i + 1, arg.length()); cl.addSystemProperty(name, value); }
[ "protected", "void", "processSystemArg", "(", "DefaultCommandLine", "cl", ",", "String", "arg", ")", "{", "int", "i", "=", "arg", ".", "indexOf", "(", "\"=\"", ")", ";", "String", "name", "=", "arg", ".", "substring", "(", "2", ",", "i", ")", ";", "S...
Process System property arg. @param cl cl @param arg system arg
[ "Process", "System", "property", "arg", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/cli/CommandLineParser.java#L192-L197
130,033
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java
DefaultAnnotationMetadata.addAnnotation
@SuppressWarnings("WeakerAccess") protected final void addAnnotation(String annotation, Map<CharSequence, Object> values) { if (annotation != null) { String repeatedName = getRepeatedName(annotation); Object v = values.get(AnnotationMetadata.VALUE_MEMBER); if (v instanceo...
java
@SuppressWarnings("WeakerAccess") protected final void addAnnotation(String annotation, Map<CharSequence, Object> values) { if (annotation != null) { String repeatedName = getRepeatedName(annotation); Object v = values.get(AnnotationMetadata.VALUE_MEMBER); if (v instanceo...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "protected", "final", "void", "addAnnotation", "(", "String", "annotation", ",", "Map", "<", "CharSequence", ",", "Object", ">", "values", ")", "{", "if", "(", "annotation", "!=", "null", ")", "{", "Stri...
Adds an annotation and its member values, if the annotation already exists the data will be merged with existing values replaced. @param annotation The annotation @param values The values
[ "Adds", "an", "annotation", "and", "its", "member", "values", "if", "the", "annotation", "already", "exists", "the", "data", "will", "be", "merged", "with", "existing", "values", "replaced", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L448-L470
130,034
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java
DefaultAnnotationMetadata.registerAnnotationDefaults
@SuppressWarnings("unused") @Internal @UsedByGeneratedCode protected static void registerAnnotationDefaults(String annotation, Map<String, Object> defaultValues) { AnnotationMetadataSupport.registerDefaultValues(annotation, defaultValues); }
java
@SuppressWarnings("unused") @Internal @UsedByGeneratedCode protected static void registerAnnotationDefaults(String annotation, Map<String, Object> defaultValues) { AnnotationMetadataSupport.registerDefaultValues(annotation, defaultValues); }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "@", "Internal", "@", "UsedByGeneratedCode", "protected", "static", "void", "registerAnnotationDefaults", "(", "String", "annotation", ",", "Map", "<", "String", ",", "Object", ">", "defaultValues", ")", "{", "Annot...
Registers annotation default values. Used by generated byte code. DO NOT REMOVE. @param annotation The annotation name @param defaultValues The default values
[ "Registers", "annotation", "default", "values", ".", "Used", "by", "generated", "byte", "code", ".", "DO", "NOT", "REMOVE", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L510-L515
130,035
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java
DefaultAnnotationMetadata.addRepeatable
protected final void addRepeatable(String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue) { if (StringUtils.isNotEmpty(annotationName) && annotationValue != null) { Map<String, Map<CharSequence, Object>> allAnnotations = getAllAnnotations(); addRepeatableIn...
java
protected final void addRepeatable(String annotationName, io.micronaut.core.annotation.AnnotationValue annotationValue) { if (StringUtils.isNotEmpty(annotationName) && annotationValue != null) { Map<String, Map<CharSequence, Object>> allAnnotations = getAllAnnotations(); addRepeatableIn...
[ "protected", "final", "void", "addRepeatable", "(", "String", "annotationName", ",", "io", ".", "micronaut", ".", "core", ".", "annotation", ".", "AnnotationValue", "annotationValue", ")", "{", "if", "(", "StringUtils", ".", "isNotEmpty", "(", "annotationName", ...
Adds a repeatable annotation value. If a value already exists will be added @param annotationName The annotation name @param annotationValue The annotation value
[ "Adds", "a", "repeatable", "annotation", "value", ".", "If", "a", "value", "already", "exists", "will", "be", "added" ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L550-L556
130,036
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java
DefaultAnnotationMetadata.addRepeatableStereotype
protected void addRepeatableStereotype(List<String> parents, String stereotype, io.micronaut.core.annotation.AnnotationValue annotationValue) { Map<String, Map<CharSequence, Object>> allStereotypes = getAllStereotypes(); List<String> annotationList = getAnnotationsByStereotypeInternal(stereotype); ...
java
protected void addRepeatableStereotype(List<String> parents, String stereotype, io.micronaut.core.annotation.AnnotationValue annotationValue) { Map<String, Map<CharSequence, Object>> allStereotypes = getAllStereotypes(); List<String> annotationList = getAnnotationsByStereotypeInternal(stereotype); ...
[ "protected", "void", "addRepeatableStereotype", "(", "List", "<", "String", ">", "parents", ",", "String", "stereotype", ",", "io", ".", "micronaut", ".", "core", ".", "annotation", ".", "AnnotationValue", "annotationValue", ")", "{", "Map", "<", "String", ","...
Adds a repeatable stereotype value. If a value already exists will be added @param parents The parent annotations @param stereotype The annotation name @param annotationValue The annotation value
[ "Adds", "a", "repeatable", "stereotype", "value", ".", "If", "a", "value", "already", "exists", "will", "be", "added" ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L565-L575
130,037
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java
DefaultAnnotationMetadata.addDeclaredStereotype
@SuppressWarnings("WeakerAccess") protected final void addDeclaredStereotype(List<String> parentAnnotations, String stereotype, Map<CharSequence, Object> values) { if (stereotype != null) { String repeatedName = getRepeatedName(stereotype); if (repeatedName != null) { ...
java
@SuppressWarnings("WeakerAccess") protected final void addDeclaredStereotype(List<String> parentAnnotations, String stereotype, Map<CharSequence, Object> values) { if (stereotype != null) { String repeatedName = getRepeatedName(stereotype); if (repeatedName != null) { ...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "protected", "final", "void", "addDeclaredStereotype", "(", "List", "<", "String", ">", "parentAnnotations", ",", "String", "stereotype", ",", "Map", "<", "CharSequence", ",", "Object", ">", "values", ")", "...
Adds a stereotype and its member values, if the annotation already exists the data will be merged with existing values replaced. @param parentAnnotations The parent annotations @param stereotype The annotation @param values The values
[ "Adds", "a", "stereotype", "and", "its", "member", "values", "if", "the", "annotation", "already", "exists", "the", "data", "will", "be", "merged", "with", "existing", "values", "replaced", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L671-L710
130,038
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java
DefaultAnnotationMetadata.dump
@SuppressWarnings("unused") @Internal void dump() { System.out.println("declaredAnnotations = " + declaredAnnotations); System.out.println("declaredStereotypes = " + declaredStereotypes); System.out.println("allAnnotations = " + allAnnotations); System.out.println("allStereotypes...
java
@SuppressWarnings("unused") @Internal void dump() { System.out.println("declaredAnnotations = " + declaredAnnotations); System.out.println("declaredStereotypes = " + declaredStereotypes); System.out.println("allAnnotations = " + allAnnotations); System.out.println("allStereotypes...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "@", "Internal", "void", "dump", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"declaredAnnotations = \"", "+", "declaredAnnotations", ")", ";", "System", ".", "out", ".", "println", "(", "\"decl...
Dump the values.
[ "Dump", "the", "values", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L748-L756
130,039
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java
DefaultAnnotationMetadata.contributeDefaults
@Internal public static void contributeDefaults(AnnotationMetadata target, AnnotationMetadata source) { if (target instanceof DefaultAnnotationMetadata && source instanceof DefaultAnnotationMetadata) { final Map<String, Map<CharSequence, Object>> existingDefaults = ((DefaultAnnotationMetadata) t...
java
@Internal public static void contributeDefaults(AnnotationMetadata target, AnnotationMetadata source) { if (target instanceof DefaultAnnotationMetadata && source instanceof DefaultAnnotationMetadata) { final Map<String, Map<CharSequence, Object>> existingDefaults = ((DefaultAnnotationMetadata) t...
[ "@", "Internal", "public", "static", "void", "contributeDefaults", "(", "AnnotationMetadata", "target", ",", "AnnotationMetadata", "source", ")", "{", "if", "(", "target", "instanceof", "DefaultAnnotationMetadata", "&&", "source", "instanceof", "DefaultAnnotationMetadata"...
Contributes defaults to the given target. <p>WARNING: for internal use only be the framework</p> @param target The target @param source The source
[ "Contributes", "defaults", "to", "the", "given", "target", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L935-L948
130,040
micronaut-projects/micronaut-core
session/src/main/java/io/micronaut/session/InMemorySessionStore.java
InMemorySessionStore.newSessionCache
protected Cache<String, InMemorySession> newSessionCache(SessionConfiguration configuration) { Caffeine<String, InMemorySession> builder = Caffeine .newBuilder() .removalListener(newRemovalListener()) .expireAfter(newExpiry()); configuration.getMaxActiveSessions().ifP...
java
protected Cache<String, InMemorySession> newSessionCache(SessionConfiguration configuration) { Caffeine<String, InMemorySession> builder = Caffeine .newBuilder() .removalListener(newRemovalListener()) .expireAfter(newExpiry()); configuration.getMaxActiveSessions().ifP...
[ "protected", "Cache", "<", "String", ",", "InMemorySession", ">", "newSessionCache", "(", "SessionConfiguration", "configuration", ")", "{", "Caffeine", "<", "String", ",", "InMemorySession", ">", "builder", "=", "Caffeine", ".", "newBuilder", "(", ")", ".", "re...
Creates a new session cache. @param configuration The session configuration @return The new cache
[ "Creates", "a", "new", "session", "cache", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/session/src/main/java/io/micronaut/session/InMemorySessionStore.java#L121-L128
130,041
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/annotation/AnnotationUtil.java
AnnotationUtil.calculateHashCode
@SuppressWarnings("MagicNumber") public static int calculateHashCode(Map<? extends CharSequence, Object> values) { int hashCode = 0; for (Map.Entry<? extends CharSequence, Object> member : values.entrySet()) { Object value = member.getValue(); int nameHashCode = member.getK...
java
@SuppressWarnings("MagicNumber") public static int calculateHashCode(Map<? extends CharSequence, Object> values) { int hashCode = 0; for (Map.Entry<? extends CharSequence, Object> member : values.entrySet()) { Object value = member.getValue(); int nameHashCode = member.getK...
[ "@", "SuppressWarnings", "(", "\"MagicNumber\"", ")", "public", "static", "int", "calculateHashCode", "(", "Map", "<", "?", "extends", "CharSequence", ",", "Object", ">", "values", ")", "{", "int", "hashCode", "=", "0", ";", "for", "(", "Map", ".", "Entry"...
Calculates the hash code of annotation values. @param values The map to calculate values' hash code @return The hash code
[ "Calculates", "the", "hash", "code", "of", "annotation", "values", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/annotation/AnnotationUtil.java#L149-L177
130,042
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/annotation/AnnotationUtil.java
AnnotationUtil.areEqual
public static boolean areEqual(Object o1, Object o2) { return !o1.getClass().isArray() ? o1.equals(o2) : o1.getClass() == boolean[].class ? Arrays.equals((boolean[]) o1, (boolean[]) o2) : o1.getClass() == byte[].class ? Arrays.equals((byte[]) o1, (byte[]) o2) : ...
java
public static boolean areEqual(Object o1, Object o2) { return !o1.getClass().isArray() ? o1.equals(o2) : o1.getClass() == boolean[].class ? Arrays.equals((boolean[]) o1, (boolean[]) o2) : o1.getClass() == byte[].class ? Arrays.equals((byte[]) o1, (byte[]) o2) : ...
[ "public", "static", "boolean", "areEqual", "(", "Object", "o1", ",", "Object", "o2", ")", "{", "return", "!", "o1", ".", "getClass", "(", ")", ".", "isArray", "(", ")", "?", "o1", ".", "equals", "(", "o2", ")", ":", "o1", ".", "getClass", "(", ")...
Computes whether 2 annotation values are equal. @param o1 One object @param o2 Another object @return Whether both objects are equal
[ "Computes", "whether", "2", "annotation", "values", "are", "equal", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/annotation/AnnotationUtil.java#L186-L216
130,043
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/io/scan/AnnotationClassReader.java
AnnotationClassReader.readAnnotationValues
private int readAnnotationValues(int v, final char[] buf, final boolean named, final AnnotationVisitor av) { int i = readUnsignedShort(v); v += 2; if (named) { for (; i > 0; --i) { v = readAnnotationValue(v + 2, buf, readUTF8(v, bu...
java
private int readAnnotationValues(int v, final char[] buf, final boolean named, final AnnotationVisitor av) { int i = readUnsignedShort(v); v += 2; if (named) { for (; i > 0; --i) { v = readAnnotationValue(v + 2, buf, readUTF8(v, bu...
[ "private", "int", "readAnnotationValues", "(", "int", "v", ",", "final", "char", "[", "]", "buf", ",", "final", "boolean", "named", ",", "final", "AnnotationVisitor", "av", ")", "{", "int", "i", "=", "readUnsignedShort", "(", "v", ")", ";", "v", "+=", ...
Reads the values of an annotation and makes the given visitor visit them. @param v the start offset in {@link #b b} of the values to be read (including the unsigned short that gives the number of values). @param buf buffer to be used to call {@link #readUTF8 readUTF8}, {@link #readClass(int, char[]) readClass} o...
[ "Reads", "the", "values", "of", "an", "annotation", "and", "makes", "the", "given", "visitor", "visit", "them", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/scan/AnnotationClassReader.java#L558-L575
130,044
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/io/scan/AnnotationClassReader.java
AnnotationClassReader.readLabel
protected Label readLabel(int offset, Label[] labels) { // SPRING PATCH: leniently handle offset mismatch if (offset >= labels.length) { return new Label(); } // END OF PATCH if (labels[offset] == null) { labels[offset] = new Label(); } ret...
java
protected Label readLabel(int offset, Label[] labels) { // SPRING PATCH: leniently handle offset mismatch if (offset >= labels.length) { return new Label(); } // END OF PATCH if (labels[offset] == null) { labels[offset] = new Label(); } ret...
[ "protected", "Label", "readLabel", "(", "int", "offset", ",", "Label", "[", "]", "labels", ")", "{", "// SPRING PATCH: leniently handle offset mismatch", "if", "(", "offset", ">=", "labels", ".", "length", ")", "{", "return", "new", "Label", "(", ")", ";", "...
Returns the label corresponding to the given offset. The default implementation of this method creates a label for the given offset if it has not been already created. @param offset a bytecode offset in a method. @param labels the already created labels, indexed by their offset. If a label already exists for offset th...
[ "Returns", "the", "label", "corresponding", "to", "the", "given", "offset", ".", "The", "default", "implementation", "of", "this", "method", "creates", "a", "label", "for", "the", "given", "offset", "if", "it", "has", "not", "been", "already", "created", "."...
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/scan/AnnotationClassReader.java#L746-L756
130,045
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/io/scan/AnnotationClassReader.java
AnnotationClassReader.getAttributes
private int getAttributes() { // skips the header int u = header + 8 + readUnsignedShort(header + 6) * 2; // skips fields and methods for (int i = readUnsignedShort(u); i > 0; --i) { for (int j = readUnsignedShort(u + 8); j > 0; --j) { u += 6 + readInt(u + 12)...
java
private int getAttributes() { // skips the header int u = header + 8 + readUnsignedShort(header + 6) * 2; // skips fields and methods for (int i = readUnsignedShort(u); i > 0; --i) { for (int j = readUnsignedShort(u + 8); j > 0; --j) { u += 6 + readInt(u + 12)...
[ "private", "int", "getAttributes", "(", ")", "{", "// skips the header", "int", "u", "=", "header", "+", "8", "+", "readUnsignedShort", "(", "header", "+", "6", ")", "*", "2", ";", "// skips fields and methods", "for", "(", "int", "i", "=", "readUnsignedShor...
Returns the start index of the attribute_info structure of this class. @return the start index of the attribute_info structure of this class.
[ "Returns", "the", "start", "index", "of", "the", "attribute_info", "structure", "of", "this", "class", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/scan/AnnotationClassReader.java#L763-L782
130,046
micronaut-projects/micronaut-core
multitenancy/src/main/java/io/micronaut/multitenancy/writer/HttpHeaderTenantWriter.java
HttpHeaderTenantWriter.writeTenant
@Override public void writeTenant(MutableHttpRequest<?> request, Serializable tenant) { if (tenant instanceof CharSequence) { request.header(getHeaderName(), (CharSequence) tenant); } }
java
@Override public void writeTenant(MutableHttpRequest<?> request, Serializable tenant) { if (tenant instanceof CharSequence) { request.header(getHeaderName(), (CharSequence) tenant); } }
[ "@", "Override", "public", "void", "writeTenant", "(", "MutableHttpRequest", "<", "?", ">", "request", ",", "Serializable", "tenant", ")", "{", "if", "(", "tenant", "instanceof", "CharSequence", ")", "{", "request", ".", "header", "(", "getHeaderName", "(", ...
Writes the token to the request. @param request The {@link MutableHttpRequest} instance @param tenant Tenant Id
[ "Writes", "the", "token", "to", "the", "request", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/multitenancy/src/main/java/io/micronaut/multitenancy/writer/HttpHeaderTenantWriter.java#L57-L62
130,047
micronaut-projects/micronaut-core
discovery-client/src/main/java/io/micronaut/discovery/client/ClientUtil.java
ClientUtil.calcPropertySourceNames
public static Set<String> calcPropertySourceNames(String prefix, Set<String> activeNames, String separator) { Set<String> propertySourceNames; if (prefix.contains(separator)) { String[] tokens = prefix.split(separator); if (tokens.length == 1) { propertySourceNam...
java
public static Set<String> calcPropertySourceNames(String prefix, Set<String> activeNames, String separator) { Set<String> propertySourceNames; if (prefix.contains(separator)) { String[] tokens = prefix.split(separator); if (tokens.length == 1) { propertySourceNam...
[ "public", "static", "Set", "<", "String", ">", "calcPropertySourceNames", "(", "String", "prefix", ",", "Set", "<", "String", ">", "activeNames", ",", "String", "separator", ")", "{", "Set", "<", "String", ">", "propertySourceNames", ";", "if", "(", "prefix"...
Calculates property source names. This is used across several clients to make naming consistent. @param prefix fullName or prefix to the environment, or application specific configuration @param activeNames active environments which configurations can be created for @param separator The separator string @return Set of ...
[ "Calculates", "property", "source", "names", ".", "This", "is", "used", "across", "several", "clients", "to", "make", "naming", "consistent", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/client/ClientUtil.java#L34-L57
130,048
micronaut-projects/micronaut-core
multitenancy/src/main/java/io/micronaut/multitenancy/writer/CookieTenantWriter.java
CookieTenantWriter.writeTenant
@Override public void writeTenant(MutableHttpRequest<?> request, Serializable tenant) { if (tenant instanceof String) { Cookie cookie = Cookie.of( cookieTenantWriterConfiguration.getCookiename(), (String) tenant ); cookie.configure...
java
@Override public void writeTenant(MutableHttpRequest<?> request, Serializable tenant) { if (tenant instanceof String) { Cookie cookie = Cookie.of( cookieTenantWriterConfiguration.getCookiename(), (String) tenant ); cookie.configure...
[ "@", "Override", "public", "void", "writeTenant", "(", "MutableHttpRequest", "<", "?", ">", "request", ",", "Serializable", "tenant", ")", "{", "if", "(", "tenant", "instanceof", "String", ")", "{", "Cookie", "cookie", "=", "Cookie", ".", "of", "(", "cooki...
Writes the Tenant Id in a cookie of the request. @param request The {@link MutableHttpRequest} instance @param tenant Tenant Id
[ "Writes", "the", "Tenant", "Id", "in", "a", "cookie", "of", "the", "request", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/multitenancy/src/main/java/io/micronaut/multitenancy/writer/CookieTenantWriter.java#L50-L66
130,049
micronaut-projects/micronaut-core
inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java
GenericUtils.interfaceGenericTypesFor
public List<? extends TypeMirror> interfaceGenericTypesFor(TypeElement element, String interfaceName) { for (TypeMirror tm : element.getInterfaces()) { DeclaredType declaredType = (DeclaredType) tm; Element declaredElement = declaredType.asElement(); if (declaredElement insta...
java
public List<? extends TypeMirror> interfaceGenericTypesFor(TypeElement element, String interfaceName) { for (TypeMirror tm : element.getInterfaces()) { DeclaredType declaredType = (DeclaredType) tm; Element declaredElement = declaredType.asElement(); if (declaredElement insta...
[ "public", "List", "<", "?", "extends", "TypeMirror", ">", "interfaceGenericTypesFor", "(", "TypeElement", "element", ",", "String", "interfaceName", ")", "{", "for", "(", "TypeMirror", "tm", ":", "element", ".", "getInterfaces", "(", ")", ")", "{", "DeclaredTy...
Finds the generic types for the given interface for the given class element. @param element The class element @param interfaceName The interface @return The generic types or an empty list
[ "Finds", "the", "generic", "types", "for", "the", "given", "interface", "for", "the", "given", "class", "element", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java#L108-L120
130,050
micronaut-projects/micronaut-core
inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java
GenericUtils.resolveTypeReference
protected Object resolveTypeReference(TypeMirror mirror, Map<String, Object> boundTypes) { TypeKind kind = mirror.getKind(); switch (kind) { case TYPEVAR: TypeVariable tv = (TypeVariable) mirror; String name = tv.toString(); if (boundTypes.cont...
java
protected Object resolveTypeReference(TypeMirror mirror, Map<String, Object> boundTypes) { TypeKind kind = mirror.getKind(); switch (kind) { case TYPEVAR: TypeVariable tv = (TypeVariable) mirror; String name = tv.toString(); if (boundTypes.cont...
[ "protected", "Object", "resolveTypeReference", "(", "TypeMirror", "mirror", ",", "Map", "<", "String", ",", "Object", ">", "boundTypes", ")", "{", "TypeKind", "kind", "=", "mirror", ".", "getKind", "(", ")", ";", "switch", "(", "kind", ")", "{", "case", ...
Resolve a type reference to use for the given type mirror taking into account generic type variables. @param mirror The mirror @param boundTypes The already bound types for any type variable @return A type reference
[ "Resolve", "a", "type", "reference", "to", "use", "for", "the", "given", "type", "mirror", "taking", "into", "account", "generic", "type", "variables", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java#L248-L300
130,051
micronaut-projects/micronaut-core
inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java
GenericUtils.resolveTypeVariable
protected DeclaredType resolveTypeVariable(Element element, TypeVariable typeVariable) { Element enclosing = element.getEnclosingElement(); while (enclosing instanceof Parameterizable) { Parameterizable parameterizable = (Parameterizable) enclosing; String name = typeVariable.to...
java
protected DeclaredType resolveTypeVariable(Element element, TypeVariable typeVariable) { Element enclosing = element.getEnclosingElement(); while (enclosing instanceof Parameterizable) { Parameterizable parameterizable = (Parameterizable) enclosing; String name = typeVariable.to...
[ "protected", "DeclaredType", "resolveTypeVariable", "(", "Element", "element", ",", "TypeVariable", "typeVariable", ")", "{", "Element", "enclosing", "=", "element", ".", "getEnclosingElement", "(", ")", ";", "while", "(", "enclosing", "instanceof", "Parameterizable",...
Resolve the first type argument to a parameterized type. @param element The type element @param typeVariable The type variable @return The declaring type
[ "Resolve", "the", "first", "type", "argument", "to", "a", "parameterized", "type", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java#L309-L329
130,052
micronaut-projects/micronaut-core
inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java
GenericUtils.resolveBoundTypes
protected Map<String, Object> resolveBoundTypes(DeclaredType type) { Map<String, Object> boundTypes = new LinkedHashMap<>(2); TypeElement element = (TypeElement) type.asElement(); List<? extends TypeParameterElement> typeParameters = element.getTypeParameters(); List<? extends TypeMirro...
java
protected Map<String, Object> resolveBoundTypes(DeclaredType type) { Map<String, Object> boundTypes = new LinkedHashMap<>(2); TypeElement element = (TypeElement) type.asElement(); List<? extends TypeParameterElement> typeParameters = element.getTypeParameters(); List<? extends TypeMirro...
[ "protected", "Map", "<", "String", ",", "Object", ">", "resolveBoundTypes", "(", "DeclaredType", "type", ")", "{", "Map", "<", "String", ",", "Object", ">", "boundTypes", "=", "new", "LinkedHashMap", "<>", "(", "2", ")", ";", "TypeElement", "element", "=",...
Resolve bound types for the given declared type. @param type The declaring type @return The type bounds
[ "Resolve", "bound", "types", "for", "the", "given", "declared", "type", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java#L337-L351
130,053
micronaut-projects/micronaut-core
http-server/src/main/java/io/micronaut/http/server/binding/RequestArgumentSatisfier.java
RequestArgumentSatisfier.fulfillArgumentRequirements
public RouteMatch<?> fulfillArgumentRequirements(RouteMatch<?> route, HttpRequest<?> request, boolean satisfyOptionals) { Collection<Argument> requiredArguments = route.getRequiredArguments(); Map<String, Object> argumentValues; if (requiredArguments.isEmpty()) { // no required argu...
java
public RouteMatch<?> fulfillArgumentRequirements(RouteMatch<?> route, HttpRequest<?> request, boolean satisfyOptionals) { Collection<Argument> requiredArguments = route.getRequiredArguments(); Map<String, Object> argumentValues; if (requiredArguments.isEmpty()) { // no required argu...
[ "public", "RouteMatch", "<", "?", ">", "fulfillArgumentRequirements", "(", "RouteMatch", "<", "?", ">", "route", ",", "HttpRequest", "<", "?", ">", "request", ",", "boolean", "satisfyOptionals", ")", "{", "Collection", "<", "Argument", ">", "requiredArguments", ...
Attempt to satisfy the arguments of the given route with the data from the given request. @param route The route @param request The request @param satisfyOptionals Whether to satisfy optionals @return The route
[ "Attempt", "to", "satisfy", "the", "arguments", "of", "the", "given", "route", "with", "the", "data", "from", "the", "given", "request", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server/src/main/java/io/micronaut/http/server/binding/RequestArgumentSatisfier.java#L74-L92
130,054
micronaut-projects/micronaut-core
validation/src/main/java/io/micronaut/validation/exceptions/ConstraintExceptionHandler.java
ConstraintExceptionHandler.buildMessage
protected String buildMessage(ConstraintViolation violation) { Path propertyPath = violation.getPropertyPath(); StringBuilder message = new StringBuilder(); Iterator<Path.Node> i = propertyPath.iterator(); while (i.hasNext()) { Path.Node node = i.next(); if (node....
java
protected String buildMessage(ConstraintViolation violation) { Path propertyPath = violation.getPropertyPath(); StringBuilder message = new StringBuilder(); Iterator<Path.Node> i = propertyPath.iterator(); while (i.hasNext()) { Path.Node node = i.next(); if (node....
[ "protected", "String", "buildMessage", "(", "ConstraintViolation", "violation", ")", "{", "Path", "propertyPath", "=", "violation", ".", "getPropertyPath", "(", ")", ";", "StringBuilder", "message", "=", "new", "StringBuilder", "(", ")", ";", "Iterator", "<", "P...
Builds a message based on the provided violation. @param violation The constraint violation @return The violation message
[ "Builds", "a", "message", "based", "on", "the", "provided", "violation", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/validation/src/main/java/io/micronaut/validation/exceptions/ConstraintExceptionHandler.java#L79-L95
130,055
micronaut-projects/micronaut-core
tracing/src/main/java/io/micronaut/tracing/interceptor/TraceInterceptor.java
TraceInterceptor.logError
public static void logError(Span span, Throwable e) { HashMap<String, Object> fields = new HashMap<>(); fields.put(Fields.ERROR_OBJECT, e); String message = e.getMessage(); if (message != null) { fields.put(Fields.MESSAGE, message); } span.log(fields); }
java
public static void logError(Span span, Throwable e) { HashMap<String, Object> fields = new HashMap<>(); fields.put(Fields.ERROR_OBJECT, e); String message = e.getMessage(); if (message != null) { fields.put(Fields.MESSAGE, message); } span.log(fields); }
[ "public", "static", "void", "logError", "(", "Span", "span", ",", "Throwable", "e", ")", "{", "HashMap", "<", "String", ",", "Object", ">", "fields", "=", "new", "HashMap", "<>", "(", ")", ";", "fields", ".", "put", "(", "Fields", ".", "ERROR_OBJECT", ...
Logs an error to the span. @param span The span @param e The error
[ "Logs", "an", "error", "to", "the", "span", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/interceptor/TraceInterceptor.java#L221-L229
130,056
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/env/PropertySourcePropertyResolver.java
PropertySourcePropertyResolver.getAllProperties
public Map<String, Object> getAllProperties() { Map<String, Object> map = new HashMap<>(); Arrays .stream(catalog) .filter(Objects::nonNull) .map(Map::entrySet) .flatMap(Collection::stream) .forEach((Map.Entry<String, Object> entry) -> { ...
java
public Map<String, Object> getAllProperties() { Map<String, Object> map = new HashMap<>(); Arrays .stream(catalog) .filter(Objects::nonNull) .map(Map::entrySet) .flatMap(Collection::stream) .forEach((Map.Entry<String, Object> entry) -> { ...
[ "public", "Map", "<", "String", ",", "Object", ">", "getAllProperties", "(", ")", "{", "Map", "<", "String", ",", "Object", ">", "map", "=", "new", "HashMap", "<>", "(", ")", ";", "Arrays", ".", "stream", "(", "catalog", ")", ".", "filter", "(", "O...
Returns a combined Map of all properties in the catalog. @return Map of all properties
[ "Returns", "a", "combined", "Map", "of", "all", "properties", "in", "the", "catalog", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/env/PropertySourcePropertyResolver.java#L289-L320
130,057
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/env/PropertySourcePropertyResolver.java
PropertySourcePropertyResolver.resolveSubMap
@Nonnull protected Map<String, Object> resolveSubMap( String name, Map<String, Object> entries, ArgumentConversionContext<?> conversionContext, StringConvention keyConvention, MapFormat.MapTransformation transformation) { final Argument<?> valueTyp...
java
@Nonnull protected Map<String, Object> resolveSubMap( String name, Map<String, Object> entries, ArgumentConversionContext<?> conversionContext, StringConvention keyConvention, MapFormat.MapTransformation transformation) { final Argument<?> valueTyp...
[ "@", "Nonnull", "protected", "Map", "<", "String", ",", "Object", ">", "resolveSubMap", "(", "String", "name", ",", "Map", "<", "String", ",", "Object", ">", "entries", ",", "ArgumentConversionContext", "<", "?", ">", "conversionContext", ",", "StringConventio...
Resolves a submap for the given name and parameters. @param name The name @param entries The entries @param conversionContext The conversion context @param keyConvention The key convention to use @param transformation The map transformation to apply @return The resulting map
[ "Resolves", "a", "submap", "for", "the", "given", "name", "and", "parameters", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/env/PropertySourcePropertyResolver.java#L377-L409
130,058
micronaut-projects/micronaut-core
http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java
CorsFilter.handleResponse
protected void handleResponse(HttpRequest<?> request, MutableHttpResponse<?> response) { HttpHeaders headers = request.getHeaders(); Optional<String> originHeader = headers.getOrigin(); originHeader.ifPresent(requestOrigin -> { Optional<CorsOriginConfiguration> optionalConfig = getC...
java
protected void handleResponse(HttpRequest<?> request, MutableHttpResponse<?> response) { HttpHeaders headers = request.getHeaders(); Optional<String> originHeader = headers.getOrigin(); originHeader.ifPresent(requestOrigin -> { Optional<CorsOriginConfiguration> optionalConfig = getC...
[ "protected", "void", "handleResponse", "(", "HttpRequest", "<", "?", ">", "request", ",", "MutableHttpResponse", "<", "?", ">", "response", ")", "{", "HttpHeaders", "headers", "=", "request", ".", "getHeaders", "(", ")", ";", "Optional", "<", "String", ">", ...
Handles a CORS response. @param request The {@link HttpRequest} object @param response The {@link MutableHttpResponse} object
[ "Handles", "a", "CORS", "response", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java#L98-L126
130,059
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/async/SupplierUtil.java
SupplierUtil.memoized
public static <T> Supplier<T> memoized(Supplier<T> actual) { return new Supplier<T>() { Supplier<T> delegate = this::initialize; boolean initialized; public T get() { return delegate.get(); } private synchronized T initialize() { ...
java
public static <T> Supplier<T> memoized(Supplier<T> actual) { return new Supplier<T>() { Supplier<T> delegate = this::initialize; boolean initialized; public T get() { return delegate.get(); } private synchronized T initialize() { ...
[ "public", "static", "<", "T", ">", "Supplier", "<", "T", ">", "memoized", "(", "Supplier", "<", "T", ">", "actual", ")", "{", "return", "new", "Supplier", "<", "T", ">", "(", ")", "{", "Supplier", "<", "T", ">", "delegate", "=", "this", "::", "in...
Caches the result of supplier in a thread safe manner. @param actual The supplier providing the result @param <T> The type of result @return A new supplier that will cache the result
[ "Caches", "the", "result", "of", "supplier", "in", "a", "thread", "safe", "manner", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/async/SupplierUtil.java#L36-L54
130,060
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/async/SupplierUtil.java
SupplierUtil.memoizedNonEmpty
public static <T> Supplier<T> memoizedNonEmpty(Supplier<T> actual) { return new Supplier<T>() { Supplier<T> delegate = this::initialize; boolean initialized; public T get() { return delegate.get(); } private synchronized T initialize(...
java
public static <T> Supplier<T> memoizedNonEmpty(Supplier<T> actual) { return new Supplier<T>() { Supplier<T> delegate = this::initialize; boolean initialized; public T get() { return delegate.get(); } private synchronized T initialize(...
[ "public", "static", "<", "T", ">", "Supplier", "<", "T", ">", "memoizedNonEmpty", "(", "Supplier", "<", "T", ">", "actual", ")", "{", "return", "new", "Supplier", "<", "T", ">", "(", ")", "{", "Supplier", "<", "T", ">", "delegate", "=", "this", "::...
Caches the result of supplier in a thread safe manner. The result is only cached if it is non null or non empty if an optional. @param actual The supplier providing the result @param <T> The type of result @return A new supplier that will cache the result
[ "Caches", "the", "result", "of", "supplier", "in", "a", "thread", "safe", "manner", ".", "The", "result", "is", "only", "cached", "if", "it", "is", "non", "null", "or", "non", "empty", "if", "an", "optional", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/async/SupplierUtil.java#L64-L90
130,061
micronaut-projects/micronaut-core
management/src/main/java/io/micronaut/management/endpoint/caches/CachesEndpoint.java
CachesEndpoint.invalidateCaches
@Delete public Maybe<Boolean> invalidateCaches() { return Flowable.fromIterable(cacheManager.getCacheNames()) .map(cacheManager::getCache) .flatMap(c -> Publishers.fromCompletableFuture(() -> c.async().invalidateAll()) ).reduce((aBoolea...
java
@Delete public Maybe<Boolean> invalidateCaches() { return Flowable.fromIterable(cacheManager.getCacheNames()) .map(cacheManager::getCache) .flatMap(c -> Publishers.fromCompletableFuture(() -> c.async().invalidateAll()) ).reduce((aBoolea...
[ "@", "Delete", "public", "Maybe", "<", "Boolean", ">", "invalidateCaches", "(", ")", "{", "return", "Flowable", ".", "fromIterable", "(", "cacheManager", ".", "getCacheNames", "(", ")", ")", ".", "map", "(", "cacheManager", "::", "getCache", ")", ".", "fla...
Invalidates all the caches. @return A maybe that emits a boolean.
[ "Invalidates", "all", "the", "caches", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/management/src/main/java/io/micronaut/management/endpoint/caches/CachesEndpoint.java#L103-L110
130,062
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
CacheInterceptor.interceptCompletableFuture
protected Object interceptCompletableFuture(MethodInvocationContext<Object, Object> context, ReturnType<?> returnTypeObject, Class returnType) { CacheOperation cacheOperation = new CacheOperation(context, returnType); AnnotationValue<Cacheable> cacheable = cacheOperation.cacheable; CompletableFu...
java
protected Object interceptCompletableFuture(MethodInvocationContext<Object, Object> context, ReturnType<?> returnTypeObject, Class returnType) { CacheOperation cacheOperation = new CacheOperation(context, returnType); AnnotationValue<Cacheable> cacheable = cacheOperation.cacheable; CompletableFu...
[ "protected", "Object", "interceptCompletableFuture", "(", "MethodInvocationContext", "<", "Object", ",", "Object", ">", "context", ",", "ReturnType", "<", "?", ">", "returnTypeObject", ",", "Class", "returnType", ")", "{", "CacheOperation", "cacheOperation", "=", "n...
Intercept the aync method invocation. @param context Contains information about method invocation @param returnTypeObject The return type of the method in Micronaut @param returnType The return type class @return The value from the cache
[ "Intercept", "the", "aync", "method", "invocation", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java#L249-L309
130,063
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/util/StreamUtils.java
StreamUtils.maxAll
public static <T, A, D> Collector<T, ?, D> maxAll(Comparator<? super T> comparator, Collector<? super T, A, D> downstream) { Supplier<A> downstreamSupplier = downstream.supplier(); BiConsumer<A, ? super T> downstreamAccumulator = downstream.accumulat...
java
public static <T, A, D> Collector<T, ?, D> maxAll(Comparator<? super T> comparator, Collector<? super T, A, D> downstream) { Supplier<A> downstreamSupplier = downstream.supplier(); BiConsumer<A, ? super T> downstreamAccumulator = downstream.accumulat...
[ "public", "static", "<", "T", ",", "A", ",", "D", ">", "Collector", "<", "T", ",", "?", ",", "D", ">", "maxAll", "(", "Comparator", "<", "?", "super", "T", ">", "comparator", ",", "Collector", "<", "?", "super", "T", ",", "A", ",", "D", ">", ...
A collector that returns all results that are the maximum based on the provided comparator. @param comparator The comparator to order the items in the stream @param downstream Which collector to use to combine the results @param <T> The type of objects being streamed @param <A> The mutable accumulation t...
[ "A", "collector", "that", "returns", "all", "results", "that", "are", "the", "maximum", "based", "on", "the", "provided", "comparator", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StreamUtils.java#L43-L102
130,064
micronaut-projects/micronaut-core
views/src/main/java/io/micronaut/views/ViewsFilter.java
ViewsFilter.resolveModel
@SuppressWarnings("WeakerAccess") protected Object resolveModel(Object responseBody) { if (responseBody instanceof ModelAndView) { return ((ModelAndView) responseBody).getModel().orElse(null); } return responseBody; }
java
@SuppressWarnings("WeakerAccess") protected Object resolveModel(Object responseBody) { if (responseBody instanceof ModelAndView) { return ((ModelAndView) responseBody).getModel().orElse(null); } return responseBody; }
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "protected", "Object", "resolveModel", "(", "Object", "responseBody", ")", "{", "if", "(", "responseBody", "instanceof", "ModelAndView", ")", "{", "return", "(", "(", "ModelAndView", ")", "responseBody", ")", ...
Resolves the model for the given response body. Subclasses can override to customize. @param responseBody Response body @return the model to be rendered
[ "Resolves", "the", "model", "for", "the", "given", "response", "body", ".", "Subclasses", "can", "override", "to", "customize", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/views/src/main/java/io/micronaut/views/ViewsFilter.java#L187-L193
130,065
micronaut-projects/micronaut-core
views/src/main/java/io/micronaut/views/ViewsFilter.java
ViewsFilter.resolveView
@SuppressWarnings("WeakerAccess") protected Optional<String> resolveView(AnnotationMetadata route, Object responseBody) { Optional optionalViewName = route.getValue(View.class); if (optionalViewName.isPresent()) { return Optional.of((String) optionalViewName.get()); } else if (re...
java
@SuppressWarnings("WeakerAccess") protected Optional<String> resolveView(AnnotationMetadata route, Object responseBody) { Optional optionalViewName = route.getValue(View.class); if (optionalViewName.isPresent()) { return Optional.of((String) optionalViewName.get()); } else if (re...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "protected", "Optional", "<", "String", ">", "resolveView", "(", "AnnotationMetadata", "route", ",", "Object", "responseBody", ")", "{", "Optional", "optionalViewName", "=", "route", ".", "getValue", "(", "Vie...
Resolves the view for the given method and response body. Subclasses can override to customize. @param route Request route @param responseBody Response body @return view name to be rendered
[ "Resolves", "the", "view", "for", "the", "given", "method", "and", "response", "body", ".", "Subclasses", "can", "override", "to", "customize", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/views/src/main/java/io/micronaut/views/ViewsFilter.java#L204-L213
130,066
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/reflect/ClassUtils.java
ClassUtils.arrayTypeForPrimitive
public static @Nonnull Optional<Class> arrayTypeForPrimitive(String primitiveType) { if (primitiveType != null) { return Optional.ofNullable(PRIMITIVE_ARRAY_MAP.get(primitiveType)); } return Optional.empty(); }
java
public static @Nonnull Optional<Class> arrayTypeForPrimitive(String primitiveType) { if (primitiveType != null) { return Optional.ofNullable(PRIMITIVE_ARRAY_MAP.get(primitiveType)); } return Optional.empty(); }
[ "public", "static", "@", "Nonnull", "Optional", "<", "Class", ">", "arrayTypeForPrimitive", "(", "String", "primitiveType", ")", "{", "if", "(", "primitiveType", "!=", "null", ")", "{", "return", "Optional", ".", "ofNullable", "(", "PRIMITIVE_ARRAY_MAP", ".", ...
Returns the array type for the given primitive type name. @param primitiveType The primitive type name @return The array type
[ "Returns", "the", "array", "type", "for", "the", "given", "primitive", "type", "name", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/ClassUtils.java#L182-L187
130,067
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/reflect/ClassUtils.java
ClassUtils.resolveHierarchy
public static List<Class> resolveHierarchy(Class<?> type) { Class<?> superclass = type.getSuperclass(); List<Class> hierarchy = new ArrayList<>(); if (superclass != null) { populateHierarchyInterfaces(type, hierarchy); while (superclass != Object.class) { ...
java
public static List<Class> resolveHierarchy(Class<?> type) { Class<?> superclass = type.getSuperclass(); List<Class> hierarchy = new ArrayList<>(); if (superclass != null) { populateHierarchyInterfaces(type, hierarchy); while (superclass != Object.class) { ...
[ "public", "static", "List", "<", "Class", ">", "resolveHierarchy", "(", "Class", "<", "?", ">", "type", ")", "{", "Class", "<", "?", ">", "superclass", "=", "type", ".", "getSuperclass", "(", ")", ";", "List", "<", "Class", ">", "hierarchy", "=", "ne...
Builds a class hierarchy that includes all super classes and interfaces that the given class implements or extends from. @param type The class to start with @return The class hierarchy
[ "Builds", "a", "class", "hierarchy", "that", "includes", "all", "super", "classes", "and", "interfaces", "that", "the", "given", "class", "implements", "or", "extends", "from", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/ClassUtils.java#L321-L344
130,068
micronaut-projects/micronaut-core
inject-java/src/main/java/io/micronaut/annotation/processing/AbstractInjectAnnotationProcessor.java
AbstractInjectAnnotationProcessor.warning
protected final void warning(Element e, String msg, Object... args) { if (messager == null) { illegalState(); } messager.printMessage(Diagnostic.Kind.WARNING, String.format(msg, args), e); }
java
protected final void warning(Element e, String msg, Object... args) { if (messager == null) { illegalState(); } messager.printMessage(Diagnostic.Kind.WARNING, String.format(msg, args), e); }
[ "protected", "final", "void", "warning", "(", "Element", "e", ",", "String", "msg", ",", "Object", "...", "args", ")", "{", "if", "(", "messager", "==", "null", ")", "{", "illegalState", "(", ")", ";", "}", "messager", ".", "printMessage", "(", "Diagno...
Produce a compile warning for the given element and message. @param e The element @param msg The message @param args The string format args
[ "Produce", "a", "compile", "warning", "for", "the", "given", "element", "and", "message", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/AbstractInjectAnnotationProcessor.java#L137-L142
130,069
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/discovery/cloud/aws/AmazonComputeInstanceMetadataResolver.java
AmazonComputeInstanceMetadataResolver.readEc2MetadataUrl
private String readEc2MetadataUrl(URL url, int connectionTimeoutMs, int readTimeoutMs) throws IOException { if (url.getProtocol().equalsIgnoreCase("file")) { url = rewriteUrl(url); URLConnection urlConnection = url.openConnection(); urlConnection.connect(); try (...
java
private String readEc2MetadataUrl(URL url, int connectionTimeoutMs, int readTimeoutMs) throws IOException { if (url.getProtocol().equalsIgnoreCase("file")) { url = rewriteUrl(url); URLConnection urlConnection = url.openConnection(); urlConnection.connect(); try (...
[ "private", "String", "readEc2MetadataUrl", "(", "URL", "url", ",", "int", "connectionTimeoutMs", ",", "int", "readTimeoutMs", ")", "throws", "IOException", "{", "if", "(", "url", ".", "getProtocol", "(", ")", ".", "equalsIgnoreCase", "(", "\"file\"", ")", ")",...
Read EC2 metadata from the given URL. @param url URL to fetch AWS EC2 metadata information @param connectionTimeoutMs connection timeout in millis @param readTimeoutMs read timeout in millis @return AWS EC2 metadata information @throws IOException Signals that an I/O exception of some sort has occurred
[ "Read", "EC2", "metadata", "from", "the", "given", "URL", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/discovery/cloud/aws/AmazonComputeInstanceMetadataResolver.java#L176-L200
130,070
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.isValidServiceId
public static boolean isValidServiceId(String name) { return name != null && name.length() > 0 && SERVICE_ID_REGEX.matcher(name).matches() && Character.isLetter(name.charAt(0)); }
java
public static boolean isValidServiceId(String name) { return name != null && name.length() > 0 && SERVICE_ID_REGEX.matcher(name).matches() && Character.isLetter(name.charAt(0)); }
[ "public", "static", "boolean", "isValidServiceId", "(", "String", "name", ")", "{", "return", "name", "!=", "null", "&&", "name", ".", "length", "(", ")", ">", "0", "&&", "SERVICE_ID_REGEX", ".", "matcher", "(", "name", ")", ".", "matches", "(", ")", "...
Checks whether the given name is a valid service identifier. @param name The name @return True if it is
[ "Checks", "whether", "the", "given", "name", "is", "a", "valid", "service", "identifier", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L47-L49
130,071
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getSetterName
public static String getSetterName(String propertyName) { final String suffix = getSuffixForGetterOrSetter(propertyName); return PROPERTY_SET_PREFIX + suffix; }
java
public static String getSetterName(String propertyName) { final String suffix = getSuffixForGetterOrSetter(propertyName); return PROPERTY_SET_PREFIX + suffix; }
[ "public", "static", "String", "getSetterName", "(", "String", "propertyName", ")", "{", "final", "String", "suffix", "=", "getSuffixForGetterOrSetter", "(", "propertyName", ")", ";", "return", "PROPERTY_SET_PREFIX", "+", "suffix", ";", "}" ]
Retrieves the name of a setter for the specified property name. @param propertyName The property name @return The setter equivalent
[ "Retrieves", "the", "name", "of", "a", "setter", "for", "the", "specified", "property", "name", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L57-L60
130,072
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getGetterName
public static String getGetterName(String propertyName) { final String suffix = getSuffixForGetterOrSetter(propertyName); return PROPERTY_GET_PREFIX + suffix; }
java
public static String getGetterName(String propertyName) { final String suffix = getSuffixForGetterOrSetter(propertyName); return PROPERTY_GET_PREFIX + suffix; }
[ "public", "static", "String", "getGetterName", "(", "String", "propertyName", ")", "{", "final", "String", "suffix", "=", "getSuffixForGetterOrSetter", "(", "propertyName", ")", ";", "return", "PROPERTY_GET_PREFIX", "+", "suffix", ";", "}" ]
Calculate the name for a getter method to retrieve the specified property. @param propertyName The property name @return The name for the getter method for this property, if it were to exist, i.e. getConstraints
[ "Calculate", "the", "name", "for", "a", "getter", "method", "to", "retrieve", "the", "specified", "property", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L68-L71
130,073
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getClassName
public static String getClassName(String logicalName, String trailingName) { if (isBlank(logicalName)) { throw new IllegalArgumentException("Argument [logicalName] cannot be null or blank"); } String className = logicalName.substring(0, 1).toUpperCase(Locale.ENGLISH) + logicalName.s...
java
public static String getClassName(String logicalName, String trailingName) { if (isBlank(logicalName)) { throw new IllegalArgumentException("Argument [logicalName] cannot be null or blank"); } String className = logicalName.substring(0, 1).toUpperCase(Locale.ENGLISH) + logicalName.s...
[ "public", "static", "String", "getClassName", "(", "String", "logicalName", ",", "String", "trailingName", ")", "{", "if", "(", "isBlank", "(", "logicalName", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Argument [logicalName] cannot be null or b...
Returns the class name for the given logical name and trailing name. For example "person" and "Controller" would evaluate to "PersonController". @param logicalName The logical name @param trailingName The trailing name @return The class name
[ "Returns", "the", "class", "name", "for", "the", "given", "logical", "name", "and", "trailing", "name", ".", "For", "example", "person", "and", "Controller", "would", "evaluate", "to", "PersonController", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L92-L102
130,074
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getClassNameRepresentation
public static String getClassNameRepresentation(String name) { if (name == null || name.length() == 0) { return ""; } StringBuilder buf = new StringBuilder(); String[] tokens = name.split("[^\\w\\d]"); for (String token1 : tokens) { String token = token1....
java
public static String getClassNameRepresentation(String name) { if (name == null || name.length() == 0) { return ""; } StringBuilder buf = new StringBuilder(); String[] tokens = name.split("[^\\w\\d]"); for (String token1 : tokens) { String token = token1....
[ "public", "static", "String", "getClassNameRepresentation", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", "0", ")", "{", "return", "\"\"", ";", "}", "StringBuilder", "buf", "=", "new", "S...
Returns the class name representation of the given name. @param name The name to convert @return The property name representation
[ "Returns", "the", "class", "name", "representation", "of", "the", "given", "name", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L146-L165
130,075
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getClassNameForLowerCaseHyphenSeparatedName
private static String getClassNameForLowerCaseHyphenSeparatedName(String name) { // Handle null and empty strings. if (isBlank(name)) { return name; } if (name.indexOf('-') == -1) { return name.substring(0, 1).toUpperCase() + name.substring(1); } ...
java
private static String getClassNameForLowerCaseHyphenSeparatedName(String name) { // Handle null and empty strings. if (isBlank(name)) { return name; } if (name.indexOf('-') == -1) { return name.substring(0, 1).toUpperCase() + name.substring(1); } ...
[ "private", "static", "String", "getClassNameForLowerCaseHyphenSeparatedName", "(", "String", "name", ")", "{", "// Handle null and empty strings.", "if", "(", "isBlank", "(", "name", ")", ")", "{", "return", "name", ";", "}", "if", "(", "name", ".", "indexOf", "...
Converts foo-bar into FooBar. Empty and null strings are returned as-is. @param name The lower case hyphen separated name @return The class name equivalent.
[ "Converts", "foo", "-", "bar", "into", "FooBar", ".", "Empty", "and", "null", "strings", "are", "returned", "as", "-", "is", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L173-L193
130,076
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getLogicalName
public static String getLogicalName(Class<?> clazz, String trailingName) { return getLogicalName(clazz.getName(), trailingName); }
java
public static String getLogicalName(Class<?> clazz, String trailingName) { return getLogicalName(clazz.getName(), trailingName); }
[ "public", "static", "String", "getLogicalName", "(", "Class", "<", "?", ">", "clazz", ",", "String", "trailingName", ")", "{", "return", "getLogicalName", "(", "clazz", ".", "getName", "(", ")", ",", "trailingName", ")", ";", "}" ]
Retrieves the logical class name of a Micronaut artifact given the Micronaut class and a specified trailing name. @param clazz The class @param trailingName The trailing name such as "Controller" or "Service" @return The logical class name
[ "Retrieves", "the", "logical", "class", "name", "of", "a", "Micronaut", "artifact", "given", "the", "Micronaut", "class", "and", "a", "specified", "trailing", "name", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L203-L205
130,077
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getLogicalName
public static String getLogicalName(String name, String trailingName) { if (isBlank(trailingName)) { return name; } String shortName = getShortName(name); if (shortName.indexOf(trailingName) == -1) { return name; } return shortName.substring(0, s...
java
public static String getLogicalName(String name, String trailingName) { if (isBlank(trailingName)) { return name; } String shortName = getShortName(name); if (shortName.indexOf(trailingName) == -1) { return name; } return shortName.substring(0, s...
[ "public", "static", "String", "getLogicalName", "(", "String", "name", ",", "String", "trailingName", ")", "{", "if", "(", "isBlank", "(", "trailingName", ")", ")", "{", "return", "name", ";", "}", "String", "shortName", "=", "getShortName", "(", "name", "...
Retrieves the logical name of the class without the trailing name. @param name The name of the class @param trailingName The trailing name @return The logical name
[ "Retrieves", "the", "logical", "name", "of", "the", "class", "without", "the", "trailing", "name", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L214-L225
130,078
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getPropertyNameRepresentation
public static String getPropertyNameRepresentation(String name) { // Strip any package from the name. int pos = name.lastIndexOf('.'); if (pos != -1) { name = name.substring(pos + 1); } if (name.isEmpty()) { return name; } // Check whethe...
java
public static String getPropertyNameRepresentation(String name) { // Strip any package from the name. int pos = name.lastIndexOf('.'); if (pos != -1) { name = name.substring(pos + 1); } if (name.isEmpty()) { return name; } // Check whethe...
[ "public", "static", "String", "getPropertyNameRepresentation", "(", "String", "name", ")", "{", "// Strip any package from the name.", "int", "pos", "=", "name", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "pos", "!=", "-", "1", ")", "{", "name",...
Returns the property name representation of the given name. @param name The name to convert @return The property name representation
[ "Returns", "the", "property", "name", "representation", "of", "the", "given", "name", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L277-L299
130,079
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getShortName
public static String getShortName(String className) { int i = className.lastIndexOf("."); if (i > -1) { className = className.substring(i + 1, className.length()); } return className; }
java
public static String getShortName(String className) { int i = className.lastIndexOf("."); if (i > -1) { className = className.substring(i + 1, className.length()); } return className; }
[ "public", "static", "String", "getShortName", "(", "String", "className", ")", "{", "int", "i", "=", "className", ".", "lastIndexOf", "(", "\".\"", ")", ";", "if", "(", "i", ">", "-", "1", ")", "{", "className", "=", "className", ".", "substring", "(",...
Returns the class name without the package prefix. @param className The class name from which to get a short name @return The short name of the class
[ "Returns", "the", "class", "name", "without", "the", "package", "prefix", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L327-L333
130,080
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getScriptName
public static String getScriptName(Class<?> clazz) { return clazz == null ? null : getScriptName(clazz.getName()); }
java
public static String getScriptName(Class<?> clazz) { return clazz == null ? null : getScriptName(clazz.getName()); }
[ "public", "static", "String", "getScriptName", "(", "Class", "<", "?", ">", "clazz", ")", "{", "return", "clazz", "==", "null", "?", "null", ":", "getScriptName", "(", "clazz", ".", "getName", "(", ")", ")", ";", "}" ]
Retrieves the script name representation of the supplied class. For example MyFunkyGrailsScript would be my-funky-grails-script. @param clazz The class to convert @return The script name representation
[ "Retrieves", "the", "script", "name", "representation", "of", "the", "supplied", "class", ".", "For", "example", "MyFunkyGrailsScript", "would", "be", "my", "-", "funky", "-", "grails", "-", "script", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L357-L359
130,081
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getScriptName
public static String getScriptName(String name) { if (name == null) { return null; } if (name.endsWith(".groovy")) { name = name.substring(0, name.length() - 7); } return getNaturalName(name).replaceAll("\\s", "-").toLowerCase(); }
java
public static String getScriptName(String name) { if (name == null) { return null; } if (name.endsWith(".groovy")) { name = name.substring(0, name.length() - 7); } return getNaturalName(name).replaceAll("\\s", "-").toLowerCase(); }
[ "public", "static", "String", "getScriptName", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "name", ".", "endsWith", "(", "\".groovy\"", ")", ")", "{", "name", "=", "name", ".", ...
Retrieves the script name representation of the given class name. For example MyFunkyGrailsScript would be my-funky-grails-script. @param name The class name to convert. @return The script name representation.
[ "Retrieves", "the", "script", "name", "representation", "of", "the", "given", "class", "name", ".", "For", "example", "MyFunkyGrailsScript", "would", "be", "my", "-", "funky", "-", "grails", "-", "script", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L368-L377
130,082
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.isValidJavaPackage
public static boolean isValidJavaPackage(String packageName) { if (isBlank(packageName)) { return false; } final String[] parts = packageName.split("\\."); for (String part : parts) { if (!isValidJavaIdentifier(part)) { return false; } ...
java
public static boolean isValidJavaPackage(String packageName) { if (isBlank(packageName)) { return false; } final String[] parts = packageName.split("\\."); for (String part : parts) { if (!isValidJavaIdentifier(part)) { return false; } ...
[ "public", "static", "boolean", "isValidJavaPackage", "(", "String", "packageName", ")", "{", "if", "(", "isBlank", "(", "packageName", ")", ")", "{", "return", "false", ";", "}", "final", "String", "[", "]", "parts", "=", "packageName", ".", "split", "(", ...
Test whether the give package name is a valid Java package. @param packageName The name of the package @return True if it is valid
[ "Test", "whether", "the", "give", "package", "name", "is", "a", "valid", "Java", "package", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L492-L503
130,083
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.isValidJavaIdentifier
public static boolean isValidJavaIdentifier(String name) { if (isBlank(name)) { return false; } final char[] chars = name.toCharArray(); if (!Character.isJavaIdentifierStart(chars[0])) { return false; } for (char c : chars) { if (!Cha...
java
public static boolean isValidJavaIdentifier(String name) { if (isBlank(name)) { return false; } final char[] chars = name.toCharArray(); if (!Character.isJavaIdentifierStart(chars[0])) { return false; } for (char c : chars) { if (!Cha...
[ "public", "static", "boolean", "isValidJavaIdentifier", "(", "String", "name", ")", "{", "if", "(", "isBlank", "(", "name", ")", ")", "{", "return", "false", ";", "}", "final", "char", "[", "]", "chars", "=", "name", ".", "toCharArray", "(", ")", ";", ...
Test whether the given name is a valid Java identifier. @param name The name @return True if it is
[ "Test", "whether", "the", "given", "name", "is", "a", "valid", "Java", "identifier", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L511-L528
130,084
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java
NameUtils.getPropertyNameConvention
public static String getPropertyNameConvention(Object object, String suffix) { if (object != null) { Class<?> type = object.getClass(); if (type.isArray()) { return getPropertyName(type.getComponentType()) + suffix + "Array"; } if (object instance...
java
public static String getPropertyNameConvention(Object object, String suffix) { if (object != null) { Class<?> type = object.getClass(); if (type.isArray()) { return getPropertyName(type.getComponentType()) + suffix + "Array"; } if (object instance...
[ "public", "static", "String", "getPropertyNameConvention", "(", "Object", "object", ",", "String", "suffix", ")", "{", "if", "(", "object", "!=", "null", ")", "{", "Class", "<", "?", ">", "type", "=", "object", ".", "getClass", "(", ")", ";", "if", "("...
Returns an appropriate property name for the given object. If the object is a collection will append List, Set, Collection or Map to the property name. @param object The object @param suffix The suffix to append to the name. @return The property name convention
[ "Returns", "an", "appropriate", "property", "name", "for", "the", "given", "object", ".", "If", "the", "object", "is", "a", "collection", "will", "append", "List", "Set", "Collection", "or", "Map", "to", "the", "property", "name", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L538-L577
130,085
micronaut-projects/micronaut-core
core/src/main/java/io/micronaut/core/io/IOUtils.java
IOUtils.readText
@Blocking public static String readText(BufferedReader reader) throws IOException { StringBuilder answer = new StringBuilder(); if (reader == null) { return answer.toString(); } // reading the content of the file within a char buffer // allow to keep the correct l...
java
@Blocking public static String readText(BufferedReader reader) throws IOException { StringBuilder answer = new StringBuilder(); if (reader == null) { return answer.toString(); } // reading the content of the file within a char buffer // allow to keep the correct l...
[ "@", "Blocking", "public", "static", "String", "readText", "(", "BufferedReader", "reader", ")", "throws", "IOException", "{", "StringBuilder", "answer", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "reader", "==", "null", ")", "{", "return", "answ...
Read the content of the BufferedReader and return it as a String in a blocking manner. The BufferedReader is closed afterwards. @param reader a BufferedReader whose content we want to read @return a String containing the content of the buffered reader @throws IOException if an IOException occurs. @since 1.0
[ "Read", "the", "content", "of", "the", "BufferedReader", "and", "return", "it", "as", "a", "String", "in", "a", "blocking", "manner", ".", "The", "BufferedReader", "is", "closed", "afterwards", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/IOUtils.java#L46-L76
130,086
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/runtime/Micronaut.java
Micronaut.mapError
public <T extends Throwable> Micronaut mapError(Class<T> exception, Function<T, Integer> mapper) { this.exitHandlers.put(exception, (Function<Throwable, Integer>) mapper); return this; }
java
public <T extends Throwable> Micronaut mapError(Class<T> exception, Function<T, Integer> mapper) { this.exitHandlers.put(exception, (Function<Throwable, Integer>) mapper); return this; }
[ "public", "<", "T", "extends", "Throwable", ">", "Micronaut", "mapError", "(", "Class", "<", "T", ">", "exception", ",", "Function", "<", "T", ",", "Integer", ">", "mapper", ")", "{", "this", ".", "exitHandlers", ".", "put", "(", "exception", ",", "(",...
Maps an exception to the given error code. @param exception The exception @param mapper The mapper @param <T> The exception type @return This application
[ "Maps", "an", "exception", "to", "the", "given", "error", "code", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/runtime/Micronaut.java#L241-L244
130,087
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/runtime/Micronaut.java
Micronaut.handleStartupException
protected void handleStartupException(Environment environment, Throwable exception) { Function<Throwable, Integer> exitCodeMapper = exitHandlers.computeIfAbsent(exception.getClass(), exceptionType -> (throwable -> 1)); Integer code = exitCodeMapper.apply(exception); if (code > 0) { i...
java
protected void handleStartupException(Environment environment, Throwable exception) { Function<Throwable, Integer> exitCodeMapper = exitHandlers.computeIfAbsent(exception.getClass(), exceptionType -> (throwable -> 1)); Integer code = exitCodeMapper.apply(exception); if (code > 0) { i...
[ "protected", "void", "handleStartupException", "(", "Environment", "environment", ",", "Throwable", "exception", ")", "{", "Function", "<", "Throwable", ",", "Integer", ">", "exitCodeMapper", "=", "exitHandlers", ".", "computeIfAbsent", "(", "exception", ".", "getCl...
Default handling of startup exceptions. @param environment The environment @param exception The exception @throws ApplicationStartupException If the server cannot be shutdown with an appropriate exist code
[ "Default", "handling", "of", "startup", "exceptions", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/runtime/Micronaut.java#L298-L310
130,088
micronaut-projects/micronaut-core
tracing/src/main/java/io/micronaut/tracing/jaeger/JaegerTracerFactory.java
JaegerTracerFactory.jaegerConfiguration
@Singleton @Primary @Requires(classes = JaegerTracer.Builder.class) Configuration jaegerConfiguration() { return this.configuration.getConfiguration(); }
java
@Singleton @Primary @Requires(classes = JaegerTracer.Builder.class) Configuration jaegerConfiguration() { return this.configuration.getConfiguration(); }
[ "@", "Singleton", "@", "Primary", "@", "Requires", "(", "classes", "=", "JaegerTracer", ".", "Builder", ".", "class", ")", "Configuration", "jaegerConfiguration", "(", ")", "{", "return", "this", ".", "configuration", ".", "getConfiguration", "(", ")", ";", ...
The Jaeger configuration bean. @return The configuration
[ "The", "Jaeger", "configuration", "bean", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/jaeger/JaegerTracerFactory.java#L85-L90
130,089
micronaut-projects/micronaut-core
tracing/src/main/java/io/micronaut/tracing/jaeger/JaegerTracerFactory.java
JaegerTracerFactory.jaegerTracerBuilder
@Singleton @Primary @Requires(classes = JaegerTracer.Builder.class) JaegerTracer.Builder jaegerTracerBuilder(Configuration configuration) { JaegerTracer.Builder tracerBuilder = resolveBuilder(configuration); if (this.configuration.isExpandExceptionLogs()) { tracerBuilder.withExpa...
java
@Singleton @Primary @Requires(classes = JaegerTracer.Builder.class) JaegerTracer.Builder jaegerTracerBuilder(Configuration configuration) { JaegerTracer.Builder tracerBuilder = resolveBuilder(configuration); if (this.configuration.isExpandExceptionLogs()) { tracerBuilder.withExpa...
[ "@", "Singleton", "@", "Primary", "@", "Requires", "(", "classes", "=", "JaegerTracer", ".", "Builder", ".", "class", ")", "JaegerTracer", ".", "Builder", "jaegerTracerBuilder", "(", "Configuration", "configuration", ")", "{", "JaegerTracer", ".", "Builder", "tr...
The Jaeger Tracer builder bean. @param configuration The configuration @return The builder
[ "The", "Jaeger", "Tracer", "builder", "bean", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/jaeger/JaegerTracerFactory.java#L98-L116
130,090
micronaut-projects/micronaut-core
http-server-netty/src/main/java/io/micronaut/http/server/netty/NettyHttpRequest.java
NettyHttpRequest.release
@Internal public void release() { Object body = getBody().orElse(null); releaseIfNecessary(body); for (ByteBufHolder byteBuf : receivedContent) { releaseIfNecessary(byteBuf); } for (ByteBufHolder byteBuf : receivedData.values()) { releaseIfNecessary(by...
java
@Internal public void release() { Object body = getBody().orElse(null); releaseIfNecessary(body); for (ByteBufHolder byteBuf : receivedContent) { releaseIfNecessary(byteBuf); } for (ByteBufHolder byteBuf : receivedData.values()) { releaseIfNecessary(by...
[ "@", "Internal", "public", "void", "release", "(", ")", "{", "Object", "body", "=", "getBody", "(", ")", ".", "orElse", "(", "null", ")", ";", "releaseIfNecessary", "(", "body", ")", ";", "for", "(", "ByteBufHolder", "byteBuf", ":", "receivedContent", ")...
Release and cleanup resources.
[ "Release", "and", "cleanup", "resources", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/NettyHttpRequest.java#L253-L271
130,091
micronaut-projects/micronaut-core
http-server-netty/src/main/java/io/micronaut/http/server/netty/NettyHttpRequest.java
NettyHttpRequest.setBody
@Internal public void setBody(T body) { this.body = () -> Optional.ofNullable(body); this.convertedBodies.clear(); }
java
@Internal public void setBody(T body) { this.body = () -> Optional.ofNullable(body); this.convertedBodies.clear(); }
[ "@", "Internal", "public", "void", "setBody", "(", "T", "body", ")", "{", "this", ".", "body", "=", "(", ")", "->", "Optional", ".", "ofNullable", "(", "body", ")", ";", "this", ".", "convertedBodies", ".", "clear", "(", ")", ";", "}" ]
Sets the body. @param body The body to set
[ "Sets", "the", "body", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/NettyHttpRequest.java#L291-L295
130,092
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java
SpringIOUtils.copyAll
public static void copyAll(Resource base, Resource[] resources, File targetDir) throws IOException { final URL baseUrl = base.getURL(); for (Resource resource : resources) { final InputStream input = resource.getInputStream(); final File target = new File(targetDir, resource.getU...
java
public static void copyAll(Resource base, Resource[] resources, File targetDir) throws IOException { final URL baseUrl = base.getURL(); for (Resource resource : resources) { final InputStream input = resource.getInputStream(); final File target = new File(targetDir, resource.getU...
[ "public", "static", "void", "copyAll", "(", "Resource", "base", ",", "Resource", "[", "]", "resources", ",", "File", "targetDir", ")", "throws", "IOException", "{", "final", "URL", "baseUrl", "=", "base", ".", "getURL", "(", ")", ";", "for", "(", "Resour...
Copies all the resources for the given target directory. The base resource serves to calculate the relative path such that the directory structure is maintained. @param base The base resource @param resources The resources to copy @param targetDir The target directory @throws IOException if there is an error
[ "Copies", "all", "the", "resources", "for", "the", "given", "target", "directory", ".", "The", "base", "resource", "serves", "to", "calculate", "the", "relative", "path", "such", "that", "the", "directory", "structure", "is", "maintained", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java#L181-L188
130,093
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java
SpringIOUtils.copy
public static void copy(byte[] in, OutputStream out) throws IOException { assert in != null : "No input byte array specified"; assert out != null : "No output stream specified"; try { out.write(in); } finally { try { out.close(); } catc...
java
public static void copy(byte[] in, OutputStream out) throws IOException { assert in != null : "No input byte array specified"; assert out != null : "No output stream specified"; try { out.write(in); } finally { try { out.close(); } catc...
[ "public", "static", "void", "copy", "(", "byte", "[", "]", "in", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "assert", "in", "!=", "null", ":", "\"No input byte array specified\"", ";", "assert", "out", "!=", "null", ":", "\"No output stream...
Copy the contents of the given byte array to the given OutputStream. Closes the stream when done. @param in the byte array to copy from @param out the OutputStream to copy to @throws IOException in case of I/O errors
[ "Copy", "the", "contents", "of", "the", "given", "byte", "array", "to", "the", "given", "OutputStream", ".", "Closes", "the", "stream", "when", "done", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java#L294-L305
130,094
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java
SpringIOUtils.copyToByteArray
public static byte[] copyToByteArray(InputStream in) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(BUFFER_SIZE); copy(in, out); return out.toByteArray(); }
java
public static byte[] copyToByteArray(InputStream in) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(BUFFER_SIZE); copy(in, out); return out.toByteArray(); }
[ "public", "static", "byte", "[", "]", "copyToByteArray", "(", "InputStream", "in", ")", "throws", "IOException", "{", "ByteArrayOutputStream", "out", "=", "new", "ByteArrayOutputStream", "(", "BUFFER_SIZE", ")", ";", "copy", "(", "in", ",", "out", ")", ";", ...
Copy the contents of the given InputStream into a new byte array. Closes the stream when done. @param in the stream to copy from @return the new byte array that has been copied to @throws IOException in case of I/O errors
[ "Copy", "the", "contents", "of", "the", "given", "InputStream", "into", "a", "new", "byte", "array", ".", "Closes", "the", "stream", "when", "done", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java#L315-L319
130,095
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java
SpringIOUtils.copy
public static int copy(Reader in, Writer out) throws IOException { assert in != null : "No input Reader specified"; assert out != null : "No output Writer specified"; try { int byteCount = 0; char[] buffer = new char[BUFFER_SIZE]; int bytesRead = -1; ...
java
public static int copy(Reader in, Writer out) throws IOException { assert in != null : "No input Reader specified"; assert out != null : "No output Writer specified"; try { int byteCount = 0; char[] buffer = new char[BUFFER_SIZE]; int bytesRead = -1; ...
[ "public", "static", "int", "copy", "(", "Reader", "in", ",", "Writer", "out", ")", "throws", "IOException", "{", "assert", "in", "!=", "null", ":", "\"No input Reader specified\"", ";", "assert", "out", "!=", "null", ":", "\"No output Writer specified\"", ";", ...
Copy the contents of the given Reader to the given Writer. Closes both when done. @param in the Reader to copy from @param out the Writer to copy to @return the number of characters copied @throws IOException in case of I/O errors
[ "Copy", "the", "contents", "of", "the", "given", "Reader", "to", "the", "given", "Writer", ".", "Closes", "both", "when", "done", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java#L334-L358
130,096
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java
SpringIOUtils.copy
public static void copy(String in, Writer out) throws IOException { assert in != null : "No input String specified"; assert out != null : "No output Writer specified"; try { out.write(in); } finally { try { out.close(); } catch (IOExce...
java
public static void copy(String in, Writer out) throws IOException { assert in != null : "No input String specified"; assert out != null : "No output Writer specified"; try { out.write(in); } finally { try { out.close(); } catch (IOExce...
[ "public", "static", "void", "copy", "(", "String", "in", ",", "Writer", "out", ")", "throws", "IOException", "{", "assert", "in", "!=", "null", ":", "\"No input String specified\"", ";", "assert", "out", "!=", "null", ":", "\"No output Writer specified\"", ";", ...
Copy the contents of the given String to the given output Writer. Closes the write when done. @param in the String to copy from @param out the Writer to copy to @throws IOException in case of I/O errors
[ "Copy", "the", "contents", "of", "the", "given", "String", "to", "the", "given", "output", "Writer", ".", "Closes", "the", "write", "when", "done", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java#L368-L380
130,097
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java
SpringIOUtils.copyToString
public static String copyToString(Reader in) throws IOException { StringWriter out = new StringWriter(); copy(in, out); return out.toString(); }
java
public static String copyToString(Reader in) throws IOException { StringWriter out = new StringWriter(); copy(in, out); return out.toString(); }
[ "public", "static", "String", "copyToString", "(", "Reader", "in", ")", "throws", "IOException", "{", "StringWriter", "out", "=", "new", "StringWriter", "(", ")", ";", "copy", "(", "in", ",", "out", ")", ";", "return", "out", ".", "toString", "(", ")", ...
Copy the contents of the given Reader into a String. Closes the reader when done. @param in the reader to copy from @return the String that has been copied to @throws IOException in case of I/O errors
[ "Copy", "the", "contents", "of", "the", "given", "Reader", "into", "a", "String", ".", "Closes", "the", "reader", "when", "done", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/SpringIOUtils.java#L405-L409
130,098
micronaut-projects/micronaut-core
discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java
Route53AutoNamingRegistrationClient.pulsate
@Override protected void pulsate(ServiceInstance instance, HealthStatus status) { // this only work if you create a health status check when you register it // we can't really pulsate anywhere because amazon health checks work inverse from this UNLESS you have a custom health check Optional<...
java
@Override protected void pulsate(ServiceInstance instance, HealthStatus status) { // this only work if you create a health status check when you register it // we can't really pulsate anywhere because amazon health checks work inverse from this UNLESS you have a custom health check Optional<...
[ "@", "Override", "protected", "void", "pulsate", "(", "ServiceInstance", "instance", ",", "HealthStatus", "status", ")", "{", "// this only work if you create a health status check when you register it", "// we can't really pulsate anywhere because amazon health checks work inverse from ...
If custom health check is enabled, this sends a heartbeat to it. In most cases aws monitoring works off polling an application's endpoint @param instance The instance of the service @param status The {@link HealthStatus}
[ "If", "custom", "health", "check", "is", "enabled", "this", "sends", "a", "heartbeat", "to", "it", ".", "In", "most", "cases", "aws", "monitoring", "works", "off", "polling", "an", "application", "s", "endpoint" ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java#L138-L177
130,099
micronaut-projects/micronaut-core
discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java
Route53AutoNamingRegistrationClient.deregister
@Override protected void deregister(ServiceInstance instance) { if (instance.getInstanceId().isPresent()) { DeregisterInstanceRequest deregisterInstanceRequest = new DeregisterInstanceRequest().withServiceId(route53AutoRegistrationConfiguration.getAwsServiceId()) .withInstan...
java
@Override protected void deregister(ServiceInstance instance) { if (instance.getInstanceId().isPresent()) { DeregisterInstanceRequest deregisterInstanceRequest = new DeregisterInstanceRequest().withServiceId(route53AutoRegistrationConfiguration.getAwsServiceId()) .withInstan...
[ "@", "Override", "protected", "void", "deregister", "(", "ServiceInstance", "instance", ")", "{", "if", "(", "instance", ".", "getInstanceId", "(", ")", ".", "isPresent", "(", ")", ")", "{", "DeregisterInstanceRequest", "deregisterInstanceRequest", "=", "new", "...
shutdown instance if it fails health check can gracefully stop.
[ "shutdown", "instance", "if", "it", "fails", "health", "check", "can", "gracefully", "stop", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java#L183-L191