Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated checkstyle plugin to latest 3.1.0 #4364

Merged
merged 2 commits into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -35,7 +35,7 @@
*
* @author Stepan Kopriva
*/
public class HttpHeadersTest extends JerseyTest{
public class HttpHeadersTest extends JerseyTest {
@Path("/test")
public static class HttpMethodResource {
@POST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018 Ian Kirk. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -52,4 +53,4 @@ public Principal getUserPrincipal() {
public String getAuthenticationScheme() {
return null;
}
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -51,7 +51,7 @@ public class JaxrsProviders implements Providers {
* <li>{@link Providers}</li>
* </ul>
*/
public static class ProvidersConfigurator implements BootstrapConfigurator{
public static class ProvidersConfigurator implements BootstrapConfigurator {

@Override
public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -417,7 +417,7 @@ public Flow.Subscription getSubscription() {
}
}

public enum PublisherStrategy{
public enum PublisherStrategy {
/**
* Blocking publisher strategy - tries to deliver to all subscribers regardless the cost.
*
Expand Down
28 changes: 17 additions & 11 deletions etc/config/checkstyle-verify.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -28,22 +28,25 @@
<property name="eachLine" value="true"/>
</module>

<module name="LineLength">
<property name="max" value="130"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|@see| \* |@link|TODO|@todo|@version"/>
<property name="fileExtensions" value="java"/>
</module>

<module name="TreeWalker">
<property name="tabWidth" value="4"/>

<module name="OuterTypeFilename"/>

<module name="LineLength">
<property name="max" value="130"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|@see| \* |@link|TODO|@todo|@version"/>
</module>

<module name="AvoidStarImport"/>
<!--<module name="UnusedImports"/>-->

<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="MethodParamPad"/>
<module name="MethodParamPad">
<property name="tokens" value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, SUPER_CTOR_CALL"/>
</module>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
Expand All @@ -60,13 +63,16 @@
<property name="allowSingleLineStatement" value="true"/>
</module>
<module name="LeftCurly">
<property name="maxLineLength" value="130"/>
<property name="tokens" value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
INTERFACE_DEF, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT,
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE,
METHOD_DEF, OBJBLOCK, STATIC_INIT" />
Verdent marked this conversation as resolved.
Show resolved Hide resolved
</module>
<module name="RightCurly"/>
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
value="LITERAL_FINALLY, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE"/>
</module>

<module name="WhitespaceAround">
Expand All @@ -88,7 +94,7 @@
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>

<module name="OneStatementPerLine"/>
<!-- <module name="OneStatementPerLine"/> -->
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
Expand Down
6 changes: 3 additions & 3 deletions etc/config/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -52,6 +52,7 @@
<property name="basedir" value="${basedir}"/>
-->
<property name="charset" value="UTF-8"/>
<property name="cacheFile" value="${checkstyle.cache.file}"/>

<!-- Checks that each Java package has a Javadoc file used for commenting. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
Expand Down Expand Up @@ -82,14 +83,13 @@
</module>-->

<module name="TreeWalker">
<property name="cacheFile" value="${checkstyle.cache.file}"/>
<property name="tabWidth" value="4"/>

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod">
<property name="scope" value="protected"/>
<property name="allowUndeclaredRTE" value="true"/>
<!-- <property name="allowUndeclaredRTE" value="true"/>-->
</module>
<module name="JavadocType">
<property name="scope" value="protected"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018 Payara Foundation and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -354,7 +354,7 @@ private boolean isManagedBean(final Class<?> component) {
}

private static AnnotatedConstructor<?> enrichedConstructor(final AnnotatedConstructor<?> ctor) {
return new AnnotatedConstructor(){
return new AnnotatedConstructor() {

@Override
public Constructor getJavaMember() {
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2077,8 +2077,8 @@
<cdi.api.version>1.1</cdi.api.version>
<commons-lang3.version>3.3.2</commons-lang3.version>
<config.version>1.2.1</config.version>
<checkstyle.mvn.plugin.version>2.16</checkstyle.mvn.plugin.version>
<checkstyle.version>6.8.1</checkstyle.version>
<checkstyle.mvn.plugin.version>3.1.0</checkstyle.mvn.plugin.version>
<checkstyle.version>8.28</checkstyle.version>
<easymock.version>3.3</easymock.version>
<ejb.version>3.2.5</ejb.version>
<gf.impl.version>5.1.0-RC2</gf.impl.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -31,7 +31,7 @@
*
* @author Petr Bouda
*/
public class EventsTest extends JerseyTest{
public class EventsTest extends JerseyTest {

@Override
protected Application configure() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -68,7 +68,7 @@ public static class ServerConstrainedInstanceFeature extends ServerConstrainedCl
{
increment = 100;
}
};
}

@ConstrainedTo(RuntimeType.CLIENT)
public static class ClientConstrainedClassFeature implements Feature {
Expand All @@ -87,7 +87,7 @@ public static class ClientConstrainedInstanceFeature extends ClientConstrainedCl
{
increment = 100;
}
};
}

public static class ClientServerConstrainedClassFeature implements Feature {
protected int increment = 10;
Expand All @@ -107,7 +107,7 @@ public static class ClientServerConstrainedInstanceFeature extends ClientServerC
{
increment = 100;
}
};
}

@Path("/")
public static class PropagatedConfigResource {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -41,7 +41,7 @@ public Hk2Application() {
Hk2OldFashionedResource.class);

register(new Hk2ValidationInterceptor.Binder());
register(new AbstractBinder(){
register(new AbstractBinder() {

@Override
protected void configure() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -34,7 +34,7 @@
*/
@Provider
@Stateless
public class CounterFilter implements ContainerResponseFilter{
public class CounterFilter implements ContainerResponseFilter {

public static final String RequestCountHEADER = "Request-Count";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -26,7 +26,7 @@
* @author Pavel Bucek
*/
@ApplicationPath("application_path")
public class Servlet25init5 extends Application{
public class Servlet25init5 extends Application {

@Override
public Set<Class<?>> getClasses() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -28,7 +28,7 @@
*/
public class JaxRsApplication extends Application {

static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>(){
static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>() {
{
add(DynamicallyBoundFilterResource.class);
add(DynamicFilterFeature.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -28,7 +28,7 @@
*/
public class JaxRsApplication extends Application {

static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>(){
static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>() {
{
add(TextEntityResource.class);
add(GlobalFilter.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -28,7 +28,7 @@
*/
public class JaxRsApplication extends Application {

static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>(){
static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>() {
{
add(NameBoundFilterResource.class);
add(NameBoundFilter.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -28,7 +28,7 @@
*/
public class JaxRsApplication extends Application {

static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>(){
static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>() {
{
add(DynamicallyBoundInterceptorResource.class);
add(DynamicInterceptorFeature.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -28,7 +28,7 @@
*/
public class JaxRsApplication extends Application {

static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>(){
static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>() {
{
add(TextEntityResource.class);
add(CustomInterceptor.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -28,7 +28,7 @@
*/
public class JaxRsApplication extends Application {

static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>(){
static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>() {
{
add(InterceptedByNameResource.class);
add(NameBoundInterceptor.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -28,7 +28,7 @@
*/
public class JaxRsApplication extends Application {

static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>(){
static final Set<Class<?>> APP_CLASSES = new HashSet<Class<?>>() {
{
add(PersonResource.class);
add(PersonProvider.class);
Expand Down
Loading