From b3aff17f5ace04bb890302dbcbaf14cf1f5f0c1a Mon Sep 17 00:00:00 2001 From: Chris Vest Date: Tue, 17 Nov 2020 15:25:26 +0100 Subject: [PATCH] Fix checkstyle so the build passes --- src/main/java/io/netty/buffer/b2/Buf.java | 6 +++--- .../java/io/netty/buffer/b2/BufAccessors.java | 5 +++-- .../java/io/netty/buffer/b2/CompositeBuf.java | 2 +- src/main/java/io/netty/buffer/b2/MemSegBuf.java | 2 +- .../java/io/netty/buffer/b2/MemoryManager.java | 2 +- src/main/java/io/netty/buffer/b2/Statics.java | 2 +- src/test/java/io/netty/buffer/b2/BufTest.java | 2 +- src/test/java/io/netty/buffer/b2/ScopeTest.java | 17 ++++++++++++++++- 8 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/main/java/io/netty/buffer/b2/Buf.java b/src/main/java/io/netty/buffer/b2/Buf.java index 25eb7b5..7230d77 100644 --- a/src/main/java/io/netty/buffer/b2/Buf.java +++ b/src/main/java/io/netty/buffer/b2/Buf.java @@ -152,8 +152,8 @@ public interface Buf extends Rc, BufAccessors { * * @param offset The writer offset to set. * @return This Buf. - * @throws IndexOutOfBoundsException if the specified {@code offset} is less than the current {@link #readerOffset()} - * or greater than {@link #capacity()}. + * @throws IndexOutOfBoundsException if the specified {@code offset} is less than the current + * {@link #readerOffset()} or greater than {@link #capacity()}. */ Buf writerOffset(int offset); @@ -371,4 +371,4 @@ public interface Buf extends Rc, BufAccessors { * That is, if {@link #countBorrows()} is not {@code 0}. */ void ensureWritable(int size); -} \ No newline at end of file +} diff --git a/src/main/java/io/netty/buffer/b2/BufAccessors.java b/src/main/java/io/netty/buffer/b2/BufAccessors.java index 55043c5..56d3d11 100644 --- a/src/main/java/io/netty/buffer/b2/BufAccessors.java +++ b/src/main/java/io/netty/buffer/b2/BufAccessors.java @@ -18,7 +18,8 @@ package io.netty.buffer.b2; /** * This interface is just the primitive data accessor methods that {@link Buf} exposes. * It can be useful if you only need the data access methods, and perhaps wish to decorate or modify their behaviour. - * Usually, you'd use the {@link Buf} interface directly, since this lets you properly control the buffer reference count. + * Usually, you'd use the {@link Buf} interface directly, since this lets you properly control the buffer reference + * count. */ public interface BufAccessors { // @@ -610,4 +611,4 @@ public interface BufAccessors { */ Buf setDouble(int woff, double value); // -} \ No newline at end of file +} diff --git a/src/main/java/io/netty/buffer/b2/CompositeBuf.java b/src/main/java/io/netty/buffer/b2/CompositeBuf.java index f234e5d..5da3681 100644 --- a/src/main/java/io/netty/buffer/b2/CompositeBuf.java +++ b/src/main/java/io/netty/buffer/b2/CompositeBuf.java @@ -893,7 +893,7 @@ final class CompositeBuf extends RcSupport implements Buf { private int searchOffsets(int index) { int i = Arrays.binarySearch(offsets, index); - return i < 0? -(i+2) : i; + return i < 0? -(i + 2) : i; } // diff --git a/src/main/java/io/netty/buffer/b2/MemSegBuf.java b/src/main/java/io/netty/buffer/b2/MemSegBuf.java index 69c3c7b..ecdc611 100644 --- a/src/main/java/io/netty/buffer/b2/MemSegBuf.java +++ b/src/main/java/io/netty/buffer/b2/MemSegBuf.java @@ -853,4 +853,4 @@ class MemSegBuf extends RcSupport implements Buf { return new MemSegBuf(segment, drop, alloc); } } -} \ No newline at end of file +} diff --git a/src/main/java/io/netty/buffer/b2/MemoryManager.java b/src/main/java/io/netty/buffer/b2/MemoryManager.java index 97323b4..6494dc4 100644 --- a/src/main/java/io/netty/buffer/b2/MemoryManager.java +++ b/src/main/java/io/netty/buffer/b2/MemoryManager.java @@ -77,7 +77,7 @@ public interface MemoryManager { } @SuppressWarnings("unchecked") - private static Drop convert(Drop drop) { + private static Drop convert(Drop drop) { return (Drop) drop; } } diff --git a/src/main/java/io/netty/buffer/b2/Statics.java b/src/main/java/io/netty/buffer/b2/Statics.java index ff89377..f97bc75 100644 --- a/src/main/java/io/netty/buffer/b2/Statics.java +++ b/src/main/java/io/netty/buffer/b2/Statics.java @@ -24,7 +24,7 @@ import java.util.concurrent.atomic.LongAdder; interface Statics { Cleaner CLEANER = Cleaner.create(); LongAdder MEM_USAGE_NATIVE = new LongAdder(); - ConcurrentHashMap CLEANUP_ACTIONS = new ConcurrentHashMap<>(); + ConcurrentHashMap CLEANUP_ACTIONS = new ConcurrentHashMap<>(); Drop NO_OP_DROP = buf -> { }; diff --git a/src/test/java/io/netty/buffer/b2/BufTest.java b/src/test/java/io/netty/buffer/b2/BufTest.java index 29cb564..2af63cf 100644 --- a/src/test/java/io/netty/buffer/b2/BufTest.java +++ b/src/test/java/io/netty/buffer/b2/BufTest.java @@ -3806,4 +3806,4 @@ public class BufTest { actual, Double.doubleToRawLongBits(actual))); } } -} \ No newline at end of file +} diff --git a/src/test/java/io/netty/buffer/b2/ScopeTest.java b/src/test/java/io/netty/buffer/b2/ScopeTest.java index 6e5a829..662b8b7 100644 --- a/src/test/java/io/netty/buffer/b2/ScopeTest.java +++ b/src/test/java/io/netty/buffer/b2/ScopeTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2020 The Netty Project + * + * The Netty Project licenses this file to you 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: + * + * https://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.netty.buffer.b2; import org.junit.Test; @@ -52,4 +67,4 @@ public class ScopeTest { list.add(order); } } -} \ No newline at end of file +}