From 8118532ca9b01caa97c9c223fd9a48137bd4880c Mon Sep 17 00:00:00 2001
From: Earlopain <14981592+Earlopain@users.noreply.github.com>
Date: Fri, 22 Aug 2025 15:00:43 +0200
Subject: [PATCH] Remove remaining `quirks_mode` from java code
Most is gone since https://github.com/ruby/json/commit/7d2ad6d6556da03300a5aeadeeacaec563435773
Also add a mention to the 2.0.0 changelog that this was the version
it was removed.
I had to look through commits for some context behind it.
---
CHANGES.md | 1 +
java/src/json/ext/GeneratorState.java | 7 -------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index eb6982ad5..0895827c0 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -286,6 +286,7 @@
## 2015-09-11 (2.0.0)
* Now complies to newest JSON RFC 7159.
* Implements compatibility to ruby 2.4 integer unification.
+ * Removed support for `quirks_mode` option.
* Drops support for old rubies whose life has ended, that is rubies < 2.0.
Also see https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/
* There were still some mentions of dual GPL licensing in the source, but JSON
diff --git a/java/src/json/ext/GeneratorState.java b/java/src/json/ext/GeneratorState.java
index 9c15699fb..142d388dc 100644
--- a/java/src/json/ext/GeneratorState.java
+++ b/java/src/json/ext/GeneratorState.java
@@ -82,12 +82,6 @@ public class GeneratorState extends RubyObject {
*/
private boolean asciiOnly = DEFAULT_ASCII_ONLY;
static final boolean DEFAULT_ASCII_ONLY = false;
- /**
- * If set to true all JSON values generated might not be
- * RFC-conform JSON documents.
- */
- private boolean quirksMode = DEFAULT_QUIRKS_MODE;
- static final boolean DEFAULT_QUIRKS_MODE = false;
/**
* If set to true the forward slash will be escaped in
* json output.
@@ -218,7 +212,6 @@ public IRubyObject initialize_copy(ThreadContext context, IRubyObject vOrig) {
this.maxNesting = orig.maxNesting;
this.allowNaN = orig.allowNaN;
this.asciiOnly = orig.asciiOnly;
- this.quirksMode = orig.quirksMode;
this.scriptSafe = orig.scriptSafe;
this.strict = orig.strict;
this.bufferInitialLength = orig.bufferInitialLength;