Skip to content

Commit 0c917b2

Browse files
authored
Sync with core/1463: no longer support java.net.URL as source (#204)
1 parent 474c34a commit 0c917b2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • jr-objects/src/main/java/tools/jackson/jr/ob

jr-objects/src/main/java/tools/jackson/jr/ob/JSON.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,9 +1518,6 @@ protected JsonParser _parser(Object source) throws JacksonException
15181518
if (source instanceof Reader) {
15191519
return f.createParser(this, (Reader) source);
15201520
}
1521-
if (source instanceof URL) {
1522-
return f.createParser(this, (URL) source);
1523-
}
15241521
if (type == char[].class) {
15251522
return f.createParser(this, new CharArrayReader((char[]) source));
15261523
}
@@ -1530,8 +1527,13 @@ protected JsonParser _parser(Object source) throws JacksonException
15301527
if (source instanceof CharSequence) {
15311528
return f.createParser(this, ((CharSequence) source).toString());
15321529
}
1530+
if (source instanceof URL) {
1531+
// 19-Aug-2025, tatu: as per [core#1463] `java.net.URL` is no longer supported
1532+
throw new JSONObjectException("Can not use Source of type `"+source.getClass().getName()
1533+
+"` as input -- suppor drop in Jackson 3.0 (use an `InputStream`, `Reader`, `String`/`CharSequence`, `byte[]`, `char[]` or `File`");
1534+
}
15331535
throw new JSONObjectException("Can not use Source of type `"+source.getClass().getName()
1534-
+"` as input (use an `InputStream`, `Reader`, `String`/`CharSequence`, `byte[]`, `char[]`, `File` or `URL`");
1536+
+"` as input (use an `InputStream`, `Reader`, `String`/`CharSequence`, `byte[]`, `char[]` or `File`");
15351537
}
15361538

15371539
protected JsonParser _initForReading(JsonParser p) throws JacksonException

0 commit comments

Comments
 (0)