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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
129,800 | mockito/mockito | src/main/java/org/mockito/internal/util/reflection/GenericTypeExtractor.java | GenericTypeExtractor.findGenericInterface | private static Type findGenericInterface(Class<?> sourceClass, Class<?> targetBaseInterface) {
for (int i = 0; i < sourceClass.getInterfaces().length; i++) {
Class<?> inter = sourceClass.getInterfaces()[i];
if (inter == targetBaseInterface) {
return sourceClass.getGeneric... | java | private static Type findGenericInterface(Class<?> sourceClass, Class<?> targetBaseInterface) {
for (int i = 0; i < sourceClass.getInterfaces().length; i++) {
Class<?> inter = sourceClass.getInterfaces()[i];
if (inter == targetBaseInterface) {
return sourceClass.getGeneric... | [
"private",
"static",
"Type",
"findGenericInterface",
"(",
"Class",
"<",
"?",
">",
"sourceClass",
",",
"Class",
"<",
"?",
">",
"targetBaseInterface",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sourceClass",
".",
"getInterfaces",
"(",
")",... | Finds generic interface implementation based on the source class and the target interface.
Returns null if not found. Recurses the interface hierarchy. | [
"Finds",
"generic",
"interface",
"implementation",
"based",
"on",
"the",
"source",
"class",
"and",
"the",
"target",
"interface",
".",
"Returns",
"null",
"if",
"not",
"found",
".",
"Recurses",
"the",
"interface",
"hierarchy",
"."
] | c5e2b80af76e3192cae7c9550b70c4d1ab312034 | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/GenericTypeExtractor.java#L60-L73 |
129,801 | mockito/mockito | src/main/java/org/mockito/internal/util/reflection/GenericTypeExtractor.java | GenericTypeExtractor.extractGeneric | private static Class<?> extractGeneric(Type type) {
if (type instanceof ParameterizedType) {
Type[] genericTypes = ((ParameterizedType) type).getActualTypeArguments();
if (genericTypes.length > 0 && genericTypes[0] instanceof Class) {
return (Class<?>) genericTypes[0];
... | java | private static Class<?> extractGeneric(Type type) {
if (type instanceof ParameterizedType) {
Type[] genericTypes = ((ParameterizedType) type).getActualTypeArguments();
if (genericTypes.length > 0 && genericTypes[0] instanceof Class) {
return (Class<?>) genericTypes[0];
... | [
"private",
"static",
"Class",
"<",
"?",
">",
"extractGeneric",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
"Type",
"[",
"]",
"genericTypes",
"=",
"(",
"(",
"ParameterizedType",
")",
"type",
")",
".",
"ge... | Attempts to extract generic parameter type of given type.
If there is no generic parameter it returns Object.class | [
"Attempts",
"to",
"extract",
"generic",
"parameter",
"type",
"of",
"given",
"type",
".",
"If",
"there",
"is",
"no",
"generic",
"parameter",
"it",
"returns",
"Object",
".",
"class"
] | c5e2b80af76e3192cae7c9550b70c4d1ab312034 | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/GenericTypeExtractor.java#L79-L87 |
129,802 | mockito/mockito | src/main/java/org/mockito/internal/util/reflection/Fields.java | Fields.allDeclaredFieldsOf | public static InstanceFields allDeclaredFieldsOf(Object instance) {
List<InstanceField> instanceFields = new ArrayList<InstanceField>();
for (Class<?> clazz = instance.getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) {
instanceFields.addAll(instanceFieldsIn(instance, clazz.g... | java | public static InstanceFields allDeclaredFieldsOf(Object instance) {
List<InstanceField> instanceFields = new ArrayList<InstanceField>();
for (Class<?> clazz = instance.getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) {
instanceFields.addAll(instanceFieldsIn(instance, clazz.g... | [
"public",
"static",
"InstanceFields",
"allDeclaredFieldsOf",
"(",
"Object",
"instance",
")",
"{",
"List",
"<",
"InstanceField",
">",
"instanceFields",
"=",
"new",
"ArrayList",
"<",
"InstanceField",
">",
"(",
")",
";",
"for",
"(",
"Class",
"<",
"?",
">",
"cla... | Instance fields declared in the class and superclasses of the given instance.
@param instance Instance from which declared fields will be retrieved.
@return InstanceFields of this object instance. | [
"Instance",
"fields",
"declared",
"in",
"the",
"class",
"and",
"superclasses",
"of",
"the",
"given",
"instance",
"."
] | c5e2b80af76e3192cae7c9550b70c4d1ab312034 | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/Fields.java#L29-L35 |
129,803 | mockito/mockito | src/main/java/org/mockito/internal/util/reflection/Fields.java | Fields.declaredFieldsOf | public static InstanceFields declaredFieldsOf(Object instance) {
List<InstanceField> instanceFields = new ArrayList<InstanceField>();
instanceFields.addAll(instanceFieldsIn(instance, instance.getClass().getDeclaredFields()));
return new InstanceFields(instance, instanceFields);
} | java | public static InstanceFields declaredFieldsOf(Object instance) {
List<InstanceField> instanceFields = new ArrayList<InstanceField>();
instanceFields.addAll(instanceFieldsIn(instance, instance.getClass().getDeclaredFields()));
return new InstanceFields(instance, instanceFields);
} | [
"public",
"static",
"InstanceFields",
"declaredFieldsOf",
"(",
"Object",
"instance",
")",
"{",
"List",
"<",
"InstanceField",
">",
"instanceFields",
"=",
"new",
"ArrayList",
"<",
"InstanceField",
">",
"(",
")",
";",
"instanceFields",
".",
"addAll",
"(",
"instance... | Instance fields declared in the class of the given instance.
@param instance Instance from which declared fields will be retrieved.
@return InstanceFields of this object instance. | [
"Instance",
"fields",
"declared",
"in",
"the",
"class",
"of",
"the",
"given",
"instance",
"."
] | c5e2b80af76e3192cae7c9550b70c4d1ab312034 | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/Fields.java#L43-L47 |
129,804 | mockito/mockito | src/main/java/org/mockito/internal/util/reflection/Fields.java | Fields.annotatedBy | @SuppressWarnings({"unchecked", "vararg"})
public static Filter<InstanceField> annotatedBy(final Class<? extends Annotation>... annotations) {
return new Filter<InstanceField>() {
public boolean isOut(InstanceField instanceField) {
Checks.checkNotNull(annotations, "Provide at lea... | java | @SuppressWarnings({"unchecked", "vararg"})
public static Filter<InstanceField> annotatedBy(final Class<? extends Annotation>... annotations) {
return new Filter<InstanceField>() {
public boolean isOut(InstanceField instanceField) {
Checks.checkNotNull(annotations, "Provide at lea... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"vararg\"",
"}",
")",
"public",
"static",
"Filter",
"<",
"InstanceField",
">",
"annotatedBy",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"...",
"annotations",
")",
"{",
"return",
... | Accept fields annotated by the given annotations.
@param annotations Annotation types to check.
@return The filter. | [
"Accept",
"fields",
"annotated",
"by",
"the",
"given",
"annotations",
"."
] | c5e2b80af76e3192cae7c9550b70c4d1ab312034 | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/util/reflection/Fields.java#L64-L78 |
129,805 | mockito/mockito | src/main/java/org/mockito/internal/stubbing/defaultanswers/RetrieveGenericsForDefaultAnswers.java | RetrieveGenericsForDefaultAnswers.findTypeFromGeneric | private static Class<?> findTypeFromGeneric(final InvocationOnMock invocation, final TypeVariable returnType) {
// Class level
final MockCreationSettings mockSettings = MockUtil.getMockHandler(invocation.getMock()).getMockSettings();
final GenericMetadataSupport returnTypeSupport = GenericMetada... | java | private static Class<?> findTypeFromGeneric(final InvocationOnMock invocation, final TypeVariable returnType) {
// Class level
final MockCreationSettings mockSettings = MockUtil.getMockHandler(invocation.getMock()).getMockSettings();
final GenericMetadataSupport returnTypeSupport = GenericMetada... | [
"private",
"static",
"Class",
"<",
"?",
">",
"findTypeFromGeneric",
"(",
"final",
"InvocationOnMock",
"invocation",
",",
"final",
"TypeVariable",
"returnType",
")",
"{",
"// Class level",
"final",
"MockCreationSettings",
"mockSettings",
"=",
"MockUtil",
".",
"getMockH... | Retrieve the expected type when it came from a primitive. If the type cannot be retrieve, return null.
@param invocation the current invocation
@param returnType the expected return type
@return the type or null if not found | [
"Retrieve",
"the",
"expected",
"type",
"when",
"it",
"came",
"from",
"a",
"primitive",
".",
"If",
"the",
"type",
"cannot",
"be",
"retrieve",
"return",
"null",
"."
] | c5e2b80af76e3192cae7c9550b70c4d1ab312034 | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/defaultanswers/RetrieveGenericsForDefaultAnswers.java#L90-L103 |
129,806 | mockito/mockito | src/main/java/org/mockito/internal/stubbing/defaultanswers/RetrieveGenericsForDefaultAnswers.java | RetrieveGenericsForDefaultAnswers.findTypeFromGenericInArguments | private static Class<?> findTypeFromGenericInArguments(final InvocationOnMock invocation, final TypeVariable returnType) {
final Type[] parameterTypes = invocation.getMethod().getGenericParameterTypes();
for (int i = 0; i < parameterTypes.length; i++) {
Type argType = parameterTypes[i];
... | java | private static Class<?> findTypeFromGenericInArguments(final InvocationOnMock invocation, final TypeVariable returnType) {
final Type[] parameterTypes = invocation.getMethod().getGenericParameterTypes();
for (int i = 0; i < parameterTypes.length; i++) {
Type argType = parameterTypes[i];
... | [
"private",
"static",
"Class",
"<",
"?",
">",
"findTypeFromGenericInArguments",
"(",
"final",
"InvocationOnMock",
"invocation",
",",
"final",
"TypeVariable",
"returnType",
")",
"{",
"final",
"Type",
"[",
"]",
"parameterTypes",
"=",
"invocation",
".",
"getMethod",
"... | Find a return type using generic arguments provided by the calling method.
@param invocation the current invocation
@param returnType the expected return type
@return the return type or null if the return type cannot be found | [
"Find",
"a",
"return",
"type",
"using",
"generic",
"arguments",
"provided",
"by",
"the",
"calling",
"method",
"."
] | c5e2b80af76e3192cae7c9550b70c4d1ab312034 | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/defaultanswers/RetrieveGenericsForDefaultAnswers.java#L112-L133 |
129,807 | mockito/mockito | src/main/java/org/mockito/internal/configuration/injection/MockInjection.java | MockInjection.onFields | public static OngoingMockInjection onFields(Set<Field> fields, Object ofInstance) {
return new OngoingMockInjection(fields, ofInstance);
} | java | public static OngoingMockInjection onFields(Set<Field> fields, Object ofInstance) {
return new OngoingMockInjection(fields, ofInstance);
} | [
"public",
"static",
"OngoingMockInjection",
"onFields",
"(",
"Set",
"<",
"Field",
">",
"fields",
",",
"Object",
"ofInstance",
")",
"{",
"return",
"new",
"OngoingMockInjection",
"(",
"fields",
",",
"ofInstance",
")",
";",
"}"
] | Create a new configuration setup for fields
@param fields Fields needing mock injection
@param ofInstance Instance owning the <code>field</code>
@return New configuration builder | [
"Create",
"a",
"new",
"configuration",
"setup",
"for",
"fields"
] | c5e2b80af76e3192cae7c9550b70c4d1ab312034 | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/configuration/injection/MockInjection.java#L47-L49 |
129,808 | micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/brave/instrument/http/AbstractBraveTracingFilter.java | AbstractBraveTracingFilter.withSpanInScope | void withSpanInScope(HttpRequest<?> request, Span span) {
request.setAttribute(TraceRequestAttributes.CURRENT_SPAN, span);
Tracer.SpanInScope spanInScope = httpTracing.tracing().tracer().withSpanInScope(span);
request.setAttribute(TraceRequestAttributes.CURRENT_SCOPE, spanInScope);
} | java | void withSpanInScope(HttpRequest<?> request, Span span) {
request.setAttribute(TraceRequestAttributes.CURRENT_SPAN, span);
Tracer.SpanInScope spanInScope = httpTracing.tracing().tracer().withSpanInScope(span);
request.setAttribute(TraceRequestAttributes.CURRENT_SCOPE, spanInScope);
} | [
"void",
"withSpanInScope",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
",",
"Span",
"span",
")",
"{",
"request",
".",
"setAttribute",
"(",
"TraceRequestAttributes",
".",
"CURRENT_SPAN",
",",
"span",
")",
";",
"Tracer",
".",
"SpanInScope",
"spanInScope",
"=",... | Configures the request with the given Span.
@param request The request
@param span The span | [
"Configures",
"the",
"request",
"with",
"the",
"given",
"Span",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/brave/instrument/http/AbstractBraveTracingFilter.java#L53-L57 |
129,809 | micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/brave/instrument/http/AbstractBraveTracingFilter.java | AbstractBraveTracingFilter.afterTerminate | void afterTerminate(HttpRequest<?> request) {
Optional<Tracer.SpanInScope> scope = request.removeAttribute(
TraceRequestAttributes.CURRENT_SCOPE,
Tracer.SpanInScope.class
);
scope.ifPresent(Tracer.SpanInScope::close);
} | java | void afterTerminate(HttpRequest<?> request) {
Optional<Tracer.SpanInScope> scope = request.removeAttribute(
TraceRequestAttributes.CURRENT_SCOPE,
Tracer.SpanInScope.class
);
scope.ifPresent(Tracer.SpanInScope::close);
} | [
"void",
"afterTerminate",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
")",
"{",
"Optional",
"<",
"Tracer",
".",
"SpanInScope",
">",
"scope",
"=",
"request",
".",
"removeAttribute",
"(",
"TraceRequestAttributes",
".",
"CURRENT_SCOPE",
",",
"Tracer",
".",
"Spa... | Closes the scope after terminating the request.
@param request The request | [
"Closes",
"the",
"scope",
"after",
"terminating",
"the",
"request",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/brave/instrument/http/AbstractBraveTracingFilter.java#L64-L70 |
129,810 | micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/brave/instrument/http/AbstractBraveTracingFilter.java | AbstractBraveTracingFilter.configuredSpan | Optional<Span> configuredSpan(HttpRequest<?> request, HttpResponse<?> response) {
Optional<Object> routeTemplate = request.getAttribute(HttpAttributes.URI_TEMPLATE);
routeTemplate.ifPresent(o -> response.setAttribute(HttpAttributes.URI_TEMPLATE, o));
response.setAttribute(HttpAttributes.METHOD_N... | java | Optional<Span> configuredSpan(HttpRequest<?> request, HttpResponse<?> response) {
Optional<Object> routeTemplate = request.getAttribute(HttpAttributes.URI_TEMPLATE);
routeTemplate.ifPresent(o -> response.setAttribute(HttpAttributes.URI_TEMPLATE, o));
response.setAttribute(HttpAttributes.METHOD_N... | [
"Optional",
"<",
"Span",
">",
"configuredSpan",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
",",
"HttpResponse",
"<",
"?",
">",
"response",
")",
"{",
"Optional",
"<",
"Object",
">",
"routeTemplate",
"=",
"request",
".",
"getAttribute",
"(",
"HttpAttributes... | Obtain the value of current span attribute on the HTTP method.
@param request request
@param response response
@return current span attribute | [
"Obtain",
"the",
"value",
"of",
"current",
"span",
"attribute",
"on",
"the",
"HTTP",
"method",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/brave/instrument/http/AbstractBraveTracingFilter.java#L79-L84 |
129,811 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.pushTypeArguments | protected static void pushTypeArguments(GeneratorAdapter generatorAdapter, Map<String, Object> types) {
if (types == null || types.isEmpty()) {
generatorAdapter.visitInsn(ACONST_NULL);
return;
}
int len = types.size();
// Build calls to Argument.create(...)
... | java | protected static void pushTypeArguments(GeneratorAdapter generatorAdapter, Map<String, Object> types) {
if (types == null || types.isEmpty()) {
generatorAdapter.visitInsn(ACONST_NULL);
return;
}
int len = types.size();
// Build calls to Argument.create(...)
... | [
"protected",
"static",
"void",
"pushTypeArguments",
"(",
"GeneratorAdapter",
"generatorAdapter",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"types",
")",
"{",
"if",
"(",
"types",
"==",
"null",
"||",
"types",
".",
"isEmpty",
"(",
")",
")",
"{",
"generat... | Pushes type arguments onto the stack.
@param generatorAdapter The generator adapter
@param types The type references | [
"Pushes",
"type",
"arguments",
"onto",
"the",
"stack",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L107-L135 |
129,812 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.buildArgument | protected static void buildArgument(GeneratorAdapter generatorAdapter, String argumentName, Object objectType) {
// 1st argument: the type
generatorAdapter.push(getTypeReference(objectType));
// 2nd argument: the name
generatorAdapter.push(argumentName);
// Argument.create( .. )... | java | protected static void buildArgument(GeneratorAdapter generatorAdapter, String argumentName, Object objectType) {
// 1st argument: the type
generatorAdapter.push(getTypeReference(objectType));
// 2nd argument: the name
generatorAdapter.push(argumentName);
// Argument.create( .. )... | [
"protected",
"static",
"void",
"buildArgument",
"(",
"GeneratorAdapter",
"generatorAdapter",
",",
"String",
"argumentName",
",",
"Object",
"objectType",
")",
"{",
"// 1st argument: the type",
"generatorAdapter",
".",
"push",
"(",
"getTypeReference",
"(",
"objectType",
"... | Builds an argument instance.
@param generatorAdapter The generator adapter.
@param argumentName The argument name
@param objectType The object type | [
"Builds",
"an",
"argument",
"instance",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L143-L155 |
129,813 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.toParameterTypes | @NotNull
protected Map<String, Object> toParameterTypes(ParameterElement... parameters) {
final LinkedHashMap<String, Object> map = new LinkedHashMap<>(parameters.length);
for (ParameterElement ce : parameters) {
final ClassElement type = ce.getType();
if (type == null) {
... | java | @NotNull
protected Map<String, Object> toParameterTypes(ParameterElement... parameters) {
final LinkedHashMap<String, Object> map = new LinkedHashMap<>(parameters.length);
for (ParameterElement ce : parameters) {
final ClassElement type = ce.getType();
if (type == null) {
... | [
"@",
"NotNull",
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"toParameterTypes",
"(",
"ParameterElement",
"...",
"parameters",
")",
"{",
"final",
"LinkedHashMap",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
"pa... | Converts a parameters to type arguments.
@param parameters The parameters
@return The type arguments | [
"Converts",
"a",
"parameters",
"to",
"type",
"arguments",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L356-L369 |
129,814 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.getTypeReferenceForName | protected static Type getTypeReferenceForName(String className, String... genericTypes) {
String referenceString = getTypeDescriptor(className, genericTypes);
return Type.getType(referenceString);
} | java | protected static Type getTypeReferenceForName(String className, String... genericTypes) {
String referenceString = getTypeDescriptor(className, genericTypes);
return Type.getType(referenceString);
} | [
"protected",
"static",
"Type",
"getTypeReferenceForName",
"(",
"String",
"className",
",",
"String",
"...",
"genericTypes",
")",
"{",
"String",
"referenceString",
"=",
"getTypeDescriptor",
"(",
"className",
",",
"genericTypes",
")",
";",
"return",
"Type",
".",
"ge... | Returns the Type reference corresponding to the given class.
@param className The class name
@param genericTypes The generic types
@return The {@link Type} | [
"Returns",
"the",
"Type",
"reference",
"corresponding",
"to",
"the",
"given",
"class",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L404-L407 |
129,815 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.getTypeReference | protected static Type getTypeReference(Object type) {
if (type instanceof Type) {
return (Type) type;
} else if (type instanceof Class) {
return Type.getType((Class) type);
} else if (type instanceof String) {
String className = type.toString();
S... | java | protected static Type getTypeReference(Object type) {
if (type instanceof Type) {
return (Type) type;
} else if (type instanceof Class) {
return Type.getType((Class) type);
} else if (type instanceof String) {
String className = type.toString();
S... | [
"protected",
"static",
"Type",
"getTypeReference",
"(",
"Object",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Type",
")",
"{",
"return",
"(",
"Type",
")",
"type",
";",
"}",
"else",
"if",
"(",
"type",
"instanceof",
"Class",
")",
"{",
"return",
"... | Return the type reference for a class.
@param type The type
@return The {@link Type} | [
"Return",
"the",
"type",
"reference",
"for",
"a",
"class",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L415-L431 |
129,816 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.writeClassToDisk | protected void writeClassToDisk(File targetDir, ClassWriter classWriter, String className) throws IOException {
if (targetDir != null) {
String fileName = className.replace('.', '/') + ".class";
File targetFile = new File(targetDir, fileName);
targetFile.getParentFile().mkdi... | java | protected void writeClassToDisk(File targetDir, ClassWriter classWriter, String className) throws IOException {
if (targetDir != null) {
String fileName = className.replace('.', '/') + ".class";
File targetFile = new File(targetDir, fileName);
targetFile.getParentFile().mkdi... | [
"protected",
"void",
"writeClassToDisk",
"(",
"File",
"targetDir",
",",
"ClassWriter",
"classWriter",
",",
"String",
"className",
")",
"throws",
"IOException",
"{",
"if",
"(",
"targetDir",
"!=",
"null",
")",
"{",
"String",
"fileName",
"=",
"className",
".",
"r... | Writes the class file to disk in the given directory.
@param targetDir The target directory
@param classWriter The current class writer
@param className The class name
@throws IOException if there is a problem writing the class to disk | [
"Writes",
"the",
"class",
"file",
"to",
"disk",
"in",
"the",
"given",
"directory",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L834-L845 |
129,817 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.generateServiceDescriptor | protected void generateServiceDescriptor(String className, GeneratedFile generatedFile) throws IOException {
CharSequence contents = generatedFile.getTextContent();
if (contents != null) {
String[] entries = contents.toString().split("\\n");
if (!Arrays.asList(entries).contains(c... | java | protected void generateServiceDescriptor(String className, GeneratedFile generatedFile) throws IOException {
CharSequence contents = generatedFile.getTextContent();
if (contents != null) {
String[] entries = contents.toString().split("\\n");
if (!Arrays.asList(entries).contains(c... | [
"protected",
"void",
"generateServiceDescriptor",
"(",
"String",
"className",
",",
"GeneratedFile",
"generatedFile",
")",
"throws",
"IOException",
"{",
"CharSequence",
"contents",
"=",
"generatedFile",
".",
"getTextContent",
"(",
")",
";",
"if",
"(",
"contents",
"!=... | Generates a service discovery for the given class name and file.
@param className The class name
@param generatedFile The generated file
@throws IOException An exception if an error occurs | [
"Generates",
"a",
"service",
"discovery",
"for",
"the",
"given",
"class",
"name",
"and",
"file",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L1086-L1101 |
129,818 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.pushNewInstance | protected void pushNewInstance(GeneratorAdapter generatorAdapter, Type typeToInstantiate) {
generatorAdapter.newInstance(typeToInstantiate);
generatorAdapter.dup();
generatorAdapter.invokeConstructor(typeToInstantiate, METHOD_DEFAULT_CONSTRUCTOR);
} | java | protected void pushNewInstance(GeneratorAdapter generatorAdapter, Type typeToInstantiate) {
generatorAdapter.newInstance(typeToInstantiate);
generatorAdapter.dup();
generatorAdapter.invokeConstructor(typeToInstantiate, METHOD_DEFAULT_CONSTRUCTOR);
} | [
"protected",
"void",
"pushNewInstance",
"(",
"GeneratorAdapter",
"generatorAdapter",
",",
"Type",
"typeToInstantiate",
")",
"{",
"generatorAdapter",
".",
"newInstance",
"(",
"typeToInstantiate",
")",
";",
"generatorAdapter",
".",
"dup",
"(",
")",
";",
"generatorAdapte... | Push the instantiation of the given type.
@param generatorAdapter The generator adaptor
@param typeToInstantiate The type to instantiate. | [
"Push",
"the",
"instantiation",
"of",
"the",
"given",
"type",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L1108-L1112 |
129,819 | micronaut-projects/micronaut-core | aop/src/main/java/io/micronaut/aop/writer/AopProxyWriter.java | AopProxyWriter.accept | @Override
public void accept(ClassWriterOutputVisitor visitor) throws IOException {
proxyBeanDefinitionWriter.accept(visitor);
try (OutputStream out = visitor.visitClass(proxyFullName)) {
out.write(classWriter.toByteArray());
for (ExecutableMethodWriter method : proxiedMethod... | java | @Override
public void accept(ClassWriterOutputVisitor visitor) throws IOException {
proxyBeanDefinitionWriter.accept(visitor);
try (OutputStream out = visitor.visitClass(proxyFullName)) {
out.write(classWriter.toByteArray());
for (ExecutableMethodWriter method : proxiedMethod... | [
"@",
"Override",
"public",
"void",
"accept",
"(",
"ClassWriterOutputVisitor",
"visitor",
")",
"throws",
"IOException",
"{",
"proxyBeanDefinitionWriter",
".",
"accept",
"(",
"visitor",
")",
";",
"try",
"(",
"OutputStream",
"out",
"=",
"visitor",
".",
"visitClass",
... | Write the class to output via a visitor that manages output destination.
@param visitor the writer output visitor
@throws IOException If an error occurs | [
"Write",
"the",
"class",
"to",
"output",
"via",
"a",
"visitor",
"that",
"manages",
"output",
"destination",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/aop/src/main/java/io/micronaut/aop/writer/AopProxyWriter.java#L893-L902 |
129,820 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java | AbstractAnnotationMetadataBuilder.buildDeclared | public AnnotationMetadata buildDeclared(T element) {
final AnnotationMetadata existing = MUTATED_ANNOTATION_METADATA.get(element);
if (existing != null) {
return existing;
} else {
DefaultAnnotationMetadata annotationMetadata = new DefaultAnnotationMetadata();
... | java | public AnnotationMetadata buildDeclared(T element) {
final AnnotationMetadata existing = MUTATED_ANNOTATION_METADATA.get(element);
if (existing != null) {
return existing;
} else {
DefaultAnnotationMetadata annotationMetadata = new DefaultAnnotationMetadata();
... | [
"public",
"AnnotationMetadata",
"buildDeclared",
"(",
"T",
"element",
")",
"{",
"final",
"AnnotationMetadata",
"existing",
"=",
"MUTATED_ANNOTATION_METADATA",
".",
"get",
"(",
"element",
")",
";",
"if",
"(",
"existing",
"!=",
"null",
")",
"{",
"return",
"existin... | Build only metadata for declared annotations.
@param element The element
@return The {@link AnnotationMetadata} | [
"Build",
"only",
"metadata",
"for",
"declared",
"annotations",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java#L86-L109 |
129,821 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java | AbstractAnnotationMetadataBuilder.validateAnnotationValue | protected void validateAnnotationValue(T originatingElement, String annotationName, T member, String memberName, Object resolvedValue) {
final AnnotatedElementValidator elementValidator = getElementValidator();
if (elementValidator != null && !erroneousElements.contains(member)) {
final bool... | java | protected void validateAnnotationValue(T originatingElement, String annotationName, T member, String memberName, Object resolvedValue) {
final AnnotatedElementValidator elementValidator = getElementValidator();
if (elementValidator != null && !erroneousElements.contains(member)) {
final bool... | [
"protected",
"void",
"validateAnnotationValue",
"(",
"T",
"originatingElement",
",",
"String",
"annotationName",
",",
"T",
"member",
",",
"String",
"memberName",
",",
"Object",
"resolvedValue",
")",
"{",
"final",
"AnnotatedElementValidator",
"elementValidator",
"=",
"... | Validates an annotation value.
@param originatingElement The originating element
@param annotationName The annotation name
@param member The member
@param memberName The member name
@param resolvedValue The resolved value | [
"Validates",
"an",
"annotation",
"value",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java#L266-L297 |
129,822 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java | AbstractAnnotationMetadataBuilder.addMutatedMetadata | @Internal
public static void addMutatedMetadata(Object element, AnnotationMetadata metadata) {
if (element != null && metadata != null) {
MUTATED_ANNOTATION_METADATA.put(element, metadata);
}
} | java | @Internal
public static void addMutatedMetadata(Object element, AnnotationMetadata metadata) {
if (element != null && metadata != null) {
MUTATED_ANNOTATION_METADATA.put(element, metadata);
}
} | [
"@",
"Internal",
"public",
"static",
"void",
"addMutatedMetadata",
"(",
"Object",
"element",
",",
"AnnotationMetadata",
"metadata",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
"&&",
"metadata",
"!=",
"null",
")",
"{",
"MUTATED_ANNOTATION_METADATA",
".",
"put",... | Used to store metadata mutations at compilation time. Not for public consumption.
@param element The element
@param metadata The metadata | [
"Used",
"to",
"store",
"metadata",
"mutations",
"at",
"compilation",
"time",
".",
"Not",
"for",
"public",
"consumption",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java#L804-L809 |
129,823 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java | AbstractAnnotationMetadataBuilder.annotate | public <A2 extends Annotation> AnnotationMetadata annotate(
AnnotationMetadata annotationMetadata,
AnnotationValue<A2> annotationValue) {
if (annotationMetadata instanceof DefaultAnnotationMetadata) {
final Optional<T> annotationMirror = getAnnotationMirror(annotationValue.ge... | java | public <A2 extends Annotation> AnnotationMetadata annotate(
AnnotationMetadata annotationMetadata,
AnnotationValue<A2> annotationValue) {
if (annotationMetadata instanceof DefaultAnnotationMetadata) {
final Optional<T> annotationMirror = getAnnotationMirror(annotationValue.ge... | [
"public",
"<",
"A2",
"extends",
"Annotation",
">",
"AnnotationMetadata",
"annotate",
"(",
"AnnotationMetadata",
"annotationMetadata",
",",
"AnnotationValue",
"<",
"A2",
">",
"annotationValue",
")",
"{",
"if",
"(",
"annotationMetadata",
"instanceof",
"DefaultAnnotationMe... | Annotate an existing annotation metadata object.
@param annotationMetadata The annotation metadata
@param annotationValue The annotation value
@param <A2> The annotation type
@return The mutated metadata | [
"Annotate",
"an",
"existing",
"annotation",
"metadata",
"object",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java#L838-L858 |
129,824 | micronaut-projects/micronaut-core | session/src/main/java/io/micronaut/session/http/SessionForRequest.java | SessionForRequest.create | public static Session create(SessionStore sessionStore, HttpRequest<?> request) {
Session session = sessionStore.newSession();
request.getAttributes().put(HttpSessionFilter.SESSION_ATTRIBUTE, session);
return session;
} | java | public static Session create(SessionStore sessionStore, HttpRequest<?> request) {
Session session = sessionStore.newSession();
request.getAttributes().put(HttpSessionFilter.SESSION_ATTRIBUTE, session);
return session;
} | [
"public",
"static",
"Session",
"create",
"(",
"SessionStore",
"sessionStore",
",",
"HttpRequest",
"<",
"?",
">",
"request",
")",
"{",
"Session",
"session",
"=",
"sessionStore",
".",
"newSession",
"(",
")",
";",
"request",
".",
"getAttributes",
"(",
")",
".",... | Creates a session and stores it in the request attributes.
@param sessionStore the session store
@param request the Http Request
@return A new session stored in the request attributes | [
"Creates",
"a",
"session",
"and",
"stores",
"it",
"in",
"the",
"request",
"attributes",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/session/src/main/java/io/micronaut/session/http/SessionForRequest.java#L38-L42 |
129,825 | micronaut-projects/micronaut-core | session/src/main/java/io/micronaut/session/http/SessionForRequest.java | SessionForRequest.find | public static Optional<Session> find(HttpRequest<?> request) {
return request.getAttributes().get(HttpSessionFilter.SESSION_ATTRIBUTE, Session.class);
} | java | public static Optional<Session> find(HttpRequest<?> request) {
return request.getAttributes().get(HttpSessionFilter.SESSION_ATTRIBUTE, Session.class);
} | [
"public",
"static",
"Optional",
"<",
"Session",
">",
"find",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
")",
"{",
"return",
"request",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"HttpSessionFilter",
".",
"SESSION_ATTRIBUTE",
",",
"Session",
".",
"... | Finds a session.
@param request the Http Request
@return A session if found in the request attributes. | [
"Finds",
"a",
"session",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/session/src/main/java/io/micronaut/session/http/SessionForRequest.java#L50-L52 |
129,826 | micronaut-projects/micronaut-core | session/src/main/java/io/micronaut/session/http/SessionForRequest.java | SessionForRequest.findOrCreate | public static Session findOrCreate(HttpRequest<?> request, SessionStore sessionStore) {
return find(request).orElseGet(() -> create(sessionStore, request));
} | java | public static Session findOrCreate(HttpRequest<?> request, SessionStore sessionStore) {
return find(request).orElseGet(() -> create(sessionStore, request));
} | [
"public",
"static",
"Session",
"findOrCreate",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
",",
"SessionStore",
"sessionStore",
")",
"{",
"return",
"find",
"(",
"request",
")",
".",
"orElseGet",
"(",
"(",
")",
"->",
"create",
"(",
"sessionStore",
",",
"r... | Finds a session or creates a new one and stores it in the request attributes.
@param request The Http Request
@param sessionStore The session store to create the session if not found
@return A session if found in the request attributes or a new session
stored in the request attributes. | [
"Finds",
"a",
"session",
"or",
"creates",
"a",
"new",
"one",
"and",
"stores",
"it",
"in",
"the",
"request",
"attributes",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/session/src/main/java/io/micronaut/session/http/SessionForRequest.java#L62-L64 |
129,827 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/BeanDefinitionReferenceWriter.java | BeanDefinitionReferenceWriter.getBeanDefinitionQualifiedClassName | public String getBeanDefinitionQualifiedClassName() {
String newClassName = beanDefinitionName;
if (newClassName.endsWith("[]")) {
newClassName = newClassName.substring(0, newClassName.length() - 2);
}
return newClassName + REF_SUFFIX;
} | java | public String getBeanDefinitionQualifiedClassName() {
String newClassName = beanDefinitionName;
if (newClassName.endsWith("[]")) {
newClassName = newClassName.substring(0, newClassName.length() - 2);
}
return newClassName + REF_SUFFIX;
} | [
"public",
"String",
"getBeanDefinitionQualifiedClassName",
"(",
")",
"{",
"String",
"newClassName",
"=",
"beanDefinitionName",
";",
"if",
"(",
"newClassName",
".",
"endsWith",
"(",
"\"[]\"",
")",
")",
"{",
"newClassName",
"=",
"newClassName",
".",
"substring",
"("... | Obtains the class name of the bean definition to be written. Java Annotation Processors need
this information to create a JavaFileObject using a Filer.
@return the class name of the bean definition to be written | [
"Obtains",
"the",
"class",
"name",
"of",
"the",
"bean",
"definition",
"to",
"be",
"written",
".",
"Java",
"Annotation",
"Processors",
"need",
"this",
"information",
"to",
"create",
"a",
"JavaFileObject",
"using",
"a",
"Filer",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/BeanDefinitionReferenceWriter.java#L110-L116 |
129,828 | micronaut-projects/micronaut-core | jdbc/src/main/java/io/micronaut/jdbc/JdbcDatabaseManager.java | JdbcDatabaseManager.get | public static Optional<EmbeddedJdbcDatabase> get(ClassLoader classLoader) {
return databases
.stream()
.filter(JdbcDatabase::isEmbedded)
.map(EmbeddedJdbcDatabase.class::cast)
.filter(embeddedDatabase -> ClassUtils.isPresent(embeddedDatabase.getDriverClassName(), ... | java | public static Optional<EmbeddedJdbcDatabase> get(ClassLoader classLoader) {
return databases
.stream()
.filter(JdbcDatabase::isEmbedded)
.map(EmbeddedJdbcDatabase.class::cast)
.filter(embeddedDatabase -> ClassUtils.isPresent(embeddedDatabase.getDriverClassName(), ... | [
"public",
"static",
"Optional",
"<",
"EmbeddedJdbcDatabase",
">",
"get",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"databases",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"JdbcDatabase",
"::",
"isEmbedded",
")",
".",
"map",
"(",
"EmbeddedJdbcDat... | Searches the provided classloader for an embedded database driver.
@param classLoader The classloader to search
@return An optional {@link EmbeddedJdbcDatabase} | [
"Searches",
"the",
"provided",
"classloader",
"for",
"an",
"embedded",
"database",
"driver",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/jdbc/src/main/java/io/micronaut/jdbc/JdbcDatabaseManager.java#L86-L93 |
129,829 | micronaut-projects/micronaut-core | jdbc/src/main/java/io/micronaut/jdbc/JdbcDatabaseManager.java | JdbcDatabaseManager.isEmbedded | public static boolean isEmbedded(String driverClassName) {
return databases
.stream()
.filter(JdbcDatabase::isEmbedded)
.anyMatch(db -> db.driverClassName.equals(driverClassName));
} | java | public static boolean isEmbedded(String driverClassName) {
return databases
.stream()
.filter(JdbcDatabase::isEmbedded)
.anyMatch(db -> db.driverClassName.equals(driverClassName));
} | [
"public",
"static",
"boolean",
"isEmbedded",
"(",
"String",
"driverClassName",
")",
"{",
"return",
"databases",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"JdbcDatabase",
"::",
"isEmbedded",
")",
".",
"anyMatch",
"(",
"db",
"->",
"db",
".",
"driverClassNam... | Searches embedded databases where the driver matches the argument.
@param driverClassName The driver class name to search on
@return True if the driver matches an embedded database type | [
"Searches",
"embedded",
"databases",
"where",
"the",
"driver",
"matches",
"the",
"argument",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/jdbc/src/main/java/io/micronaut/jdbc/JdbcDatabaseManager.java#L101-L106 |
129,830 | micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/brave/log/Slf4jCurrentTraceContextFactory.java | Slf4jCurrentTraceContextFactory.currentTraceContext | @Requires(classes = {MDC.class, CurrentTraceContext.class})
@Context
CurrentTraceContext currentTraceContext() {
return ThreadLocalCurrentTraceContext.newBuilder().addScopeDecorator(new Slf4jScopeDecorator()).build();
} | java | @Requires(classes = {MDC.class, CurrentTraceContext.class})
@Context
CurrentTraceContext currentTraceContext() {
return ThreadLocalCurrentTraceContext.newBuilder().addScopeDecorator(new Slf4jScopeDecorator()).build();
} | [
"@",
"Requires",
"(",
"classes",
"=",
"{",
"MDC",
".",
"class",
",",
"CurrentTraceContext",
".",
"class",
"}",
")",
"@",
"Context",
"CurrentTraceContext",
"currentTraceContext",
"(",
")",
"{",
"return",
"ThreadLocalCurrentTraceContext",
".",
"newBuilder",
"(",
"... | Current Slf4j trace context.
@return Slf4j trace context | [
"Current",
"Slf4j",
"trace",
"context",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/brave/log/Slf4jCurrentTraceContextFactory.java#L40-L44 |
129,831 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java | RxInstrumentedWrappers.wrap | static <T> Subscriber<T> wrap(
Subscriber<T> downstream, List<RunnableInstrumenter> instrumentations) {
if (downstream instanceof FlowableSubscriber) {
return new RxInstrumentedFlowableSubscriber<>(downstream, instrumentations);
}
return new RxInstrumentedSubscriber<>(dow... | java | static <T> Subscriber<T> wrap(
Subscriber<T> downstream, List<RunnableInstrumenter> instrumentations) {
if (downstream instanceof FlowableSubscriber) {
return new RxInstrumentedFlowableSubscriber<>(downstream, instrumentations);
}
return new RxInstrumentedSubscriber<>(dow... | [
"static",
"<",
"T",
">",
"Subscriber",
"<",
"T",
">",
"wrap",
"(",
"Subscriber",
"<",
"T",
">",
"downstream",
",",
"List",
"<",
"RunnableInstrumenter",
">",
"instrumentations",
")",
"{",
"if",
"(",
"downstream",
"instanceof",
"FlowableSubscriber",
")",
"{",
... | Wrap a subscriber.
@param downstream The downstream subscriber
@param instrumentations The instrumentations
@param <T> The type
@return The wrapped subscriber | [
"Wrap",
"a",
"subscriber",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java#L49-L55 |
129,832 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java | RxInstrumentedWrappers.wrap | static Completable wrap(
CompletableSource source, Collection<ReactiveInstrumenter> instrumentations) {
if (source instanceof Callable) {
return new RxInstrumentedCallableCompletable<>(source, instrumentations);
}
return new RxInstrumentedCompletable(source, instrumentati... | java | static Completable wrap(
CompletableSource source, Collection<ReactiveInstrumenter> instrumentations) {
if (source instanceof Callable) {
return new RxInstrumentedCallableCompletable<>(source, instrumentations);
}
return new RxInstrumentedCompletable(source, instrumentati... | [
"static",
"Completable",
"wrap",
"(",
"CompletableSource",
"source",
",",
"Collection",
"<",
"ReactiveInstrumenter",
">",
"instrumentations",
")",
"{",
"if",
"(",
"source",
"instanceof",
"Callable",
")",
"{",
"return",
"new",
"RxInstrumentedCallableCompletable",
"<>",... | Wrap a completable source.
@param source The source
@param instrumentations The instrumentations
@return The wrapped subscriber | [
"Wrap",
"a",
"completable",
"source",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java#L63-L69 |
129,833 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java | RxInstrumentedWrappers.wrap | static <T> Maybe<T> wrap(
MaybeSource<T> source, Collection<ReactiveInstrumenter> instrumentations) {
if (source instanceof Callable) {
return new RxInstrumentedCallableMaybe<>(source, instrumentations);
}
return new RxInstrumentedMaybe<>(source, instrumentations);
} | java | static <T> Maybe<T> wrap(
MaybeSource<T> source, Collection<ReactiveInstrumenter> instrumentations) {
if (source instanceof Callable) {
return new RxInstrumentedCallableMaybe<>(source, instrumentations);
}
return new RxInstrumentedMaybe<>(source, instrumentations);
} | [
"static",
"<",
"T",
">",
"Maybe",
"<",
"T",
">",
"wrap",
"(",
"MaybeSource",
"<",
"T",
">",
"source",
",",
"Collection",
"<",
"ReactiveInstrumenter",
">",
"instrumentations",
")",
"{",
"if",
"(",
"source",
"instanceof",
"Callable",
")",
"{",
"return",
"n... | Wrap a maybe.
@param source The source
@param instrumentations The instrumentations
@param <T> The type
@return The wrapped subscriber | [
"Wrap",
"a",
"maybe",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java#L78-L84 |
129,834 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java | RxInstrumentedWrappers.wrap | static <T> Single<T> wrap(
SingleSource<T> source, Collection<ReactiveInstrumenter> instrumentations) {
if (source instanceof Callable) {
return new RxInstrumentedCallableSingle<>(source, instrumentations);
}
return new RxInstrumentedSingle<>(source, instrumentations);
... | java | static <T> Single<T> wrap(
SingleSource<T> source, Collection<ReactiveInstrumenter> instrumentations) {
if (source instanceof Callable) {
return new RxInstrumentedCallableSingle<>(source, instrumentations);
}
return new RxInstrumentedSingle<>(source, instrumentations);
... | [
"static",
"<",
"T",
">",
"Single",
"<",
"T",
">",
"wrap",
"(",
"SingleSource",
"<",
"T",
">",
"source",
",",
"Collection",
"<",
"ReactiveInstrumenter",
">",
"instrumentations",
")",
"{",
"if",
"(",
"source",
"instanceof",
"Callable",
")",
"{",
"return",
... | Wrap a single.
@param source The source
@param instrumentations The instrumentations
@param <T> The type
@return The wrapped subscriber | [
"Wrap",
"a",
"single",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java#L93-L99 |
129,835 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java | RxInstrumentedWrappers.wrap | static <T> Observable<T> wrap(
ObservableSource<T> source, Collection<ReactiveInstrumenter> instrumentations) {
if (source instanceof Callable) {
return new RxInstrumentedCallableObservable<>(source, instrumentations);
}
return new RxInstrumentedObservable<>(source, instr... | java | static <T> Observable<T> wrap(
ObservableSource<T> source, Collection<ReactiveInstrumenter> instrumentations) {
if (source instanceof Callable) {
return new RxInstrumentedCallableObservable<>(source, instrumentations);
}
return new RxInstrumentedObservable<>(source, instr... | [
"static",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"wrap",
"(",
"ObservableSource",
"<",
"T",
">",
"source",
",",
"Collection",
"<",
"ReactiveInstrumenter",
">",
"instrumentations",
")",
"{",
"if",
"(",
"source",
"instanceof",
"Callable",
")",
"{",
"ret... | Wrap a observable.
@param source The source
@param instrumentations The instrumentations
@param <T> The type
@return The wrapped subscriber | [
"Wrap",
"a",
"observable",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java#L108-L114 |
129,836 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java | RxInstrumentedWrappers.wrap | static <T> ConnectableObservable<T> wrap(
ConnectableObservable<T> source, Collection<ReactiveInstrumenter> instrumentations) {
return new RxInstrumentedConnectableObservable<>(source, instrumentations);
} | java | static <T> ConnectableObservable<T> wrap(
ConnectableObservable<T> source, Collection<ReactiveInstrumenter> instrumentations) {
return new RxInstrumentedConnectableObservable<>(source, instrumentations);
} | [
"static",
"<",
"T",
">",
"ConnectableObservable",
"<",
"T",
">",
"wrap",
"(",
"ConnectableObservable",
"<",
"T",
">",
"source",
",",
"Collection",
"<",
"ReactiveInstrumenter",
">",
"instrumentations",
")",
"{",
"return",
"new",
"RxInstrumentedConnectableObservable",... | Wrap a connectable observable.
@param source The source
@param instrumentations The instrumentations
@param <T> The type
@return The wrapped subscriber | [
"Wrap",
"a",
"connectable",
"observable",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java#L123-L126 |
129,837 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java | RxInstrumentedWrappers.wrap | static <T> ParallelFlowable<T> wrap(
ParallelFlowable<T> source, Collection<ReactiveInstrumenter> instrumentations) {
return new RxInstrumentedParallelFlowable<>(source, instrumentations);
} | java | static <T> ParallelFlowable<T> wrap(
ParallelFlowable<T> source, Collection<ReactiveInstrumenter> instrumentations) {
return new RxInstrumentedParallelFlowable<>(source, instrumentations);
} | [
"static",
"<",
"T",
">",
"ParallelFlowable",
"<",
"T",
">",
"wrap",
"(",
"ParallelFlowable",
"<",
"T",
">",
"source",
",",
"Collection",
"<",
"ReactiveInstrumenter",
">",
"instrumentations",
")",
"{",
"return",
"new",
"RxInstrumentedParallelFlowable",
"<>",
"(",... | Wrap a parallel flowable.
@param source The source
@param instrumentations The instrumentations
@param <T> The type
@return The wrapped subscriber | [
"Wrap",
"a",
"parallel",
"flowable",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java#L164-L167 |
129,838 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/retry/intercept/CircuitBreakerRetry.java | CircuitBreakerRetry.openCircuit | private CircuitState openCircuit(Throwable cause) {
if (cause == null) {
throw new IllegalArgumentException("Exception cause cannot be null");
}
if (LOG.isDebugEnabled()) {
LOG.debug("Opening Circuit Breaker [{}] due to error: {}", method, cause.getMessage());
}
... | java | private CircuitState openCircuit(Throwable cause) {
if (cause == null) {
throw new IllegalArgumentException("Exception cause cannot be null");
}
if (LOG.isDebugEnabled()) {
LOG.debug("Opening Circuit Breaker [{}] due to error: {}", method, cause.getMessage());
}
... | [
"private",
"CircuitState",
"openCircuit",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"cause",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Exception cause cannot be null\"",
")",
";",
"}",
"if",
"(",
"LOG",
".",
"isDebugEnable... | Opens the circuit.
@return The current state | [
"Opens",
"the",
"circuit",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/retry/intercept/CircuitBreakerRetry.java#L172-L195 |
129,839 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java | SocketUtils.findAvailableTcpPort | public static int findAvailableTcpPort(int minPortRange, int maxPortRange) {
ArgumentUtils.check(() -> minPortRange > MIN_PORT_RANGE)
.orElseFail("Port minimum value must be greater than " + MIN_PORT_RANGE);
ArgumentUtils.check(() -> maxPortRange >= minPortRange)
.orElseFail("Max... | java | public static int findAvailableTcpPort(int minPortRange, int maxPortRange) {
ArgumentUtils.check(() -> minPortRange > MIN_PORT_RANGE)
.orElseFail("Port minimum value must be greater than " + MIN_PORT_RANGE);
ArgumentUtils.check(() -> maxPortRange >= minPortRange)
.orElseFail("Max... | [
"public",
"static",
"int",
"findAvailableTcpPort",
"(",
"int",
"minPortRange",
",",
"int",
"maxPortRange",
")",
"{",
"ArgumentUtils",
".",
"check",
"(",
"(",
")",
"->",
"minPortRange",
">",
"MIN_PORT_RANGE",
")",
".",
"orElseFail",
"(",
"\"Port minimum value must ... | Finds an available TCP port.
@param minPortRange The minimum port range
@param maxPortRange The maximum port range
@return The available port | [
"Finds",
"an",
"available",
"TCP",
"port",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java#L67-L80 |
129,840 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java | SocketUtils.isTcpPortAvailable | public static boolean isTcpPortAvailable(int currentPort) {
try {
Socket socket = SocketFactory.getDefault().createSocket(InetAddress.getLocalHost(), currentPort);
socket.close();
return false;
} catch (Throwable e) {
return true;
}
} | java | public static boolean isTcpPortAvailable(int currentPort) {
try {
Socket socket = SocketFactory.getDefault().createSocket(InetAddress.getLocalHost(), currentPort);
socket.close();
return false;
} catch (Throwable e) {
return true;
}
} | [
"public",
"static",
"boolean",
"isTcpPortAvailable",
"(",
"int",
"currentPort",
")",
"{",
"try",
"{",
"Socket",
"socket",
"=",
"SocketFactory",
".",
"getDefault",
"(",
")",
".",
"createSocket",
"(",
"InetAddress",
".",
"getLocalHost",
"(",
")",
",",
"currentPo... | Check whether the given TCP port is available.
@param currentPort The port
@return True if it is | [
"Check",
"whether",
"the",
"given",
"TCP",
"port",
"is",
"available",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/io/socket/SocketUtils.java#L88-L96 |
129,841 | micronaut-projects/micronaut-core | function/src/main/java/io/micronaut/function/executor/AbstractExecutor.java | AbstractExecutor.resolveFunctionName | protected String resolveFunctionName(Environment env) {
return env.getProperty(LocalFunctionRegistry.FUNCTION_NAME, String.class, (String) null);
} | java | protected String resolveFunctionName(Environment env) {
return env.getProperty(LocalFunctionRegistry.FUNCTION_NAME, String.class, (String) null);
} | [
"protected",
"String",
"resolveFunctionName",
"(",
"Environment",
"env",
")",
"{",
"return",
"env",
".",
"getProperty",
"(",
"LocalFunctionRegistry",
".",
"FUNCTION_NAME",
",",
"String",
".",
"class",
",",
"(",
"String",
")",
"null",
")",
";",
"}"
] | Resolves the function name to execution for the environment.
@param env The environment
@return The function name | [
"Resolves",
"the",
"function",
"name",
"to",
"execution",
"for",
"the",
"environment",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function/src/main/java/io/micronaut/function/executor/AbstractExecutor.java#L69-L71 |
129,842 | micronaut-projects/micronaut-core | function/src/main/java/io/micronaut/function/executor/AbstractExecutor.java | AbstractExecutor.startEnvironment | protected Environment startEnvironment(ApplicationContext applicationContext) {
if (!applicationContext.isRunning()) {
if (this instanceof PropertySource) {
applicationContext.getEnvironment().addPropertySource((PropertySource) this);
}
return applicationCont... | java | protected Environment startEnvironment(ApplicationContext applicationContext) {
if (!applicationContext.isRunning()) {
if (this instanceof PropertySource) {
applicationContext.getEnvironment().addPropertySource((PropertySource) this);
}
return applicationCont... | [
"protected",
"Environment",
"startEnvironment",
"(",
"ApplicationContext",
"applicationContext",
")",
"{",
"if",
"(",
"!",
"applicationContext",
".",
"isRunning",
"(",
")",
")",
"{",
"if",
"(",
"this",
"instanceof",
"PropertySource",
")",
"{",
"applicationContext",
... | Start the environment specified.
@param applicationContext the application context with the environment
@return The environment within the context | [
"Start",
"the",
"environment",
"specified",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function/src/main/java/io/micronaut/function/executor/AbstractExecutor.java#L113-L125 |
129,843 | micronaut-projects/micronaut-core | function/src/main/java/io/micronaut/function/executor/StreamFunctionExecutor.java | StreamFunctionExecutor.execute | public void execute(InputStream input, OutputStream output) throws IOException {
execute(input, output, null);
} | java | public void execute(InputStream input, OutputStream output) throws IOException {
execute(input, output, null);
} | [
"public",
"void",
"execute",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"execute",
"(",
"input",
",",
"output",
",",
"null",
")",
";",
"}"
] | Execute the function for the given input and output.
@param input The input
@param output The output
@throws IOException If an I/O exception occurs | [
"Execute",
"the",
"function",
"for",
"the",
"given",
"input",
"and",
"output",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function/src/main/java/io/micronaut/function/executor/StreamFunctionExecutor.java#L63-L65 |
129,844 | micronaut-projects/micronaut-core | function/src/main/java/io/micronaut/function/executor/StreamFunctionExecutor.java | StreamFunctionExecutor.execute | protected void execute(InputStream input, OutputStream output, C context) throws IOException {
final ApplicationContext applicationContext = buildApplicationContext(context);
if (context == null) {
context = (C) applicationContext;
}
final Environment env = startEnvironment(... | java | protected void execute(InputStream input, OutputStream output, C context) throws IOException {
final ApplicationContext applicationContext = buildApplicationContext(context);
if (context == null) {
context = (C) applicationContext;
}
final Environment env = startEnvironment(... | [
"protected",
"void",
"execute",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
",",
"C",
"context",
")",
"throws",
"IOException",
"{",
"final",
"ApplicationContext",
"applicationContext",
"=",
"buildApplicationContext",
"(",
"context",
")",
";",
"if",
... | Execute the function with given context object.
@param input The {@link InputStream}
@param output THe {@link OutputStream}
@param context The context object
@throws IOException If an error occurs | [
"Execute",
"the",
"function",
"with",
"given",
"context",
"object",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function/src/main/java/io/micronaut/function/executor/StreamFunctionExecutor.java#L75-L139 |
129,845 | micronaut-projects/micronaut-core | function/src/main/java/io/micronaut/function/executor/StreamFunctionExecutor.java | StreamFunctionExecutor.encode | static void encode(Environment environment, LocalFunctionRegistry registry, Class returnType, Object result, OutputStream output) throws IOException {
if (ClassUtils.isJavaLangType(returnType)) {
if (result instanceof Byte) {
output.write((Byte) result);
} else if (result... | java | static void encode(Environment environment, LocalFunctionRegistry registry, Class returnType, Object result, OutputStream output) throws IOException {
if (ClassUtils.isJavaLangType(returnType)) {
if (result instanceof Byte) {
output.write((Byte) result);
} else if (result... | [
"static",
"void",
"encode",
"(",
"Environment",
"environment",
",",
"LocalFunctionRegistry",
"registry",
",",
"Class",
"returnType",
",",
"Object",
"result",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"if",
"(",
"ClassUtils",
".",
"isJavaLan... | Encode and write to output stream.
@param environment environment
@param registry local function registry
@param returnType return type as Class
@param result result object
@param output outputstream
@throws IOException input/output exception | [
"Encode",
"and",
"write",
"to",
"output",
"stream",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function/src/main/java/io/micronaut/function/executor/StreamFunctionExecutor.java#L162-L176 |
129,846 | micronaut-projects/micronaut-core | function-client/src/main/java/io/micronaut/function/client/aws/AWSLambdaAsyncClientFactory.java | AWSLambdaAsyncClientFactory.awsLambdaAsyncClient | @Refreshable
@Requires(beans = AWSLambdaConfiguration.class)
AWSLambdaAsync awsLambdaAsyncClient() {
AWSLambdaAsyncClientBuilder builder = configuration.getBuilder();
return builder.build();
} | java | @Refreshable
@Requires(beans = AWSLambdaConfiguration.class)
AWSLambdaAsync awsLambdaAsyncClient() {
AWSLambdaAsyncClientBuilder builder = configuration.getBuilder();
return builder.build();
} | [
"@",
"Refreshable",
"@",
"Requires",
"(",
"beans",
"=",
"AWSLambdaConfiguration",
".",
"class",
")",
"AWSLambdaAsync",
"awsLambdaAsyncClient",
"(",
")",
"{",
"AWSLambdaAsyncClientBuilder",
"builder",
"=",
"configuration",
".",
"getBuilder",
"(",
")",
";",
"return",
... | The client returned from a builder.
@return client object | [
"The",
"client",
"returned",
"from",
"a",
"builder",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/function-client/src/main/java/io/micronaut/function/client/aws/AWSLambdaAsyncClientFactory.java#L46-L51 |
129,847 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/scheduling/executor/ExecutorFactory.java | ExecutorFactory.executorService | @EachBean(ExecutorConfiguration.class)
@Bean(preDestroy = "shutdown")
public ExecutorService executorService(ExecutorConfiguration executorConfiguration) {
ExecutorType executorType = executorConfiguration.getType();
switch (executorType) {
case FIXED:
return executor... | java | @EachBean(ExecutorConfiguration.class)
@Bean(preDestroy = "shutdown")
public ExecutorService executorService(ExecutorConfiguration executorConfiguration) {
ExecutorType executorType = executorConfiguration.getType();
switch (executorType) {
case FIXED:
return executor... | [
"@",
"EachBean",
"(",
"ExecutorConfiguration",
".",
"class",
")",
"@",
"Bean",
"(",
"preDestroy",
"=",
"\"shutdown\"",
")",
"public",
"ExecutorService",
"executorService",
"(",
"ExecutorConfiguration",
"executorConfiguration",
")",
"{",
"ExecutorType",
"executorType",
... | Create the ExecutorService with the given configuration.
@param executorConfiguration The configuration to create a thread pool that creates new threads as needed
@return A thread pool that creates new threads as needed | [
"Create",
"the",
"ExecutorService",
"with",
"the",
"given",
"configuration",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/scheduling/executor/ExecutorFactory.java#L50-L82 |
129,848 | micronaut-projects/micronaut-core | jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java | CalculatedSettings.getDriverClassName | public String getDriverClassName() {
final String driverClassName = basicJdbcConfiguration.getConfiguredDriverClassName();
if (calculatedDriverClassName == null || StringUtils.hasText(driverClassName)) {
if (StringUtils.hasText(driverClassName)) {
if (!driverClassIsPresent(dr... | java | public String getDriverClassName() {
final String driverClassName = basicJdbcConfiguration.getConfiguredDriverClassName();
if (calculatedDriverClassName == null || StringUtils.hasText(driverClassName)) {
if (StringUtils.hasText(driverClassName)) {
if (!driverClassIsPresent(dr... | [
"public",
"String",
"getDriverClassName",
"(",
")",
"{",
"final",
"String",
"driverClassName",
"=",
"basicJdbcConfiguration",
".",
"getConfiguredDriverClassName",
"(",
")",
";",
"if",
"(",
"calculatedDriverClassName",
"==",
"null",
"||",
"StringUtils",
".",
"hasText",... | Determines the driver class name based on the configured value. If not
configured, determine the driver class name based on the URL. If the
URL is not configured, look for an embedded database driver on the
classpath.
@return The calculated driver class name | [
"Determines",
"the",
"driver",
"class",
"name",
"based",
"on",
"the",
"configured",
"value",
".",
"If",
"not",
"configured",
"determine",
"the",
"driver",
"class",
"name",
"based",
"on",
"the",
"URL",
".",
"If",
"the",
"URL",
"is",
"not",
"configured",
"lo... | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java#L66-L92 |
129,849 | micronaut-projects/micronaut-core | jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java | CalculatedSettings.getUrl | public String getUrl() {
final String url = basicJdbcConfiguration.getConfiguredUrl();
if (calculatedUrl == null || StringUtils.hasText(url)) {
calculatedUrl = url;
if (!StringUtils.hasText(calculatedUrl) && embeddedDatabaseConnection.isPresent()) {
calculatedUrl ... | java | public String getUrl() {
final String url = basicJdbcConfiguration.getConfiguredUrl();
if (calculatedUrl == null || StringUtils.hasText(url)) {
calculatedUrl = url;
if (!StringUtils.hasText(calculatedUrl) && embeddedDatabaseConnection.isPresent()) {
calculatedUrl ... | [
"public",
"String",
"getUrl",
"(",
")",
"{",
"final",
"String",
"url",
"=",
"basicJdbcConfiguration",
".",
"getConfiguredUrl",
"(",
")",
";",
"if",
"(",
"calculatedUrl",
"==",
"null",
"||",
"StringUtils",
".",
"hasText",
"(",
"url",
")",
")",
"{",
"calcula... | Determines the URL based on the configured value. If the URL is
not configured, search for an embedded database driver on the
classpath and retrieve a default URL for it.
@return The calculated URL | [
"Determines",
"the",
"URL",
"based",
"on",
"the",
"configured",
"value",
".",
"If",
"the",
"URL",
"is",
"not",
"configured",
"search",
"for",
"an",
"embedded",
"database",
"driver",
"on",
"the",
"classpath",
"and",
"retrieve",
"a",
"default",
"URL",
"for",
... | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java#L101-L114 |
129,850 | micronaut-projects/micronaut-core | jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java | CalculatedSettings.getUsername | public String getUsername() {
final String username = basicJdbcConfiguration.getConfiguredUsername();
if (calculatedUsername == null || StringUtils.hasText(username)) {
calculatedUsername = username;
if (!StringUtils.hasText(calculatedUsername) && JdbcDatabaseManager.isEmbedded(b... | java | public String getUsername() {
final String username = basicJdbcConfiguration.getConfiguredUsername();
if (calculatedUsername == null || StringUtils.hasText(username)) {
calculatedUsername = username;
if (!StringUtils.hasText(calculatedUsername) && JdbcDatabaseManager.isEmbedded(b... | [
"public",
"String",
"getUsername",
"(",
")",
"{",
"final",
"String",
"username",
"=",
"basicJdbcConfiguration",
".",
"getConfiguredUsername",
"(",
")",
";",
"if",
"(",
"calculatedUsername",
"==",
"null",
"||",
"StringUtils",
".",
"hasText",
"(",
"username",
")",... | Determines the username based on the configured value. If the
username is not configured and an embedded database driver is
on the classpath, return 'sa'.
@return The calculated username | [
"Determines",
"the",
"username",
"based",
"on",
"the",
"configured",
"value",
".",
"If",
"the",
"username",
"is",
"not",
"configured",
"and",
"an",
"embedded",
"database",
"driver",
"is",
"on",
"the",
"classpath",
"return",
"sa",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java#L123-L133 |
129,851 | micronaut-projects/micronaut-core | jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java | CalculatedSettings.getPassword | public String getPassword() {
final String password = basicJdbcConfiguration.getConfiguredPassword();
if (calculatedPassword == null || StringUtils.hasText(password)) {
calculatedPassword = password;
if (!StringUtils.hasText(calculatedPassword) && JdbcDatabaseManager.isEmbedded(b... | java | public String getPassword() {
final String password = basicJdbcConfiguration.getConfiguredPassword();
if (calculatedPassword == null || StringUtils.hasText(password)) {
calculatedPassword = password;
if (!StringUtils.hasText(calculatedPassword) && JdbcDatabaseManager.isEmbedded(b... | [
"public",
"String",
"getPassword",
"(",
")",
"{",
"final",
"String",
"password",
"=",
"basicJdbcConfiguration",
".",
"getConfiguredPassword",
"(",
")",
";",
"if",
"(",
"calculatedPassword",
"==",
"null",
"||",
"StringUtils",
".",
"hasText",
"(",
"password",
")",... | Determines the password based on the configured value. If the
password is not configured and an embedded database driver is
on the classpath, return an empty string.
@return The calculated password | [
"Determines",
"the",
"password",
"based",
"on",
"the",
"configured",
"value",
".",
"If",
"the",
"password",
"is",
"not",
"configured",
"and",
"an",
"embedded",
"database",
"driver",
"is",
"on",
"the",
"classpath",
"return",
"an",
"empty",
"string",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java#L142-L152 |
129,852 | micronaut-projects/micronaut-core | jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java | CalculatedSettings.getValidationQuery | public String getValidationQuery() {
final String validationQuery = basicJdbcConfiguration.getConfiguredValidationQuery();
if (calculatedValidationQuery == null || StringUtils.hasText(validationQuery)) {
calculatedValidationQuery = validationQuery;
if (!StringUtils.hasText(calcul... | java | public String getValidationQuery() {
final String validationQuery = basicJdbcConfiguration.getConfiguredValidationQuery();
if (calculatedValidationQuery == null || StringUtils.hasText(validationQuery)) {
calculatedValidationQuery = validationQuery;
if (!StringUtils.hasText(calcul... | [
"public",
"String",
"getValidationQuery",
"(",
")",
"{",
"final",
"String",
"validationQuery",
"=",
"basicJdbcConfiguration",
".",
"getConfiguredValidationQuery",
"(",
")",
";",
"if",
"(",
"calculatedValidationQuery",
"==",
"null",
"||",
"StringUtils",
".",
"hasText",... | Determines the validation query based on the configured value. If the
validation query is not configured, search pre-defined databases for
a match based on the URL. If a match is found, return the defined
validation query for that database.
@return The calculated validation query | [
"Determines",
"the",
"validation",
"query",
"based",
"on",
"the",
"configured",
"value",
".",
"If",
"the",
"validation",
"query",
"is",
"not",
"configured",
"search",
"pre",
"-",
"defined",
"databases",
"for",
"a",
"match",
"based",
"on",
"the",
"URL",
".",
... | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java#L162-L173 |
129,853 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java | GenericTypeUtils.resolveGenericTypeArgument | public static Optional<Class> resolveGenericTypeArgument(Field field) {
Type genericType = field != null ? field.getGenericType() : null;
if (genericType instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) genericType).getActualTypeArguments();
if (typeArg... | java | public static Optional<Class> resolveGenericTypeArgument(Field field) {
Type genericType = field != null ? field.getGenericType() : null;
if (genericType instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) genericType).getActualTypeArguments();
if (typeArg... | [
"public",
"static",
"Optional",
"<",
"Class",
">",
"resolveGenericTypeArgument",
"(",
"Field",
"field",
")",
"{",
"Type",
"genericType",
"=",
"field",
"!=",
"null",
"?",
"field",
".",
"getGenericType",
"(",
")",
":",
"null",
";",
"if",
"(",
"genericType",
... | Resolves a single generic type argument for the given field.
@param field The field
@return The type argument or {@link Optional#empty()} | [
"Resolves",
"a",
"single",
"generic",
"type",
"argument",
"for",
"the",
"given",
"field",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java#L44-L54 |
129,854 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java | GenericTypeUtils.resolveInterfaceTypeArguments | public static Class[] resolveInterfaceTypeArguments(Class<?> type, Class<?> interfaceType) {
Optional<Type> resolvedType = getAllGenericInterfaces(type)
.stream()
.filter(t -> {
if (t instanceof ParameterizedType) {
Para... | java | public static Class[] resolveInterfaceTypeArguments(Class<?> type, Class<?> interfaceType) {
Optional<Type> resolvedType = getAllGenericInterfaces(type)
.stream()
.filter(t -> {
if (t instanceof ParameterizedType) {
Para... | [
"public",
"static",
"Class",
"[",
"]",
"resolveInterfaceTypeArguments",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
">",
"interfaceType",
")",
"{",
"Optional",
"<",
"Type",
">",
"resolvedType",
"=",
"getAllGenericInterfaces",
"(",
"type",
")... | Resolve all of the type arguments for the given interface from the given type. Also
searches superclasses.
@param type The type to resolve from
@param interfaceType The interface to resolve from
@return The type arguments to the interface | [
"Resolve",
"all",
"of",
"the",
"type",
"arguments",
"for",
"the",
"given",
"interface",
"from",
"the",
"given",
"type",
".",
"Also",
"searches",
"superclasses",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java#L65-L79 |
129,855 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java | GenericTypeUtils.resolveSuperTypeGenericArguments | public static Class[] resolveSuperTypeGenericArguments(Class<?> type, Class<?> superTypeToResolve) {
Type supertype = type.getGenericSuperclass();
Class<?> superclass = type.getSuperclass();
while (superclass != null && superclass != Object.class) {
if (supertype instanceof Parameter... | java | public static Class[] resolveSuperTypeGenericArguments(Class<?> type, Class<?> superTypeToResolve) {
Type supertype = type.getGenericSuperclass();
Class<?> superclass = type.getSuperclass();
while (superclass != null && superclass != Object.class) {
if (supertype instanceof Parameter... | [
"public",
"static",
"Class",
"[",
"]",
"resolveSuperTypeGenericArguments",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
">",
"superTypeToResolve",
")",
"{",
"Type",
"supertype",
"=",
"type",
".",
"getGenericSuperclass",
"(",
")",
";",
"Class"... | Resolve all of the type arguments for the given super type from the given type.
@param type The type to resolve from
@param superTypeToResolve The suepr type to resolve from
@return The type arguments to the interface | [
"Resolve",
"all",
"of",
"the",
"type",
"arguments",
"for",
"the",
"given",
"super",
"type",
"from",
"the",
"given",
"type",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java#L89-L104 |
129,856 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java | GenericTypeUtils.resolveSuperGenericTypeArgument | public static Optional<Class> resolveSuperGenericTypeArgument(Class type) {
try {
Type genericSuperclass = type.getGenericSuperclass();
if (genericSuperclass instanceof ParameterizedType) {
return resolveSingleTypeArgument(genericSuperclass);
}
ret... | java | public static Optional<Class> resolveSuperGenericTypeArgument(Class type) {
try {
Type genericSuperclass = type.getGenericSuperclass();
if (genericSuperclass instanceof ParameterizedType) {
return resolveSingleTypeArgument(genericSuperclass);
}
ret... | [
"public",
"static",
"Optional",
"<",
"Class",
">",
"resolveSuperGenericTypeArgument",
"(",
"Class",
"type",
")",
"{",
"try",
"{",
"Type",
"genericSuperclass",
"=",
"type",
".",
"getGenericSuperclass",
"(",
")",
";",
"if",
"(",
"genericSuperclass",
"instanceof",
... | Resolves a single generic type argument from the super class of the given type.
@param type The type to resolve from
@return A single Class or null | [
"Resolves",
"a",
"single",
"generic",
"type",
"argument",
"from",
"the",
"super",
"class",
"of",
"the",
"given",
"type",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java#L112-L122 |
129,857 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java | GenericTypeUtils.resolveTypeArguments | public static Class[] resolveTypeArguments(Type genericType) {
Class[] typeArguments = ReflectionUtils.EMPTY_CLASS_ARRAY;
if (genericType instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) genericType;
typeArguments = resolveParameterizedType(pt);
... | java | public static Class[] resolveTypeArguments(Type genericType) {
Class[] typeArguments = ReflectionUtils.EMPTY_CLASS_ARRAY;
if (genericType instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) genericType;
typeArguments = resolveParameterizedType(pt);
... | [
"public",
"static",
"Class",
"[",
"]",
"resolveTypeArguments",
"(",
"Type",
"genericType",
")",
"{",
"Class",
"[",
"]",
"typeArguments",
"=",
"ReflectionUtils",
".",
"EMPTY_CLASS_ARRAY",
";",
"if",
"(",
"genericType",
"instanceof",
"ParameterizedType",
")",
"{",
... | Resolves the type arguments for a generic type.
@param genericType The generic type
@return The type arguments | [
"Resolves",
"the",
"type",
"arguments",
"for",
"a",
"generic",
"type",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java#L130-L137 |
129,858 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java | GenericTypeUtils.resolveInterfaceTypeArgument | public static Optional<Class> resolveInterfaceTypeArgument(Class type, Class interfaceType) {
Type[] genericInterfaces = type.getGenericInterfaces();
for (Type genericInterface : genericInterfaces) {
if (genericInterface instanceof ParameterizedType) {
ParameterizedType pt = ... | java | public static Optional<Class> resolveInterfaceTypeArgument(Class type, Class interfaceType) {
Type[] genericInterfaces = type.getGenericInterfaces();
for (Type genericInterface : genericInterfaces) {
if (genericInterface instanceof ParameterizedType) {
ParameterizedType pt = ... | [
"public",
"static",
"Optional",
"<",
"Class",
">",
"resolveInterfaceTypeArgument",
"(",
"Class",
"type",
",",
"Class",
"interfaceType",
")",
"{",
"Type",
"[",
"]",
"genericInterfaces",
"=",
"type",
".",
"getGenericInterfaces",
"(",
")",
";",
"for",
"(",
"Type"... | Resolves a single type argument from the given interface of the given class. Also
searches superclasses.
@param type The type to resolve from
@param interfaceType The interface to resolve for
@return The class or null | [
"Resolves",
"a",
"single",
"type",
"argument",
"from",
"the",
"given",
"interface",
"of",
"the",
"given",
"class",
".",
"Also",
"searches",
"superclasses",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java#L147-L162 |
129,859 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java | GenericTypeUtils.resolveSingleTypeArgument | private static Optional<Class> resolveSingleTypeArgument(Type genericType) {
if (genericType instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) genericType;
Type[] actualTypeArguments = pt.getActualTypeArguments();
if (actualTypeArguments.length == 1) ... | java | private static Optional<Class> resolveSingleTypeArgument(Type genericType) {
if (genericType instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) genericType;
Type[] actualTypeArguments = pt.getActualTypeArguments();
if (actualTypeArguments.length == 1) ... | [
"private",
"static",
"Optional",
"<",
"Class",
">",
"resolveSingleTypeArgument",
"(",
"Type",
"genericType",
")",
"{",
"if",
"(",
"genericType",
"instanceof",
"ParameterizedType",
")",
"{",
"ParameterizedType",
"pt",
"=",
"(",
"ParameterizedType",
")",
"genericType"... | Resolve a single type from the given generic type.
@param genericType The generic type
@return An {@link Optional} of the type | [
"Resolve",
"a",
"single",
"type",
"from",
"the",
"given",
"generic",
"type",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/GenericTypeUtils.java#L170-L180 |
129,860 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/client/registration/DiscoveryServiceAutoRegistration.java | DiscoveryServiceAutoRegistration.performRegistration | protected void performRegistration(
String discoveryService,
RegistrationConfiguration registration,
ServiceInstance instance,
Publisher<HttpStatus> registrationObservable) {
registrationObservable.subscribe(new Subscriber<HttpStatus>() {
@Override
public... | java | protected void performRegistration(
String discoveryService,
RegistrationConfiguration registration,
ServiceInstance instance,
Publisher<HttpStatus> registrationObservable) {
registrationObservable.subscribe(new Subscriber<HttpStatus>() {
@Override
public... | [
"protected",
"void",
"performRegistration",
"(",
"String",
"discoveryService",
",",
"RegistrationConfiguration",
"registration",
",",
"ServiceInstance",
"instance",
",",
"Publisher",
"<",
"HttpStatus",
">",
"registrationObservable",
")",
"{",
"registrationObservable",
".",
... | Register a new service instance in the discovery service.
@param discoveryService The discovery service
@param registration The registration configuration
@param instance The service instance
@param registrationObservable The registration observable | [
"Register",
"a",
"new",
"service",
"instance",
"in",
"the",
"discovery",
"service",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/client/registration/DiscoveryServiceAutoRegistration.java#L52-L86 |
129,861 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/client/registration/DiscoveryServiceAutoRegistration.java | DiscoveryServiceAutoRegistration.performDeregistration | protected void performDeregistration(String discoveryService, RegistrationConfiguration registration, Publisher<HttpStatus> deregisterPublisher, String applicationName) {
if (registration.isFailFast()) {
try {
Flowable.fromPublisher(deregisterPublisher).blockingFirst();
... | java | protected void performDeregistration(String discoveryService, RegistrationConfiguration registration, Publisher<HttpStatus> deregisterPublisher, String applicationName) {
if (registration.isFailFast()) {
try {
Flowable.fromPublisher(deregisterPublisher).blockingFirst();
... | [
"protected",
"void",
"performDeregistration",
"(",
"String",
"discoveryService",
",",
"RegistrationConfiguration",
"registration",
",",
"Publisher",
"<",
"HttpStatus",
">",
"deregisterPublisher",
",",
"String",
"applicationName",
")",
"{",
"if",
"(",
"registration",
"."... | De-register a service from the discovery client.
@param discoveryService The discovery service
@param registration The registration configuration
@param deregisterPublisher The registration publisher
@param applicationName The application name to de-register | [
"De",
"-",
"register",
"a",
"service",
"from",
"the",
"discovery",
"client",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/client/registration/DiscoveryServiceAutoRegistration.java#L116-L156 |
129,862 | micronaut-projects/micronaut-core | inject-java/src/main/java/io/micronaut/annotation/processing/visitor/AbstractJavaElement.java | AbstractJavaElement.mirrorToClassElement | protected ClassElement mirrorToClassElement(TypeMirror returnType, JavaVisitorContext visitorContext) {
if (returnType instanceof NoType) {
return new JavaVoidElement();
} else if (returnType instanceof DeclaredType) {
DeclaredType dt = (DeclaredType) returnType;
Elem... | java | protected ClassElement mirrorToClassElement(TypeMirror returnType, JavaVisitorContext visitorContext) {
if (returnType instanceof NoType) {
return new JavaVoidElement();
} else if (returnType instanceof DeclaredType) {
DeclaredType dt = (DeclaredType) returnType;
Elem... | [
"protected",
"ClassElement",
"mirrorToClassElement",
"(",
"TypeMirror",
"returnType",
",",
"JavaVisitorContext",
"visitorContext",
")",
"{",
"if",
"(",
"returnType",
"instanceof",
"NoType",
")",
"{",
"return",
"new",
"JavaVoidElement",
"(",
")",
";",
"}",
"else",
... | Obtain the ClassElement for the given mirror.
@param returnType The return type
@param visitorContext The visitor context
@return The class element | [
"Obtain",
"the",
"ClassElement",
"for",
"the",
"given",
"mirror",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/visitor/AbstractJavaElement.java#L135-L191 |
129,863 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/scheduling/cron/CronExpression.java | CronExpression.nextTimeAfter | public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis) {
return nextTimeAfter(afterTime, afterTime.plus(Duration.ofMillis(durationInMillis)));
} | java | public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, long durationInMillis) {
return nextTimeAfter(afterTime, afterTime.plus(Duration.ofMillis(durationInMillis)));
} | [
"public",
"ZonedDateTime",
"nextTimeAfter",
"(",
"ZonedDateTime",
"afterTime",
",",
"long",
"durationInMillis",
")",
"{",
"return",
"nextTimeAfter",
"(",
"afterTime",
",",
"afterTime",
".",
"plus",
"(",
"Duration",
".",
"ofMillis",
"(",
"durationInMillis",
")",
")... | This will search for the next time within the next durationInMillis
millisecond. Be aware that the duration is specified in millis,
but in fact the limit is checked on a day-to-day basis.
@param afterTime A date-time with a time-zone in the ISO-8601 calendar system
@param durationInMillis The maximum duration i... | [
"This",
"will",
"search",
"for",
"the",
"next",
"time",
"within",
"the",
"next",
"durationInMillis",
"millisecond",
".",
"Be",
"aware",
"that",
"the",
"duration",
"is",
"specified",
"in",
"millis",
"but",
"in",
"fact",
"the",
"limit",
"is",
"checked",
"on",
... | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/scheduling/cron/CronExpression.java#L240-L242 |
129,864 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/scheduling/cron/CronExpression.java | CronExpression.nextTimeAfter | public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, ZonedDateTime dateTimeBarrier) {
ZonedDateTime nextTime = ZonedDateTime.from(afterTime).withNano(0).plusSeconds(1).withNano(0);
while (true) { // day of week
while (true) { // month
while (true) { // day of month
... | java | public ZonedDateTime nextTimeAfter(ZonedDateTime afterTime, ZonedDateTime dateTimeBarrier) {
ZonedDateTime nextTime = ZonedDateTime.from(afterTime).withNano(0).plusSeconds(1).withNano(0);
while (true) { // day of week
while (true) { // month
while (true) { // day of month
... | [
"public",
"ZonedDateTime",
"nextTimeAfter",
"(",
"ZonedDateTime",
"afterTime",
",",
"ZonedDateTime",
"dateTimeBarrier",
")",
"{",
"ZonedDateTime",
"nextTime",
"=",
"ZonedDateTime",
".",
"from",
"(",
"afterTime",
")",
".",
"withNano",
"(",
"0",
")",
".",
"plusSecon... | This will search for the next time within the given dateTimeBarrier.
@param afterTime A date-time with a time-zone in the ISO-8601 calendar system
@param dateTimeBarrier The upper limit or maximum date-time to check for next time
@return The next time within given barrier | [
"This",
"will",
"search",
"for",
"the",
"next",
"time",
"within",
"the",
"given",
"dateTimeBarrier",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/scheduling/cron/CronExpression.java#L252-L296 |
129,865 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/health/HeartbeatTask.java | HeartbeatTask.pulsate | @Scheduled(fixedDelay = "${micronaut.heartbeat.interval:15s}",
initialDelay = "${micronaut.heartbeat.initial-delay:5s}")
public void pulsate() {
ServiceInstance instance = eventReference.get();
if (instance != null) {
eventPublisher.publishEvent(new HeartbeatEvent(instance... | java | @Scheduled(fixedDelay = "${micronaut.heartbeat.interval:15s}",
initialDelay = "${micronaut.heartbeat.initial-delay:5s}")
public void pulsate() {
ServiceInstance instance = eventReference.get();
if (instance != null) {
eventPublisher.publishEvent(new HeartbeatEvent(instance... | [
"@",
"Scheduled",
"(",
"fixedDelay",
"=",
"\"${micronaut.heartbeat.interval:15s}\"",
",",
"initialDelay",
"=",
"\"${micronaut.heartbeat.initial-delay:5s}\"",
")",
"public",
"void",
"pulsate",
"(",
")",
"{",
"ServiceInstance",
"instance",
"=",
"eventReference",
".",
"get",... | Publish the heartbeat event with current health status. | [
"Publish",
"the",
"heartbeat",
"event",
"with",
"current",
"health",
"status",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/health/HeartbeatTask.java#L57-L64 |
129,866 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/client/DnsResolver.java | DnsResolver.getCNamesFromTxtRecord | static Set<String> getCNamesFromTxtRecord(String discoveryDnsName) throws NamingException {
Attributes attrs = DIR_CONTEXT.getAttributes(discoveryDnsName, new String[]{TXT_RECORD_TYPE});
Attribute attr = attrs.get(TXT_RECORD_TYPE);
String txtRecord = null;
if (attr != null) {
... | java | static Set<String> getCNamesFromTxtRecord(String discoveryDnsName) throws NamingException {
Attributes attrs = DIR_CONTEXT.getAttributes(discoveryDnsName, new String[]{TXT_RECORD_TYPE});
Attribute attr = attrs.get(TXT_RECORD_TYPE);
String txtRecord = null;
if (attr != null) {
... | [
"static",
"Set",
"<",
"String",
">",
"getCNamesFromTxtRecord",
"(",
"String",
"discoveryDnsName",
")",
"throws",
"NamingException",
"{",
"Attributes",
"attrs",
"=",
"DIR_CONTEXT",
".",
"getAttributes",
"(",
"discoveryDnsName",
",",
"new",
"String",
"[",
"]",
"{",
... | Looks up the DNS name provided in the JNDI context.
@param discoveryDnsName The discovery DNS name
@throws NamingException when the record cannot be found
@return A set of cname records | [
"Looks",
"up",
"the",
"DNS",
"name",
"provided",
"in",
"the",
"JNDI",
"context",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/client/DnsResolver.java#L57-L80 |
129,867 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/client/DnsResolver.java | DnsResolver.getDirContext | private static DirContext getDirContext() {
Hashtable<String, String> env = new Hashtable<>();
env.put(JAVA_NAMING_FACTORY_INITIAL, DNS_NAMING_FACTORY);
env.put(JAVA_NAMING_PROVIDER_URL, DNS_PROVIDER_URL);
try {
return new InitialDirContext(env);
} catch (Throwable e... | java | private static DirContext getDirContext() {
Hashtable<String, String> env = new Hashtable<>();
env.put(JAVA_NAMING_FACTORY_INITIAL, DNS_NAMING_FACTORY);
env.put(JAVA_NAMING_PROVIDER_URL, DNS_PROVIDER_URL);
try {
return new InitialDirContext(env);
} catch (Throwable e... | [
"private",
"static",
"DirContext",
"getDirContext",
"(",
")",
"{",
"Hashtable",
"<",
"String",
",",
"String",
">",
"env",
"=",
"new",
"Hashtable",
"<>",
"(",
")",
";",
"env",
".",
"put",
"(",
"JAVA_NAMING_FACTORY_INITIAL",
",",
"DNS_NAMING_FACTORY",
")",
";"... | Load up the DNS JNDI context provider. | [
"Load",
"up",
"the",
"DNS",
"JNDI",
"context",
"provider",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/client/DnsResolver.java#L85-L95 |
129,868 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/configuration/ConfigurationMetadataBuilder.java | ConfigurationMetadataBuilder.writeAttribute | static void writeAttribute(Writer out, String name, String value) throws IOException {
out.write('"');
out.write(name);
out.write("\":");
out.write(quote(value));
} | java | static void writeAttribute(Writer out, String name, String value) throws IOException {
out.write('"');
out.write(name);
out.write("\":");
out.write(quote(value));
} | [
"static",
"void",
"writeAttribute",
"(",
"Writer",
"out",
",",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"'",
"'",
")",
";",
"out",
".",
"write",
"(",
"name",
")",
";",
"out",
".",
"write",... | Write a quoted attribute with a value to a writer.
@param out The out writer
@param name The name of the attribute
@param value The value
@throws IOException If an error occurred writing output | [
"Write",
"a",
"quoted",
"attribute",
"with",
"a",
"value",
"to",
"a",
"writer",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/configuration/ConfigurationMetadataBuilder.java#L261-L266 |
129,869 | micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/uri/UriTemplate.java | UriTemplate.expand | public String expand(Map<String, Object> parameters) {
StringBuilder builder = new StringBuilder();
boolean previousHasContent = false;
boolean anyPreviousHasOperator = false;
for (PathSegment segment : segments) {
String result = segment.expand(parameters, previousHasContent... | java | public String expand(Map<String, Object> parameters) {
StringBuilder builder = new StringBuilder();
boolean previousHasContent = false;
boolean anyPreviousHasOperator = false;
for (PathSegment segment : segments) {
String result = segment.expand(parameters, previousHasContent... | [
"public",
"String",
"expand",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"previousHasContent",
"=",
"false",
";",
"boolean",
"anyPreviousHasOperator",
... | Expand the string with the given parameters.
@param parameters The parameters
@return The expanded URI | [
"Expand",
"the",
"string",
"with",
"the",
"given",
"parameters",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/uri/UriTemplate.java#L174-L193 |
129,870 | micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/uri/UriTemplate.java | UriTemplate.nest | protected UriTemplate nest(CharSequence uriTemplate, Object... parserArguments) {
if (uriTemplate == null) {
return this;
}
int len = uriTemplate.length();
if (len == 0) {
return this;
}
List<PathSegment> newSegments = buildNestedSegments(uriTempl... | java | protected UriTemplate nest(CharSequence uriTemplate, Object... parserArguments) {
if (uriTemplate == null) {
return this;
}
int len = uriTemplate.length();
if (len == 0) {
return this;
}
List<PathSegment> newSegments = buildNestedSegments(uriTempl... | [
"protected",
"UriTemplate",
"nest",
"(",
"CharSequence",
"uriTemplate",
",",
"Object",
"...",
"parserArguments",
")",
"{",
"if",
"(",
"uriTemplate",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"int",
"len",
"=",
"uriTemplate",
".",
"length",
"(",
"... | Nests another URI template with this template.
@param uriTemplate The URI template. If it does not begin with forward slash it will automatically be
appended with forward slash
@param parserArguments The parsed arguments
@return The new URI template | [
"Nests",
"another",
"URI",
"template",
"with",
"this",
"template",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/uri/UriTemplate.java#L273-L284 |
129,871 | micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/uri/UriTemplate.java | UriTemplate.normalizeNested | protected String normalizeNested(String uri, CharSequence nested) {
if (StringUtils.isEmpty(nested)) {
return uri;
}
String nestedStr = nested.toString();
char firstNested = nestedStr.charAt(0);
int len = nestedStr.length();
if (len == 1 && firstNested == SLA... | java | protected String normalizeNested(String uri, CharSequence nested) {
if (StringUtils.isEmpty(nested)) {
return uri;
}
String nestedStr = nested.toString();
char firstNested = nestedStr.charAt(0);
int len = nestedStr.length();
if (len == 1 && firstNested == SLA... | [
"protected",
"String",
"normalizeNested",
"(",
"String",
"uri",
",",
"CharSequence",
"nested",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"nested",
")",
")",
"{",
"return",
"uri",
";",
"}",
"String",
"nestedStr",
"=",
"nested",
".",
"toString... | Normalize a nested URI.
@param uri The URI
@param nested The nested URI
@return The new URI | [
"Normalize",
"a",
"nested",
"URI",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/uri/UriTemplate.java#L301-L349 |
129,872 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/i18n/ResourceBundleMessageSource.java | ResourceBundleMessageSource.buildMessageCache | @Nonnull
protected Map<MessageKey, Optional<String>> buildMessageCache() {
return new ConcurrentLinkedHashMap.Builder<MessageKey, Optional<String>>()
.maximumWeightedCapacity(100)
.build();
} | java | @Nonnull
protected Map<MessageKey, Optional<String>> buildMessageCache() {
return new ConcurrentLinkedHashMap.Builder<MessageKey, Optional<String>>()
.maximumWeightedCapacity(100)
.build();
} | [
"@",
"Nonnull",
"protected",
"Map",
"<",
"MessageKey",
",",
"Optional",
"<",
"String",
">",
">",
"buildMessageCache",
"(",
")",
"{",
"return",
"new",
"ConcurrentLinkedHashMap",
".",
"Builder",
"<",
"MessageKey",
",",
"Optional",
"<",
"String",
">",
">",
"(",... | Build the cache used to store resolved messages.
@return The cache. | [
"Build",
"the",
"cache",
"used",
"to",
"store",
"resolved",
"messages",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/i18n/ResourceBundleMessageSource.java#L115-L120 |
129,873 | micronaut-projects/micronaut-core | router/src/main/java/io/micronaut/web/router/AnnotatedFilterRouteBuilder.java | AnnotatedFilterRouteBuilder.process | @PostConstruct
public void process() {
Collection<BeanDefinition<?>> filterDefinitions = beanContext.getBeanDefinitions(Qualifiers.byStereotype(Filter.class));
for (BeanDefinition<?> beanDefinition : filterDefinitions) {
if (HttpClientFilter.class.isAssignableFrom(beanDefinition.getBeanT... | java | @PostConstruct
public void process() {
Collection<BeanDefinition<?>> filterDefinitions = beanContext.getBeanDefinitions(Qualifiers.byStereotype(Filter.class));
for (BeanDefinition<?> beanDefinition : filterDefinitions) {
if (HttpClientFilter.class.isAssignableFrom(beanDefinition.getBeanT... | [
"@",
"PostConstruct",
"public",
"void",
"process",
"(",
")",
"{",
"Collection",
"<",
"BeanDefinition",
"<",
"?",
">",
">",
"filterDefinitions",
"=",
"beanContext",
".",
"getBeanDefinitions",
"(",
"Qualifiers",
".",
"byStereotype",
"(",
"Filter",
".",
"class",
... | Executed after the bean creation. | [
"Executed",
"after",
"the",
"bean",
"creation",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/router/src/main/java/io/micronaut/web/router/AnnotatedFilterRouteBuilder.java#L64-L88 |
129,874 | micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java | AbstractOpenTracingFilter.setResponseTags | protected void setResponseTags(HttpRequest<?> request, HttpResponse<?> response, Span span) {
HttpStatus status = response.getStatus();
int code = status.getCode();
if (code > HTTP_SUCCESS_CODE_UPPER_LIMIT) {
span.setTag(TAG_HTTP_STATUS_CODE, code);
span.setTag(TAG_ERROR,... | java | protected void setResponseTags(HttpRequest<?> request, HttpResponse<?> response, Span span) {
HttpStatus status = response.getStatus();
int code = status.getCode();
if (code > HTTP_SUCCESS_CODE_UPPER_LIMIT) {
span.setTag(TAG_HTTP_STATUS_CODE, code);
span.setTag(TAG_ERROR,... | [
"protected",
"void",
"setResponseTags",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
",",
"HttpResponse",
"<",
"?",
">",
"response",
",",
"Span",
"span",
")",
"{",
"HttpStatus",
"status",
"=",
"response",
".",
"getStatus",
"(",
")",
";",
"int",
"code",
... | Sets the response tags.
@param request The request
@param response The response
@param span The span | [
"Sets",
"the",
"response",
"tags",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java#L62-L72 |
129,875 | micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java | AbstractOpenTracingFilter.setErrorTags | protected void setErrorTags(Span span, Throwable error) {
if (error != null) {
String message = error.getMessage();
if (message == null) {
message = error.getClass().getSimpleName();
}
span.setTag(TAG_ERROR, message);
}
} | java | protected void setErrorTags(Span span, Throwable error) {
if (error != null) {
String message = error.getMessage();
if (message == null) {
message = error.getClass().getSimpleName();
}
span.setTag(TAG_ERROR, message);
}
} | [
"protected",
"void",
"setErrorTags",
"(",
"Span",
"span",
",",
"Throwable",
"error",
")",
"{",
"if",
"(",
"error",
"!=",
"null",
")",
"{",
"String",
"message",
"=",
"error",
".",
"getMessage",
"(",
")",
";",
"if",
"(",
"message",
"==",
"null",
")",
"... | Sets the error tags to use on the span.
@param span The span
@param error The error | [
"Sets",
"the",
"error",
"tags",
"to",
"use",
"on",
"the",
"span",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java#L80-L88 |
129,876 | micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java | AbstractOpenTracingFilter.resolveSpanName | protected String resolveSpanName(HttpRequest<?> request) {
Optional<String> route = request.getAttribute(HttpAttributes.URI_TEMPLATE, String.class);
return route.map(s -> request.getMethod() + " " + s).orElse(request.getMethod() + " " + request.getPath());
} | java | protected String resolveSpanName(HttpRequest<?> request) {
Optional<String> route = request.getAttribute(HttpAttributes.URI_TEMPLATE, String.class);
return route.map(s -> request.getMethod() + " " + s).orElse(request.getMethod() + " " + request.getPath());
} | [
"protected",
"String",
"resolveSpanName",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
")",
"{",
"Optional",
"<",
"String",
">",
"route",
"=",
"request",
".",
"getAttribute",
"(",
"HttpAttributes",
".",
"URI_TEMPLATE",
",",
"String",
".",
"class",
")",
";",... | Resolve the span name to use for the request.
@param request The request
@return The span name | [
"Resolve",
"the",
"span",
"name",
"to",
"use",
"for",
"the",
"request",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java#L96-L99 |
129,877 | micronaut-projects/micronaut-core | tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java | AbstractOpenTracingFilter.newSpan | protected Tracer.SpanBuilder newSpan(HttpRequest<?> request, SpanContext spanContext) {
String spanName = resolveSpanName(request);
Tracer.SpanBuilder spanBuilder = tracer.buildSpan(
spanName
).asChildOf(spanContext);
spanBuilder.withTag(TAG_METHOD, request.getMethod().n... | java | protected Tracer.SpanBuilder newSpan(HttpRequest<?> request, SpanContext spanContext) {
String spanName = resolveSpanName(request);
Tracer.SpanBuilder spanBuilder = tracer.buildSpan(
spanName
).asChildOf(spanContext);
spanBuilder.withTag(TAG_METHOD, request.getMethod().n... | [
"protected",
"Tracer",
".",
"SpanBuilder",
"newSpan",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
",",
"SpanContext",
"spanContext",
")",
"{",
"String",
"spanName",
"=",
"resolveSpanName",
"(",
"request",
")",
";",
"Tracer",
".",
"SpanBuilder",
"spanBuilder",
... | Creates a new span for the given request and span context.
@param request The request
@param spanContext The span context
@return The span builder | [
"Creates",
"a",
"new",
"span",
"for",
"the",
"given",
"request",
"and",
"span",
"context",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java#L108-L118 |
129,878 | micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/uri/UriMatchTemplate.java | UriMatchTemplate.toPathString | public String toPathString() {
return toString(pathSegment -> {
final Optional<String> var = pathSegment.getVariable();
if (var.isPresent()) {
final Optional<UriMatchVariable> umv = variables.stream()
.filter(v -> v.getName().equals(var.get())).fin... | java | public String toPathString() {
return toString(pathSegment -> {
final Optional<String> var = pathSegment.getVariable();
if (var.isPresent()) {
final Optional<UriMatchVariable> umv = variables.stream()
.filter(v -> v.getName().equals(var.get())).fin... | [
"public",
"String",
"toPathString",
"(",
")",
"{",
"return",
"toString",
"(",
"pathSegment",
"->",
"{",
"final",
"Optional",
"<",
"String",
">",
"var",
"=",
"pathSegment",
".",
"getVariable",
"(",
")",
";",
"if",
"(",
"var",
".",
"isPresent",
"(",
")",
... | Returns the path string excluding any query variables.
@return The path string | [
"Returns",
"the",
"path",
"string",
"excluding",
"any",
"query",
"variables",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/uri/UriMatchTemplate.java#L108-L123 |
129,879 | micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/uri/UriMatchTemplate.java | UriMatchTemplate.match | @Override
public Optional<UriMatchInfo> match(String uri) {
if (uri == null) {
throw new IllegalArgumentException("Argument 'uri' cannot be null");
}
if (uri.length() > 1 && uri.charAt(uri.length() - 1) == '/') {
uri = uri.substring(0, uri.length() - 1);
}
... | java | @Override
public Optional<UriMatchInfo> match(String uri) {
if (uri == null) {
throw new IllegalArgumentException("Argument 'uri' cannot be null");
}
if (uri.length() > 1 && uri.charAt(uri.length() - 1) == '/') {
uri = uri.substring(0, uri.length() - 1);
}
... | [
"@",
"Override",
"public",
"Optional",
"<",
"UriMatchInfo",
">",
"match",
"(",
"String",
"uri",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'uri' cannot be null\"",
")",
";",
"}",
"if",
"("... | Match the given URI string.
@param uri The uRI
@return True if it matches | [
"Match",
"the",
"given",
"URI",
"string",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/uri/UriMatchTemplate.java#L131-L169 |
129,880 | micronaut-projects/micronaut-core | spring/src/main/java/io/micronaut/spring/tx/annotation/BindableRuleBasedTransactionAttribute.java | BindableRuleBasedTransactionAttribute.setNoRollbackFor | public final void setNoRollbackFor(Class<? extends Throwable>... exceptions) {
if (ArrayUtils.isNotEmpty(exceptions)) {
noRollbackFor.addAll(Arrays.asList(exceptions));
}
} | java | public final void setNoRollbackFor(Class<? extends Throwable>... exceptions) {
if (ArrayUtils.isNotEmpty(exceptions)) {
noRollbackFor.addAll(Arrays.asList(exceptions));
}
} | [
"public",
"final",
"void",
"setNoRollbackFor",
"(",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"...",
"exceptions",
")",
"{",
"if",
"(",
"ArrayUtils",
".",
"isNotEmpty",
"(",
"exceptions",
")",
")",
"{",
"noRollbackFor",
".",
"addAll",
"(",
"Arrays",
... | Configures the exceptions to not rollback for.
@param exceptions The exceptions not to rollback for | [
"Configures",
"the",
"exceptions",
"to",
"not",
"rollback",
"for",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/spring/src/main/java/io/micronaut/spring/tx/annotation/BindableRuleBasedTransactionAttribute.java#L43-L47 |
129,881 | micronaut-projects/micronaut-core | spring/src/main/java/io/micronaut/spring/tx/annotation/BindableRuleBasedTransactionAttribute.java | BindableRuleBasedTransactionAttribute.setRollbackFor | public final void setRollbackFor(Class<? extends Throwable>... exceptions) {
if (ArrayUtils.isNotEmpty(exceptions)) {
if (rollbackFor == null) {
rollbackFor = new HashSet<>();
}
rollbackFor.addAll(Arrays.asList(exceptions));
}
} | java | public final void setRollbackFor(Class<? extends Throwable>... exceptions) {
if (ArrayUtils.isNotEmpty(exceptions)) {
if (rollbackFor == null) {
rollbackFor = new HashSet<>();
}
rollbackFor.addAll(Arrays.asList(exceptions));
}
} | [
"public",
"final",
"void",
"setRollbackFor",
"(",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"...",
"exceptions",
")",
"{",
"if",
"(",
"ArrayUtils",
".",
"isNotEmpty",
"(",
"exceptions",
")",
")",
"{",
"if",
"(",
"rollbackFor",
"==",
"null",
")",
"{... | Configures the exceptions to rollback for.
@param exceptions The exceptions to rollback for | [
"Configures",
"the",
"exceptions",
"to",
"rollback",
"for",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/spring/src/main/java/io/micronaut/spring/tx/annotation/BindableRuleBasedTransactionAttribute.java#L54-L61 |
129,882 | micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/EC2ServiceInstance.java | EC2ServiceInstance.metadata | @Override
public Builder metadata(Map<String, String> metadata) {
if (metadata != null) {
this.metadata = ConvertibleValues.of(metadata);
}
return this;
} | java | @Override
public Builder metadata(Map<String, String> metadata) {
if (metadata != null) {
this.metadata = ConvertibleValues.of(metadata);
}
return this;
} | [
"@",
"Override",
"public",
"Builder",
"metadata",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"metadata",
")",
"{",
"if",
"(",
"metadata",
"!=",
"null",
")",
"{",
"this",
".",
"metadata",
"=",
"ConvertibleValues",
".",
"of",
"(",
"metadata",
")",
";... | Builder for metadata in map format.
@param metadata The metadata in map format
@return builder | [
"Builder",
"for",
"metadata",
"in",
"map",
"format",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/EC2ServiceInstance.java#L213-L219 |
129,883 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/clhm/LinkedDeque.java | LinkedDeque.unlink | private void unlink(E e) {
final E prev = e.getPrevious();
final E next = e.getNext();
if (prev == null) {
first = next;
} else {
prev.setNext(next);
e.setPrevious(null);
}
if (next == null) {
last = prev;
} else {... | java | private void unlink(E e) {
final E prev = e.getPrevious();
final E next = e.getNext();
if (prev == null) {
first = next;
} else {
prev.setNext(next);
e.setPrevious(null);
}
if (next == null) {
last = prev;
} else {... | [
"private",
"void",
"unlink",
"(",
"E",
"e",
")",
"{",
"final",
"E",
"prev",
"=",
"e",
".",
"getPrevious",
"(",
")",
";",
"final",
"E",
"next",
"=",
"e",
".",
"getNext",
"(",
")",
";",
"if",
"(",
"prev",
"==",
"null",
")",
"{",
"first",
"=",
"... | Unlinks the non-null element. | [
"Unlinks",
"the",
"non",
"-",
"null",
"element",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/clhm/LinkedDeque.java#L138-L155 |
129,884 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/clhm/LinkedDeque.java | LinkedDeque.contains | boolean contains(Linked<?> e) {
return (e.getPrevious() != null)
|| (e.getNext() != null)
|| (e == first);
} | java | boolean contains(Linked<?> e) {
return (e.getPrevious() != null)
|| (e.getNext() != null)
|| (e == first);
} | [
"boolean",
"contains",
"(",
"Linked",
"<",
"?",
">",
"e",
")",
"{",
"return",
"(",
"e",
".",
"getPrevious",
"(",
")",
"!=",
"null",
")",
"||",
"(",
"e",
".",
"getNext",
"(",
")",
"!=",
"null",
")",
"||",
"(",
"e",
"==",
"first",
")",
";",
"}"... | check whether the linked is contained within this linked deque.
@param e The linked
@return True if it is | [
"check",
"whether",
"the",
"linked",
"is",
"contained",
"within",
"this",
"linked",
"deque",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/clhm/LinkedDeque.java#L202-L206 |
129,885 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/retry/intercept/RecoveryInterceptor.java | RecoveryInterceptor.findFallbackMethod | public Optional<? extends MethodExecutionHandle<?, Object>> findFallbackMethod(MethodInvocationContext<Object, Object> context) {
Class<?> declaringType = context.getDeclaringType();
Optional<? extends MethodExecutionHandle<?, Object>> result = beanContext
.findExecutionHandle(declaringT... | java | public Optional<? extends MethodExecutionHandle<?, Object>> findFallbackMethod(MethodInvocationContext<Object, Object> context) {
Class<?> declaringType = context.getDeclaringType();
Optional<? extends MethodExecutionHandle<?, Object>> result = beanContext
.findExecutionHandle(declaringT... | [
"public",
"Optional",
"<",
"?",
"extends",
"MethodExecutionHandle",
"<",
"?",
",",
"Object",
">",
">",
"findFallbackMethod",
"(",
"MethodInvocationContext",
"<",
"Object",
",",
"Object",
">",
"context",
")",
"{",
"Class",
"<",
"?",
">",
"declaringType",
"=",
... | Finds a fallback method for the given context.
@param context The context
@return The fallback method if it is present | [
"Finds",
"a",
"fallback",
"method",
"for",
"the",
"given",
"context",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/retry/intercept/RecoveryInterceptor.java#L128-L143 |
129,886 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/retry/intercept/RecoveryInterceptor.java | RecoveryInterceptor.resolveFallback | protected Object resolveFallback(MethodInvocationContext<Object, Object> context, RuntimeException exception) {
if (exception instanceof NoAvailableServiceException) {
NoAvailableServiceException nase = (NoAvailableServiceException) exception;
if (LOG.isErrorEnabled()) {
... | java | protected Object resolveFallback(MethodInvocationContext<Object, Object> context, RuntimeException exception) {
if (exception instanceof NoAvailableServiceException) {
NoAvailableServiceException nase = (NoAvailableServiceException) exception;
if (LOG.isErrorEnabled()) {
... | [
"protected",
"Object",
"resolveFallback",
"(",
"MethodInvocationContext",
"<",
"Object",
",",
"Object",
">",
"context",
",",
"RuntimeException",
"exception",
")",
"{",
"if",
"(",
"exception",
"instanceof",
"NoAvailableServiceException",
")",
"{",
"NoAvailableServiceExce... | Resolves a fallback for the given execution context and exception.
@param context The context
@param exception The exception
@return Returns the fallback value or throws the original exception | [
"Resolves",
"a",
"fallback",
"for",
"the",
"given",
"execution",
"context",
"and",
"exception",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/retry/intercept/RecoveryInterceptor.java#L196-L223 |
129,887 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/qualifiers/TypeArgumentQualifier.java | TypeArgumentQualifier.areTypesCompatible | public static boolean areTypesCompatible(Class[] typeArguments, List<Class> classToCompare) {
if (classToCompare.size() == 0) {
// in this case the type doesn't specify type arguments, so this is the equivalent of using Object
return true;
} else {
if (classToCompare.... | java | public static boolean areTypesCompatible(Class[] typeArguments, List<Class> classToCompare) {
if (classToCompare.size() == 0) {
// in this case the type doesn't specify type arguments, so this is the equivalent of using Object
return true;
} else {
if (classToCompare.... | [
"public",
"static",
"boolean",
"areTypesCompatible",
"(",
"Class",
"[",
"]",
"typeArguments",
",",
"List",
"<",
"Class",
">",
"classToCompare",
")",
"{",
"if",
"(",
"classToCompare",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"// in this case the type doesn't... | Are the given types compatible.
@param typeArguments The type arguments
@param classToCompare The classes to check for alignments
@return True if they are | [
"Are",
"the",
"given",
"types",
"compatible",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/qualifiers/TypeArgumentQualifier.java#L116-L137 |
129,888 | micronaut-projects/micronaut-core | inject-java/src/main/java/io/micronaut/annotation/processing/visitor/LoadedVisitor.java | LoadedVisitor.visit | public @Nullable io.micronaut.inject.ast.Element visit(
Element element, AnnotationMetadata annotationMetadata) {
if (element instanceof VariableElement) {
final JavaFieldElement e = new JavaFieldElement(
(VariableElement) element,
annotationMetada... | java | public @Nullable io.micronaut.inject.ast.Element visit(
Element element, AnnotationMetadata annotationMetadata) {
if (element instanceof VariableElement) {
final JavaFieldElement e = new JavaFieldElement(
(VariableElement) element,
annotationMetada... | [
"public",
"@",
"Nullable",
"io",
".",
"micronaut",
".",
"inject",
".",
"ast",
".",
"Element",
"visit",
"(",
"Element",
"element",
",",
"AnnotationMetadata",
"annotationMetadata",
")",
"{",
"if",
"(",
"element",
"instanceof",
"VariableElement",
")",
"{",
"final... | Invoke the underlying visitor for the given element.
@param element The element to visit
@param annotationMetadata The annotation data for the node
@return The element if one was created or null | [
"Invoke",
"the",
"underlying",
"visitor",
"for",
"the",
"given",
"element",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/visitor/LoadedVisitor.java#L123-L183 |
129,889 | micronaut-projects/micronaut-core | configurations/hibernate-validator/src/main/java/io/micronaut/configuration/hibernate/validator/ValidatorFactoryProvider.java | ValidatorFactoryProvider.validatorFactory | @Singleton
@Requires(classes = HibernateValidator.class)
ValidatorFactory validatorFactory(Optional<Environment> environment) {
Configuration validatorConfiguration = Validation.byDefaultProvider()
.configure();
messageInterpolator.ifPresent(validatorConfiguration::messageInterpolat... | java | @Singleton
@Requires(classes = HibernateValidator.class)
ValidatorFactory validatorFactory(Optional<Environment> environment) {
Configuration validatorConfiguration = Validation.byDefaultProvider()
.configure();
messageInterpolator.ifPresent(validatorConfiguration::messageInterpolat... | [
"@",
"Singleton",
"@",
"Requires",
"(",
"classes",
"=",
"HibernateValidator",
".",
"class",
")",
"ValidatorFactory",
"validatorFactory",
"(",
"Optional",
"<",
"Environment",
">",
"environment",
")",
"{",
"Configuration",
"validatorConfiguration",
"=",
"Validation",
... | Produces a Validator factory class.
@param environment optional param for environment
@return validator factory | [
"Produces",
"a",
"Validator",
"factory",
"class",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/configurations/hibernate-validator/src/main/java/io/micronaut/configuration/hibernate/validator/ValidatorFactoryProvider.java#L69-L98 |
129,890 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/DefaultApplicationContext.java | DefaultApplicationContext.startEnvironment | protected void startEnvironment() {
Environment defaultEnvironment = getEnvironment();
defaultEnvironment.start();
registerSingleton(Environment.class, defaultEnvironment);
registerSingleton(new AnnotationProcessorListener());
} | java | protected void startEnvironment() {
Environment defaultEnvironment = getEnvironment();
defaultEnvironment.start();
registerSingleton(Environment.class, defaultEnvironment);
registerSingleton(new AnnotationProcessorListener());
} | [
"protected",
"void",
"startEnvironment",
"(",
")",
"{",
"Environment",
"defaultEnvironment",
"=",
"getEnvironment",
"(",
")",
";",
"defaultEnvironment",
".",
"start",
"(",
")",
";",
"registerSingleton",
"(",
"Environment",
".",
"class",
",",
"defaultEnvironment",
... | Start the environment. | [
"Start",
"the",
"environment",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultApplicationContext.java#L226-L231 |
129,891 | micronaut-projects/micronaut-core | http/src/main/java/io/micronaut/http/ssl/SslConfiguration.java | SslConfiguration.readExisting | protected final void readExisting(
SslConfiguration defaultSslConfiguration,
KeyConfiguration defaultKeyConfiguration,
KeyStoreConfiguration defaultKeyStoreConfiguration,
TrustStoreConfiguration defaultTrustStoreConfiguration) {
if (defaultKeyConfiguration != null... | java | protected final void readExisting(
SslConfiguration defaultSslConfiguration,
KeyConfiguration defaultKeyConfiguration,
KeyStoreConfiguration defaultKeyStoreConfiguration,
TrustStoreConfiguration defaultTrustStoreConfiguration) {
if (defaultKeyConfiguration != null... | [
"protected",
"final",
"void",
"readExisting",
"(",
"SslConfiguration",
"defaultSslConfiguration",
",",
"KeyConfiguration",
"defaultKeyConfiguration",
",",
"KeyStoreConfiguration",
"defaultKeyStoreConfiguration",
",",
"TrustStoreConfiguration",
"defaultTrustStoreConfiguration",
")",
... | Reads an existing config.
@param defaultSslConfiguration The default SSL config
@param defaultKeyConfiguration The default key config
@param defaultKeyStoreConfiguration The default keystore config
@param defaultTrustStoreConfiguration The Default truststore config | [
"Reads",
"an",
"existing",
"config",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/ssl/SslConfiguration.java#L244-L267 |
129,892 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/env/DefaultEnvironment.java | DefaultEnvironment.readPropertySourceListFromFiles | protected List<PropertySource> readPropertySourceListFromFiles(String files) {
List<PropertySource> propertySources = new ArrayList<>();
Collection<PropertySourceLoader> propertySourceLoaders = getPropertySourceLoaders();
Optional<Collection<String>> filePathList = Optional.ofNullable(files)
... | java | protected List<PropertySource> readPropertySourceListFromFiles(String files) {
List<PropertySource> propertySources = new ArrayList<>();
Collection<PropertySourceLoader> propertySourceLoaders = getPropertySourceLoaders();
Optional<Collection<String>> filePathList = Optional.ofNullable(files)
... | [
"protected",
"List",
"<",
"PropertySource",
">",
"readPropertySourceListFromFiles",
"(",
"String",
"files",
")",
"{",
"List",
"<",
"PropertySource",
">",
"propertySources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Collection",
"<",
"PropertySourceLoader",
">... | Resolve the property sources for files passed via system property and system env.
@param files The comma separated list of files
@return The list of property sources for each file | [
"Resolve",
"the",
"property",
"sources",
"for",
"files",
"passed",
"via",
"system",
"property",
"and",
"system",
"env",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/env/DefaultEnvironment.java#L479-L508 |
129,893 | micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/env/DefaultEnvironment.java | DefaultEnvironment.readPropertySourceFromLoader | private void readPropertySourceFromLoader(String fileName, String filePath, PropertySourceLoader propertySourceLoader, List<PropertySource> propertySources) throws ConfigurationException {
ResourceResolver resourceResolver = new ResourceResolver();
Optional<ResourceLoader> resourceLoader = resourceResol... | java | private void readPropertySourceFromLoader(String fileName, String filePath, PropertySourceLoader propertySourceLoader, List<PropertySource> propertySources) throws ConfigurationException {
ResourceResolver resourceResolver = new ResourceResolver();
Optional<ResourceLoader> resourceLoader = resourceResol... | [
"private",
"void",
"readPropertySourceFromLoader",
"(",
"String",
"fileName",
",",
"String",
"filePath",
",",
"PropertySourceLoader",
"propertySourceLoader",
",",
"List",
"<",
"PropertySource",
">",
"propertySources",
")",
"throws",
"ConfigurationException",
"{",
"Resourc... | Read the property source.
@param fileName Name of the file to be used as property source name
@param filePath Absolute file path
@param propertySourceLoader The appropriate property source loader
@param propertySources List of property sources to add to
@throws ConfigurationException If un... | [
"Read",
"the",
"property",
"source",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/env/DefaultEnvironment.java#L599-L612 |
129,894 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java | AnnotationValue.builder | public static <T extends Annotation> AnnotationValueBuilder<T> builder(Class<T> annotation) {
return new AnnotationValueBuilder<>(annotation);
} | java | public static <T extends Annotation> AnnotationValueBuilder<T> builder(Class<T> annotation) {
return new AnnotationValueBuilder<>(annotation);
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"AnnotationValueBuilder",
"<",
"T",
">",
"builder",
"(",
"Class",
"<",
"T",
">",
"annotation",
")",
"{",
"return",
"new",
"AnnotationValueBuilder",
"<>",
"(",
"annotation",
")",
";",
"}"
] | Start building a new annotation for the given name.
@param annotation The annotation name
@param <T> The annotation type
@return The builder | [
"Start",
"building",
"a",
"new",
"annotation",
"for",
"the",
"given",
"name",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java#L328-L330 |
129,895 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java | AnnotationValue.newConvertibleValues | private ConvertibleValues<Object> newConvertibleValues(Map<CharSequence, Object> values) {
if (CollectionUtils.isEmpty(values)) {
return ConvertibleValues.EMPTY;
} else {
return ConvertibleValues.of(values);
}
} | java | private ConvertibleValues<Object> newConvertibleValues(Map<CharSequence, Object> values) {
if (CollectionUtils.isEmpty(values)) {
return ConvertibleValues.EMPTY;
} else {
return ConvertibleValues.of(values);
}
} | [
"private",
"ConvertibleValues",
"<",
"Object",
">",
"newConvertibleValues",
"(",
"Map",
"<",
"CharSequence",
",",
"Object",
">",
"values",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isEmpty",
"(",
"values",
")",
")",
"{",
"return",
"ConvertibleValues",
".",... | Subclasses can override to provide a custom convertible values instance.
@param values The values
@return The instance | [
"Subclasses",
"can",
"override",
"to",
"provide",
"a",
"custom",
"convertible",
"values",
"instance",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/annotation/AnnotationValue.java#L338-L344 |
129,896 | micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/discovery/cloud/ComputeInstanceMetadataResolverUtils.java | ComputeInstanceMetadataResolverUtils.stringValue | public static Optional<String> stringValue(JsonNode json, String key) {
return Optional.ofNullable(json.findValue(key)).map(JsonNode::asText);
} | java | public static Optional<String> stringValue(JsonNode json, String key) {
return Optional.ofNullable(json.findValue(key)).map(JsonNode::asText);
} | [
"public",
"static",
"Optional",
"<",
"String",
">",
"stringValue",
"(",
"JsonNode",
"json",
",",
"String",
"key",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"json",
".",
"findValue",
"(",
"key",
")",
")",
".",
"map",
"(",
"JsonNode",
"::",
... | Resolve a value as a string from the metadata json.
@param json The json
@param key The key
@return An optional value | [
"Resolve",
"a",
"value",
"as",
"a",
"string",
"from",
"the",
"metadata",
"json",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/discovery/cloud/ComputeInstanceMetadataResolverUtils.java#L80-L82 |
129,897 | micronaut-projects/micronaut-core | configurations/hibernate-validator/src/main/java/io/micronaut/configuration/hibernate/validator/DefaultParameterNameProvider.java | DefaultParameterNameProvider.defaultParameterTypes | protected List<String> defaultParameterTypes(Class<?>[] parameterTypes) {
List<String> names = new ArrayList<>();
for (int i = 0; i < parameterTypes.length; i++) {
names.add("arg" + i);
}
return names;
} | java | protected List<String> defaultParameterTypes(Class<?>[] parameterTypes) {
List<String> names = new ArrayList<>();
for (int i = 0; i < parameterTypes.length; i++) {
names.add("arg" + i);
}
return names;
} | [
"protected",
"List",
"<",
"String",
">",
"defaultParameterTypes",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"{",
"List",
"<",
"String",
">",
"names",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Add the parameter types to a list of names.
@param parameterTypes parameterTypes
@return list of strings | [
"Add",
"the",
"parameter",
"types",
"to",
"a",
"list",
"of",
"names",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/configurations/hibernate-validator/src/main/java/io/micronaut/configuration/hibernate/validator/DefaultParameterNameProvider.java#L90-L96 |
129,898 | micronaut-projects/micronaut-core | management/src/main/java/io/micronaut/management/health/indicator/AbstractHealthIndicator.java | AbstractHealthIndicator.getHealthResult | protected HealthResult getHealthResult() {
HealthResult.Builder builder = HealthResult.builder(getName());
try {
builder.details(getHealthInformation());
builder.status(this.healthStatus);
} catch (Exception e) {
builder.status(HealthStatus.DOWN);
... | java | protected HealthResult getHealthResult() {
HealthResult.Builder builder = HealthResult.builder(getName());
try {
builder.details(getHealthInformation());
builder.status(this.healthStatus);
} catch (Exception e) {
builder.status(HealthStatus.DOWN);
... | [
"protected",
"HealthResult",
"getHealthResult",
"(",
")",
"{",
"HealthResult",
".",
"Builder",
"builder",
"=",
"HealthResult",
".",
"builder",
"(",
"getName",
"(",
")",
")",
";",
"try",
"{",
"builder",
".",
"details",
"(",
"getHealthInformation",
"(",
")",
"... | Builds the whole health result.
@return The health result to provide to the indicator. | [
"Builds",
"the",
"whole",
"health",
"result",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/management/src/main/java/io/micronaut/management/health/indicator/AbstractHealthIndicator.java#L69-L79 |
129,899 | micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.recordRead | long recordRead(int bufferIndex, Node<K, V> node) {
// The location in the buffer is chosen in a racy fashion as the increment
// is not atomic with the insertion. This means that concurrent reads can
// overlap and overwrite one another, resulting in a lossy buffer.
final AtomicLong cou... | java | long recordRead(int bufferIndex, Node<K, V> node) {
// The location in the buffer is chosen in a racy fashion as the increment
// is not atomic with the insertion. This means that concurrent reads can
// overlap and overwrite one another, resulting in a lossy buffer.
final AtomicLong cou... | [
"long",
"recordRead",
"(",
"int",
"bufferIndex",
",",
"Node",
"<",
"K",
",",
"V",
">",
"node",
")",
"{",
"// The location in the buffer is chosen in a racy fashion as the increment",
"// is not atomic with the insertion. This means that concurrent reads can",
"// overlap and overwr... | Records a read in the buffer and return its write count.
@param bufferIndex the index to the chosen read buffer
@param node the entry in the page replacement policy
@return the number of writes on the chosen read buffer | [
"Records",
"a",
"read",
"in",
"the",
"buffer",
"and",
"return",
"its",
"write",
"count",
"."
] | c31f5b03ce0eb88c2f6470710987db03b8967d5c | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java#L360-L372 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.