aboutsummaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-02-02 13:44:02 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-02-03 09:54:15 +0100
commitacac0d16552e4298092e98ccfc32f7f325b8a021 (patch)
treeaaf1b20856619947f7a4d0194680062e745a537f /document
parent367a937a4169f5a39e8b1b94e014baf02eceb005 (diff)
Nonfunctional changes, remove unused code
Diffstat (limited to 'document')
-rw-r--r--document/src/main/java/com/yahoo/document/idstring/IdIdString.java17
-rw-r--r--document/src/main/java/com/yahoo/document/json/document/DocumentParser.java2
-rw-r--r--document/src/test/java/com/yahoo/document/IdIdStringTest.java5
3 files changed, 4 insertions, 20 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);
- }
}