Don't throw warnings on expansion failures (fixes #155)

Change-Id: Ic0f7fda33b928027f6356a7b920f2377f6eab320
diff --git a/Changes b/Changes
index 3e77eb2..57d1d8e 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@
     - [feature] Temporarily add all requested fields in flat legacy fields
       maps (diewald)
     - [bugfix] Fix empty DocIdSetIterator (margaretha)
+    - [bugfix] Don't throw warnings on expansion failure (diewald)
 
 0.63.0 2024-06-24
     - [bugfix] Show all inline markers and pagebreaks at match borders (diewald).
diff --git a/src/main/java/de/ids_mannheim/korap/response/Match.java b/src/main/java/de/ids_mannheim/korap/response/Match.java
index 9a70922..0c18d7c 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Match.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Match.java
@@ -1185,7 +1185,7 @@
             this.positionsToOffset.clear();
         }
         else {
-            this.addWarning(651, "Unable to extend context");
+            this.addMessage(651, "Unable to extend context");
         };
     };
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
index 39385eb..a0ac953 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
@@ -813,7 +813,7 @@
                              true); // extendToSentence
 
         JsonNode res = mapper.readTree(km.toJsonString());
-        assertEquals("Unable to extend context", res.at("/warnings/0/1").asText());
+        assertEquals("Unable to extend context", res.at("/messages/0/1").asText());
 
         QueryBuilder kq = new QueryBuilder("tokens");
         Krill ks = new Krill(kq.tag("base/s:s"));