summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-01-04 12:36:53 +0100
committerGitHub <noreply@github.com>2022-01-04 12:36:53 +0100
commite89d9b57acfca329c7013b5ca4a6099b7bdffae3 (patch)
tree7a0357c209a1a4e6514e2094ce26feca665a81ab
parentc83ed1b68b40704a9c4b45a004e162404f3b34b9 (diff)
parent1d04a279451b57014451f2d22655e53a470f9fec (diff)
Merge pull request #20644 from vespa-engine/bratseth/avoid-deprecated-apis-2
Avoid deprecated APIs
-rw-r--r--config-model/src/main/java/com/yahoo/documentmodel/VespaDocumentType.java2
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java2
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java7
-rw-r--r--config-provisioning/src/test/java/com/yahoo/config/provision/ZoneIdTest.java18
4 files changed, 14 insertions, 15 deletions
diff --git a/config-model/src/main/java/com/yahoo/documentmodel/VespaDocumentType.java b/config-model/src/main/java/com/yahoo/documentmodel/VespaDocumentType.java
index b29e4704f62..02f5a8c12c4 100644
--- a/config-model/src/main/java/com/yahoo/documentmodel/VespaDocumentType.java
+++ b/config-model/src/main/java/com/yahoo/documentmodel/VespaDocumentType.java
@@ -14,7 +14,7 @@ import com.yahoo.document.PositionDataType;
*/
public class VespaDocumentType {
- public static NewDocumentType INSTANCE = newInstance();
+ public static final NewDocumentType INSTANCE = newInstance();
public static final DataTypeName NAME = new DataTypeName("document");
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
index 52fd5286bcf..d484d32b02f 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java
@@ -517,7 +517,7 @@ public class RankProfile implements Cloneable {
public void setInheritedSummaryFeatures(String parentProfile) {
if ( ! parentProfile.equals(inheritedName))
throw new IllegalArgumentException("This can only inherit the summary features of its parent, '" +
- inheritedName + ", but attemtping to inherit '" + parentProfile);
+ inheritedName + ", but attempting to inherit '" + parentProfile);
this.inheritedSummaryFeatures = parentProfile;
}
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java
index 60b06d3655c..e627f06ad42 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDDocumentType.java
@@ -31,8 +31,8 @@ import java.util.Set;
* implicitly acquiring their fields as it's own. If a document is not set to inherit
* any document, it will always inherit the document "document.0".
*
- * @author Thomas Gundersen
- * @author bratseth
+ * @author Thomas Gundersen
+ * @author bratseth
*/
public class SDDocumentType implements Cloneable, Serializable {
@@ -42,7 +42,8 @@ public class SDDocumentType implements Cloneable, Serializable {
private final AnnotationTypeRegistry annotationTypes = new AnnotationTypeRegistry();
private DocumentType docType;
private DataType structType;
- // The field sets here are set from the processing step in SD, to ensure that the full Search and this SDDocumentType is built first.
+ // The field sets here are set from the processing step in SD,
+ // to ensure that the full Search and this SDDocumentType is built first.
private FieldSets fieldSets;
// Document references
private Optional<DocumentReferences> documentReferences = Optional.empty();
diff --git a/config-provisioning/src/test/java/com/yahoo/config/provision/ZoneIdTest.java b/config-provisioning/src/test/java/com/yahoo/config/provision/ZoneIdTest.java
index fb141f1889e..ae61be8f2e9 100644
--- a/config-provisioning/src/test/java/com/yahoo/config/provision/ZoneIdTest.java
+++ b/config-provisioning/src/test/java/com/yahoo/config/provision/ZoneIdTest.java
@@ -2,11 +2,10 @@
package com.yahoo.config.provision;
import com.yahoo.config.provision.zone.ZoneId;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.ExpectedException;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
/**
* @author hmusum
@@ -15,11 +14,6 @@ public class ZoneIdTest {
private static final Environment environment = Environment.prod;
private static final RegionName region = RegionName.from("moon-dark-side-1");
- private static final CloudName cloud = CloudName.from("aws");
- private static final SystemName system = SystemName.Public;
-
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
@Test
public void testCreatingZoneId() {
@@ -35,9 +29,13 @@ public class ZoneIdTest {
assertEquals(ZoneId.from(zoneId.value()), zoneId);
String serializedZoneId = "some.illegal.value";
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Cannot deserialize zone id '" + serializedZoneId + "'");
- ZoneId.from(serializedZoneId);
+ try {
+ ZoneId.from(serializedZoneId);
+ fail("Expected exception");
+ }
+ catch (IllegalArgumentException e) {
+ assertEquals("Cannot deserialize zone id '" + serializedZoneId + "'", e.getMessage());
+ }
}
}