From aeea493311e20eded19322ee53f47c4bb40a5ae9 Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Sat, 16 Apr 2016 05:35:19 -0400 Subject: [PATCH] catch user (me) silliness when using EarthDebugger --- .../src/java/org/apache/lucene/geo/EarthDebugger.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lucene/test-framework/src/java/org/apache/lucene/geo/EarthDebugger.java b/lucene/test-framework/src/java/org/apache/lucene/geo/EarthDebugger.java index 56dde88cd58..fdef990724a 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/geo/EarthDebugger.java +++ b/lucene/test-framework/src/java/org/apache/lucene/geo/EarthDebugger.java @@ -27,6 +27,7 @@ import org.apache.lucene.util.SloppyMath; public class EarthDebugger { final StringBuilder b = new StringBuilder(); private int nextShape; + private boolean finished; public EarthDebugger() { b.append("\n"); @@ -177,6 +178,10 @@ public class EarthDebugger { } public String finish() { + if (finished) { + throw new IllegalStateException("already finished"); + } + finished = true; b.append(" WE.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{\n"); b.append(" attribution: '© OpenStreetMap contributors'\n"); b.append(" }).addTo(earth);\n");