Skip to content

Commit

Permalink
More checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskleeh committed Aug 2, 2018
1 parent cf038fd commit 899b0f6
Show file tree
Hide file tree
Showing 29 changed files with 48 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package io.micronaut.configuration.jdbc.hikari;

import io.micronaut.context.annotation.Bean;
import io.micronaut.context.annotation.EachBean;
import io.micronaut.context.annotation.Factory;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package io.micronaut.configuration.jdbc.tomcat;

import io.micronaut.context.annotation.Bean;
import io.micronaut.context.annotation.EachBean;
import io.micronaut.context.annotation.Factory;
import org.slf4j.Logger;
Expand Down Expand Up @@ -64,5 +63,4 @@ public void close() {
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,22 @@
*
* @author graemerocher
* @since 1.0
* @param <K>
* @param <V>
* @param <K> The key deserializer type
* @param <V> The value deserializer type
*/
public class AbtractKafkaStreamsConfiguration<K, V> extends AbstractKafkaConfiguration<K, V> {
public class AbstractKafkaStreamsConfiguration<K, V> extends AbstractKafkaConfiguration<K, V> {

/**
* Construct a new {@link KafkaStreamsConfiguration} for the given defaults.
*
* @param defaultConfiguration The default configuration
*/
protected AbtractKafkaStreamsConfiguration(KafkaDefaultConfiguration defaultConfiguration) {
protected AbstractKafkaStreamsConfiguration(KafkaDefaultConfiguration defaultConfiguration) {
super(new Properties());
Properties config = getConfig();
config.putAll(defaultConfiguration.getConfig());
}

/**
* Shared initialization.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@Requires(beans = KafkaDefaultConfiguration.class)
@Named("default")
@Primary
public class DefaultKafkaStreamsConfiguration<K, V> extends AbtractKafkaStreamsConfiguration<K, V> {
public class DefaultKafkaStreamsConfiguration<K, V> extends AbstractKafkaStreamsConfiguration<K, V> {
/**
* Construct a new {@link KafkaStreamsConfiguration} for the given defaults.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
@EachProperty(value = PREFIX, primary = "default")
@Requires(beans = KafkaDefaultConfiguration.class)
public class KafkaStreamsConfiguration<K, V> extends AbtractKafkaStreamsConfiguration<K, V> {
public class KafkaStreamsConfiguration<K, V> extends AbstractKafkaStreamsConfiguration<K, V> {

/**
* The default streams configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@
public class KafkaStreamsFactory implements Closeable {

private final Collection<KafkaStreams> streams = new ConcurrentLinkedDeque<>();

/**
* Exposes the {@link ConfiguredStreamBuilder} as a bean.
*
* @param configuration The configuration
* @return The streams builder
*/
@EachBean(AbtractKafkaStreamsConfiguration.class)
ConfiguredStreamBuilder streamsBuilder(AbtractKafkaStreamsConfiguration configuration) {
@EachBean(AbstractKafkaStreamsConfiguration.class)
ConfiguredStreamBuilder streamsBuilder(AbstractKafkaStreamsConfiguration configuration) {
return new ConfiguredStreamBuilder(configuration.getConfig());
}

Expand All @@ -55,7 +56,7 @@ ConfiguredStreamBuilder streamsBuilder(AbtractKafkaStreamsConfiguration configur
* @param kStreams The KStream definitions
* @return The {@link KafkaStreams} bean
*/
@EachBean(AbtractKafkaStreamsConfiguration.class)
@EachBean(AbstractKafkaStreamsConfiguration.class)
@Context
KafkaStreams kafkaStreams(
ConfiguredStreamBuilder builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;

/**
* Implementation of the {@link io.micronaut.configuration.kafka.annotation.KafkaClient} advice annotation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import javax.annotation.Nullable;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import io.micronaut.context.annotation.Requires;
import io.micronaut.runtime.context.scope.Refreshable;

import javax.inject.Singleton;

/**
* Factory for the default {@link MongoClient}. Creates the injectable {@link Primary} bean
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import io.micronaut.context.annotation.Factory;
import io.micronaut.runtime.context.scope.Refreshable;

import javax.inject.Singleton;

/**
* Factory for named {@link MongoClient} instances. Creates the injectable {@link io.micronaut.context.annotation.Primary} bean
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/
public interface AnnotationMetadataDelegate extends AnnotationMetadataProvider, AnnotationMetadata {


@Override
default <T extends Annotation> T synthesizeDeclared(Class<T> annotationClass) {
return getAnnotationMetadata().synthesizeDeclared(annotationClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @since 1.0
*/
public interface AnnotationSource {

/**
* An empty annotation source.
*/
Expand Down Expand Up @@ -204,6 +205,7 @@ default <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotati
default @Nullable <T extends Annotation> AnnotationValue<T> getDeclaredAnnotation(Class<T> annotation) {
return this.findDeclaredAnnotation(annotation).orElse(null);
}

/**
* Return whether an annotation is present.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ public void process(BeanDefinition<?> beanDefinition, ExecutableMethod<?, ?> met
route.produces(MediaType.TEXT_PLAIN_TYPE, MediaType.APPLICATION_JSON_TYPE);
}
}
}
else {
} else {
if (argCount == 1 && ClassUtils.isJavaLangType(method.getArgumentTypes()[0])) {
route.consumes(MediaType.TEXT_PLAIN_TYPE, MediaType.APPLICATION_JSON_TYPE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ private String appendQuery(String uri, Map<String, String> queryParams) {

return new URI(oldUri.getScheme(), oldUri.getAuthority(), oldUri.getPath(),
sb.toString(), oldUri.getFragment()).toString();
} catch (URISyntaxException|UnsupportedEncodingException e) {
} catch (URISyntaxException | UnsupportedEncodingException e) {
//no-op
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ public io.netty.handler.codec.http.HttpHeaders getNettyHeaders() {
}

/**
* @return The underlying Netty headers.
* Sets the underlying netty headers.
*
* @param headers The Netty http headers
*/
void setNettyHeaders(io.netty.handler.codec.http.HttpHeaders headers) {
this.nettyHeaders = headers;
}


@Override
public <T> Optional<T> get(CharSequence name, ArgumentConversionContext<T> conversionContext) {
String value = nettyHeaders.get(name);
if (value != null) {
return conversionService.convert(value, conversionContext);
}
return Optional.empty();

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
*/
@Produces(MediaType.APPLICATION_HAL_JSON)
public abstract class AbstractResource<Impl extends AbstractResource> implements Resource {

private final Map<CharSequence, List<Link>> linkMap = new LinkedHashMap<>(1);
private final Map<CharSequence, List<Resource>> embeddedMap = new LinkedHashMap<>(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class SimpleHttpParameters implements MutableHttpParameters {
private final ConvertibleMultiValues<String> values;

/**
* @param values The parameter values
* @param conversionService The conversion service
*/
public SimpleHttpParameters(Map<CharSequence, List<String>> values, ConversionService conversionService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ public <T> MutableHttpResponse<T> status(HttpStatus status, T body) {
return new SimpleHttpResponse<T>().status(status).body(body);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ public Collection<Cookie> values() {
public Cookie put(CharSequence name, Cookie cookie) {
return cookies.put(name, cookie);
}
}
}
4 changes: 3 additions & 1 deletion http/src/main/java/io/micronaut/http/uri/UriTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ public int hashCode() {

@Override
public int compareTo(UriTemplate o) {
if (this == o) return 0;
if (this == o) {
return 0;
}

List<PathSegment> thisSegments = this.segments;
List<PathSegment> thatSegments = o.segments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.ast.groovy

import io.micronaut.ast.groovy.utils.ExtendedParameter
import io.micronaut.context.annotation.Property
import io.micronaut.context.annotation.PropertySource
import io.micronaut.core.annotation.AnnotationValue
import io.micronaut.core.util.CollectionUtils
import io.micronaut.core.util.StringUtils
import io.micronaut.inject.annotation.DefaultAnnotationMetadata
import io.micronaut.inject.configuration.ConfigurationMetadata
import io.micronaut.inject.configuration.PropertyMetadata
import io.micronaut.inject.writer.DirectoryClassWriterOutputVisitor

import javax.lang.model.element.Element
import javax.lang.model.element.TypeElement
import javax.lang.model.type.DeclaredType
import javax.lang.model.type.TypeKind
import javax.lang.model.type.TypeMirror

import static org.codehaus.groovy.ast.ClassHelper.makeCached
import static org.codehaus.groovy.ast.tools.GeneralUtils.getGetterName
import static org.codehaus.groovy.ast.tools.GeneralUtils.getSetterName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
/*
* Copyright 2017-2018 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.ast.groovy.utils;

import io.micronaut.core.annotation.Internal;
import org.codehaus.groovy.ast.AnnotatedNode;
import org.codehaus.groovy.ast.MethodNode;
import org.codehaus.groovy.ast.Parameter;

import java.util.Objects;

/**
* This class was created to pass to the {@link io.micronaut.ast.groovy.annotation.GroovyAnnotationMetadataBuilder} because
* the method node the parameter belongs to is not available from the {@link org.codehaus.groovy.ast.Parameter} class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import javax.inject.Singleton;
import java.lang.annotation.Annotation;
import java.util.Collection;

/**
* A processor that processes references to {@link Delete} operations {@link io.micronaut.management.endpoint.annotation.Endpoint}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import javax.inject.Singleton;
import java.lang.annotation.Annotation;
import java.util.Collection;

/**
* A processor that processes references to {@link Read} operations {@link io.micronaut.management.endpoint.annotation.Endpoint}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import javax.inject.Singleton;
import java.lang.annotation.Annotation;
import java.util.Collection;

/**
* A processor that processes references to {@link Write} operations {@link io.micronaut.management.endpoint.annotation.Endpoint}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,10 @@ default String resolveUri(Class<?> type) {
*/
default String resolveUri(BeanDefinition<?> beanDefinition) {
String uri = beanDefinition.getValue(Controller.class, String.class).orElse(null);
String x = normalizeUri(uri);
if (x != null) return x;
uri = normalizeUri(uri);
if (uri != null) {
return uri;
}
Class<?> beanType;
if (beanDefinition instanceof ProxyBeanDefinition) {
ProxyBeanDefinition pbd = (ProxyBeanDefinition) beanDefinition;
Expand Down Expand Up @@ -1205,7 +1207,8 @@ default String resolveUri(Class type, PropertyConvention id) {
}

/**
* Normalizes a URI, ensuring the first character starts with a /
* Normalizes a URI, ensuring the first character starts with a /.
*
* @param uri The URI
* @return The normalized URI or null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

import io.micronaut.http.HttpRequest;
import io.micronaut.management.endpoint.EndpointSensitivityProcessor;
import io.micronaut.management.endpoint.health.HealthEndpoint;
import io.micronaut.management.endpoint.processors.ReadEndpointRouteBuilder;
import io.micronaut.web.router.MethodBasedRouteMatch;
import io.micronaut.web.router.RouteMatch;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.micronaut.core.convert.ArgumentConversionContext;
import io.micronaut.core.convert.value.MutableConvertibleValues;
import io.micronaut.core.type.Argument;
import io.micronaut.core.util.StringUtils;
import io.micronaut.http.HttpRequest;
import io.micronaut.http.filter.OncePerRequestHttpServerFilter;
import io.micronaut.http.server.HttpServerConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.micronaut.core.convert.ArgumentConversionContext;
import io.micronaut.core.convert.value.MutableConvertibleValues;
import io.micronaut.core.type.Argument;
import io.micronaut.core.util.StringUtils;
import io.micronaut.http.HttpRequest;
import io.micronaut.http.filter.OncePerRequestHttpServerFilter;
import io.micronaut.http.server.HttpServerConfiguration;
Expand Down

0 comments on commit 899b0f6

Please sign in to comment.