diff options
author | Jon Bratseth <bratseth@vespa.ai> | 2023-06-13 17:06:09 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@vespa.ai> | 2023-06-13 17:06:09 +0200 |
commit | 3ff15111ce265956777dcb861867388b87fda1a8 (patch) | |
tree | c0e93a73b43310dba5fb17669c3d6c6d796082f2 /container-core | |
parent | 9869ca2ad01e423d9b250f188e3152fb693d97d8 (diff) |
Non-functional changes only
Diffstat (limited to 'container-core')
4 files changed, 15 insertions, 12 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/jdisc/ContentChannelOutputStream.java b/container-core/src/main/java/com/yahoo/container/jdisc/ContentChannelOutputStream.java index d5dc18c1e5e..037506bed7f 100644 --- a/container-core/src/main/java/com/yahoo/container/jdisc/ContentChannelOutputStream.java +++ b/container-core/src/main/java/com/yahoo/container/jdisc/ContentChannelOutputStream.java @@ -84,7 +84,7 @@ public class ContentChannelOutputStream extends OutputStream implements Writable */ @Override public void write(byte[] b) throws IOException { - nonCopyingWrite(Arrays.copyOf(b, b.length)); + nonCopyingWrite(Arrays.copyOf(b, b.length)); } /** @@ -142,10 +142,13 @@ public class ContentChannelOutputStream extends OutputStream implements Writable } private class LoggingCompletionHandler implements CompletionHandler { + private final CompletionHandler nested; + LoggingCompletionHandler(CompletionHandler nested) { this.nested = nested; } + @Override public void completed() { if (nested != null) { diff --git a/container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java b/container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java index 2749b73272d..246286ea1e6 100644 --- a/container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java +++ b/container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java @@ -143,7 +143,7 @@ public abstract class AsynchronousSectionedRenderer<RESPONSE extends Response> e } /** - * Create an renderer using the specified executor instead of the default one which should be used for production. + * Create a renderer using the specified executor instead of the default one which should be used for production. * Using a custom executor is useful for tests to avoid creating new threads for each renderer registry. * * @param executor the executor to use or null to use the default executor suitable for production @@ -226,7 +226,7 @@ public abstract class AsynchronousSectionedRenderer<RESPONSE extends Response> e this.response = response; this.stream = stream; this.execution = execution; - DataListListener parentOfTopLevelListener = new DataListListener(new ParentOfTopLevel(request,response.data()), null); + DataListListener parentOfTopLevelListener = new DataListListener(new ParentOfTopLevel(request, response.data()), null); dataListListenerStack.addFirst(parentOfTopLevelListener); success = new CompletableFuture<>(); try { @@ -264,13 +264,13 @@ public abstract class AsynchronousSectionedRenderer<RESPONSE extends Response> e /** * How deep into the tree of nested data lists the callback currently is. - * beginList() is invoked after this this is increased, and endList() is + * beginList() is invoked after this is increased, and endList() is * invoked before it is decreased. * * @return an integer of 1 or above */ public int getRecursionLevel() { - return dataListListenerStack.size()-1; + return dataListListenerStack.size() - 1; } /** @@ -406,7 +406,7 @@ public abstract class AsynchronousSectionedRenderer<RESPONSE extends Response> e /** Renders a list. */ private void renderDataList(DataList list) throws IOException { - final boolean ordered = isOrdered(list); + boolean ordered = isOrdered(list); if (list.asList() == null) { logger.log(Level.WARNING, "DataList.asList() returned null, indicating it is closed. " + "This is likely caused by adding the same list multiple " + @@ -565,9 +565,9 @@ public abstract class AsynchronousSectionedRenderer<RESPONSE extends Response> e */ private static class ParentOfTopLevel extends AbstractDataList { - private DataList trueTopLevel; + private final DataList trueTopLevel; - public ParentOfTopLevel(Request request,DataList trueTopLevel) { + public ParentOfTopLevel(Request request, DataList trueTopLevel) { super(request); this.trueTopLevel = trueTopLevel; freeze(); @@ -585,13 +585,13 @@ public abstract class AsynchronousSectionedRenderer<RESPONSE extends Response> e @Override public Data get(int index) { - if (index>0) throw new IndexOutOfBoundsException(); + if (index > 0) throw new IndexOutOfBoundsException(); return trueTopLevel; } @Override public List<Data> asList() { - return Collections.<Data>singletonList(trueTopLevel); + return Collections.singletonList(trueTopLevel); } @Override diff --git a/container-core/src/main/java/com/yahoo/processing/rendering/Renderer.java b/container-core/src/main/java/com/yahoo/processing/rendering/Renderer.java index df53ac846f2..97ca0bfb6a4 100644 --- a/container-core/src/main/java/com/yahoo/processing/rendering/Renderer.java +++ b/container-core/src/main/java/com/yahoo/processing/rendering/Renderer.java @@ -53,7 +53,7 @@ public abstract class Renderer<RESPONSE extends Response> extends AbstractCompon * @return a {@link CompletableFuture} containing a boolean where true indicates a successful rendering */ public abstract CompletableFuture<Boolean> renderResponse(OutputStream stream, RESPONSE response, - Execution execution, Request request); + Execution execution, Request request); /** * Name of the output encoding, if applicable. diff --git a/container-core/src/main/java/com/yahoo/processing/response/IncomingData.java b/container-core/src/main/java/com/yahoo/processing/response/IncomingData.java index fc0e6d21e13..358f8ad9693 100644 --- a/container-core/src/main/java/com/yahoo/processing/response/IncomingData.java +++ b/container-core/src/main/java/com/yahoo/processing/response/IncomingData.java @@ -100,7 +100,7 @@ public interface IncomingData<DATATYPE extends Data> { */ final class NullIncomingData<DATATYPE extends Data> implements IncomingData<DATATYPE> { - private DataList<DATATYPE> owner; + private final DataList<DATATYPE> owner; private final ImmediateFuture<DATATYPE> completionFuture; public NullIncomingData(DataList<DATATYPE> owner) { |