File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/main/java/org/scijava/annotations Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 6464class IndexReader {
6565
6666 private final PushbackInputStream in ;
67+ private final String originalISName ;
6768
6869 IndexReader (final InputStream in ) {
70+ this (in , "" );
71+ }
72+
73+ IndexReader (final InputStream in , final String isName ) {
6974 this .in =
7075 in instanceof PushbackInputStream ? (PushbackInputStream ) in
7176 : new PushbackInputStream (new BufferedInputStream (in ));
77+ this .originalISName = isName ;
7278 }
7379
7480 public Object next () throws IOException {
@@ -155,7 +161,8 @@ else if (c < '0' || c > '9') {
155161 if (c == '"' ) {
156162 return readString ();
157163 }
158- throw new IOException ("Unexpected char: '" + (char ) c + "'" );
164+ throw new IOException ("Unexpected char: '" + (char ) c + "'" +
165+ ((originalISName .length ()>0 ) ? " from " +originalISName : "" ));
159166 }
160167
161168 public void close () throws IOException {
@@ -206,7 +213,7 @@ private int expect(char a, char b) throws IOException {
206213 return 1 ;
207214 }
208215 throw new IOException ("Expected '" + a + "' or '" + b + "', got '" +
209- (char ) c + "'" );
216+ (char ) c + "'" +(( originalISName . length ()> 0 ) ? " from " + originalISName : "" ) );
210217 }
211218
212219 private void expect (String match ) throws IOException {
@@ -217,6 +224,7 @@ private void expect(String match) throws IOException {
217224
218225 private IndexReader () {
219226 this .in = null ;
227+ this .originalISName ="" ;
220228 }
221229
222230 static IndexReader getLegacyReader (final InputStream in ) throws IOException {
You can’t perform that action at this time.
0 commit comments