File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
server/src/main/java/org/elasticsearch/index/mapper Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -388,6 +388,14 @@ public XContentString optimizedTextOrNull() throws IOException {
388388 return super .optimizedTextOrNull ();
389389 }
390390
391+ @ Override
392+ public XContentString optimizedText () throws IOException {
393+ if (state == State .EXPANDING_START_OBJECT ) {
394+ throw new IllegalStateException ("Can't get text on a " + currentToken () + " at " + getTokenLocation ());
395+ }
396+ return super .optimizedText ();
397+ }
398+
391399 @ Override
392400 public String textOrNull () throws IOException {
393401 if (state == State .EXPANDING_START_OBJECT ) {
@@ -396,6 +404,14 @@ public String textOrNull() throws IOException {
396404 return super .textOrNull ();
397405 }
398406
407+ @ Override
408+ public String text () throws IOException {
409+ if (state == State .EXPANDING_START_OBJECT ) {
410+ throw new IllegalStateException ("Can't get text on a " + currentToken () + " at " + getTokenLocation ());
411+ }
412+ return super .text ();
413+ }
414+
399415 @ Override
400416 public Number numberValue () throws IOException {
401417 if (state == State .EXPANDING_START_OBJECT ) {
You can’t perform that action at this time.
0 commit comments