diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-02-02 13:44:02 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-02-03 09:54:15 +0100 |
commit | acac0d16552e4298092e98ccfc32f7f325b8a021 (patch) | |
tree | aaf1b20856619947f7a4d0194680062e745a537f | |
parent | 367a937a4169f5a39e8b1b94e014baf02eceb005 (diff) |
Nonfunctional changes, remove unused code
7 files changed, 12 insertions, 27 deletions
diff --git a/document/src/main/java/com/yahoo/document/idstring/IdIdString.java b/document/src/main/java/com/yahoo/document/idstring/IdIdString.java index 9c75cf6828b..bb09dff7a98 100644 --- a/document/src/main/java/com/yahoo/document/idstring/IdIdString.java +++ b/document/src/main/java/com/yahoo/document/idstring/IdIdString.java @@ -5,10 +5,7 @@ import com.yahoo.collections.MD5; import com.yahoo.text.Utf8; /** - * Created with IntelliJ IDEA. - * User: magnarn - * Date: 10/15/12 - * Time: 11:02 AM + * @author Magnar Nedland */ public class IdIdString extends IdString { private final String type; @@ -19,20 +16,12 @@ public class IdIdString extends IdString { private static final int SIZE_OF_ID_AND_3_COLONS = 2 + 3; // "id:::" private static final int MAX_LENGTH = IdString.MAX_LENGTH_EXCEPT_NAMESPACE_SPECIFIC - SIZE_OF_ID_AND_3_COLONS; - public static String replaceType(String id, String typeName) { - int typeStartPos = id.indexOf(":", 3) + 1; - int typeEndPos = id.indexOf(":", typeStartPos); - return id.substring(0, typeStartPos) + typeName + id.substring(typeEndPos); - } - - public static long makeLocation(String s) { long result = 0; byte[] md5sum = MD5.md5.get().digest(Utf8.toBytes(s)); - for (int i=0; i<8; ++i) { - result |= (md5sum[i] & 0xFFl) << (8*i); + for (int i = 0; i < 8; ++i) { + result |= (md5sum[i] & 0xFFL) << (8 * i); } - return result; } diff --git a/document/src/main/java/com/yahoo/document/json/document/DocumentParser.java b/document/src/main/java/com/yahoo/document/json/document/DocumentParser.java index a8fdb186bd7..d6d95ca0bc6 100644 --- a/document/src/main/java/com/yahoo/document/json/document/DocumentParser.java +++ b/document/src/main/java/com/yahoo/document/json/document/DocumentParser.java @@ -33,7 +33,7 @@ public class DocumentParser { /** * Parses a single document and returns it. - * Returns empty is we have reached the end of the stream. + * Returns empty if we have reached the end of the stream. */ public Optional<DocumentParseInfo> parse(Optional<DocumentId> documentIdArg) throws IOException { indentLevel = 0; diff --git a/document/src/test/java/com/yahoo/document/IdIdStringTest.java b/document/src/test/java/com/yahoo/document/IdIdStringTest.java index 493fb35c97d..a4b05d0cf7a 100644 --- a/document/src/test/java/com/yahoo/document/IdIdStringTest.java +++ b/document/src/test/java/com/yahoo/document/IdIdStringTest.java @@ -109,9 +109,4 @@ public class IdIdStringTest { } } - @Test - public void requireThatIdIdStringCanReplaceType() { - String type = IdIdString.replaceType("id:namespace:type::foo", "newType"); - assertEquals("id:namespace:newType::foo", type); - } } diff --git a/documentapi/src/main/java/com/yahoo/documentapi/AckToken.java b/documentapi/src/main/java/com/yahoo/documentapi/AckToken.java index 963710d6c37..b24d1b33a02 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/AckToken.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/AckToken.java @@ -4,7 +4,7 @@ package com.yahoo.documentapi; /** * Token to use to acknowledge data for visiting. * - * @author <a href="mailto:thomasg@yahoo-inc.com">Thomas Gundersen</a> + * @author Thomas Gundersen */ public class AckToken { diff --git a/documentapi/src/main/java/com/yahoo/documentapi/ResponseHandler.java b/documentapi/src/main/java/com/yahoo/documentapi/ResponseHandler.java index 0471c44cb14..cab591d2dc7 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/ResponseHandler.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/ResponseHandler.java @@ -12,5 +12,5 @@ public interface ResponseHandler { * * @param response The response to process. */ - public void handleResponse(Response response); + void handleResponse(Response response); } diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java index 982a1c50b85..675f20e3807 100755 --- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java @@ -772,8 +772,8 @@ public class MessageBusVisitorSession implements VisitorSession { } private void handleMessageProcessingException(Reply reply, Exception e, String what) { - final String errorDesc = formatProcessingException(e, what); - final String fullMsg = formatIdentifyingVisitorErrorString(errorDesc); + String errorDesc = formatProcessingException(e, what); + String fullMsg = formatIdentifyingVisitorErrorString(errorDesc); log.log(Level.SEVERE, fullMsg, e); int errorCode; synchronized (progress.getToken()) { diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java index 1fefe2e0c7e..9fd97f0c9f3 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java @@ -628,7 +628,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { } } - // ---------------------------------------------Document Operations ---------------------------------------- + // -------------------------------------------- Document Operations ---------------------------------------- private static abstract class Operation { @@ -644,7 +644,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { /** * Attempts to dispatch this operation to the document API, and returns whether this completed or not. - * This return {@code} true if dispatch was successful, or if it failed fatally; or {@code false} if + * Returns {@code} true if dispatch was successful, or if it failed fatally; or {@code false} if * dispatch should be retried at a later time. */ boolean dispatch() { @@ -676,7 +676,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { } - /** Attempts to send the given document operation, returning false if thes needs to be retried. */ + /** Attempts to send the given document operation, returning false if this needs to be retried. */ private static boolean dispatchOperation(Supplier<Result> documentOperation) { Result result = documentOperation.get(); if (result.type() == Result.ResultType.TRANSIENT_ERROR) @@ -889,6 +889,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { // ------------------------------------------------ Helpers ------------------------------------------------ + /** Returns the last property with the given name, if present, or throws if this is empty or blank. */ private static Optional<String> getProperty(HttpRequest request, String name) { if ( ! request.parameters().containsKey(name)) return Optional.empty(); |