@@ -104,9 +104,6 @@ public class PsychParser extends RubyObject {
104
104
public static final String ENCODING_UTF8 = "UTF8" ;
105
105
public static final String ENCODING_UTF16LE = "UTF16LE" ;
106
106
public static final String ENCODING_UTF16BE = "UTF16BE" ;
107
- public static final String MAX_ALIASES_FOR_COLLECTIONS = "max_aliases_for_collections" ;
108
- public static final String ALLOW_DUPLICATE_KEYS = "allow_duplicate_keys" ;
109
- public static final String ALLOW_RECURSIVE_KEYS = "allow_recursive_keys" ;
110
107
public static final String CODE_POINT_LIMIT = "code_point_limit" ;
111
108
112
109
public static void initPsychParser (Ruby runtime , RubyModule psych ) {
@@ -124,9 +121,6 @@ public static void initPsychParser(Ruby runtime, RubyModule psych) {
124
121
125
122
// defaults for SnakeYAML load settings
126
123
LoadSettings defaults = LoadSettings .builder ().build ();
127
- psychParser .setInternalVariable (MAX_ALIASES_FOR_COLLECTIONS , runtime .newFixnum (defaults .getMaxAliasesForCollections ()));
128
- psychParser .setInternalVariable (ALLOW_DUPLICATE_KEYS , runtime .newBoolean (defaults .getAllowDuplicateKeys ()));
129
- psychParser .setInternalVariable (ALLOW_RECURSIVE_KEYS , runtime .newBoolean (defaults .getAllowRecursiveKeys ()));
130
124
psychParser .setInternalVariable (CODE_POINT_LIMIT , runtime .newFixnum (defaults .getCodePointLimit ()));
131
125
}
132
126
@@ -138,9 +132,6 @@ public PsychParser(Ruby runtime, RubyClass klass) {
138
132
// prepare settings builder and apply global defaults
139
133
LoadSettingsBuilder lsb = LoadSettings .builder ();
140
134
lsb .setSchema (new CoreSchema ());
141
- lsb .setMaxAliasesForCollections (((IRubyObject ) klass .getInternalVariable (MAX_ALIASES_FOR_COLLECTIONS )).convertToInteger ().getIntValue ());
142
- lsb .setAllowDuplicateKeys (((IRubyObject ) klass .getInternalVariable (ALLOW_DUPLICATE_KEYS )).isTrue ());
143
- lsb .setAllowRecursiveKeys (((IRubyObject ) klass .getInternalVariable (ALLOW_RECURSIVE_KEYS )).isTrue ());
144
135
lsb .setCodePointLimit (((IRubyObject ) klass .getInternalVariable (CODE_POINT_LIMIT )).convertToInteger ().getIntValue ());
145
136
this .loadSettingsBuilder = lsb ;
146
137
}
@@ -538,42 +529,6 @@ public IRubyObject mark(ThreadContext context) {
538
529
);
539
530
}
540
531
541
- @ JRubyMethod (name = "max_aliases_for_collections=" )
542
- public IRubyObject max_aliases_for_collections_set (IRubyObject max ) {
543
- loadSettingsBuilder .setMaxAliasesForCollections (max .convertToInteger ().getIntValue ());
544
-
545
- return max ;
546
- }
547
-
548
- @ JRubyMethod (name = MAX_ALIASES_FOR_COLLECTIONS )
549
- public IRubyObject max_aliases_for_collections (ThreadContext context ) {
550
- return context .runtime .newFixnum (buildSettings ().getMaxAliasesForCollections ());
551
- }
552
-
553
- @ JRubyMethod (name = "allow_duplicate_keys=" )
554
- public IRubyObject allow_duplicate_keys_set (IRubyObject allow ) {
555
- loadSettingsBuilder .setAllowDuplicateKeys (allow .isTrue ());
556
-
557
- return allow ;
558
- }
559
-
560
- @ JRubyMethod (name = ALLOW_DUPLICATE_KEYS )
561
- public IRubyObject allow_duplicate_keys (ThreadContext context ) {
562
- return RubyBoolean .newBoolean (context , buildSettings ().getAllowDuplicateKeys ());
563
- }
564
-
565
- @ JRubyMethod (name = "allow_recursive_keys=" )
566
- public IRubyObject allow_recursive_keys_set (IRubyObject allow ) {
567
- loadSettingsBuilder .setAllowRecursiveKeys (allow .isTrue ());
568
-
569
- return allow ;
570
- }
571
-
572
- @ JRubyMethod (name = ALLOW_RECURSIVE_KEYS )
573
- public IRubyObject allow_recursive_keys (ThreadContext context ) {
574
- return RubyBoolean .newBoolean (context , buildSettings ().getAllowRecursiveKeys ());
575
- }
576
-
577
532
@ JRubyMethod (name = "code_point_limit=" )
578
533
public IRubyObject code_point_limit_set (IRubyObject limit ) {
579
534
loadSettingsBuilder .setCodePointLimit (limit .convertToInteger ().getIntValue ());
@@ -588,48 +543,6 @@ public IRubyObject code_point_limit(ThreadContext context) {
588
543
589
544
// class-level accessors for default values
590
545
591
- @ JRubyMethod (name = "max_aliases_for_collections=" , meta = true )
592
- public static IRubyObject max_aliases_for_collections_set (ThreadContext context , IRubyObject self , IRubyObject max ) {
593
- int maxAliasesForCollections = RubyNumeric .num2int (max );
594
-
595
- if (maxAliasesForCollections <= 0 ) {
596
- throw context .runtime .newRangeError ("max_aliases_for_collections must be positive" );
597
- }
598
-
599
- self .getInternalVariables ().setInternalVariable (MAX_ALIASES_FOR_COLLECTIONS , max );
600
-
601
- return max ;
602
- }
603
-
604
- @ JRubyMethod (name = MAX_ALIASES_FOR_COLLECTIONS )
605
- public static IRubyObject max_aliases_for_collections (ThreadContext context , IRubyObject self ) {
606
- return (IRubyObject ) self .getInternalVariables ().getInternalVariable (MAX_ALIASES_FOR_COLLECTIONS );
607
- }
608
-
609
- @ JRubyMethod (name = "allow_duplicate_keys=" , meta = true )
610
- public static IRubyObject allow_duplicate_keys_set (IRubyObject self , IRubyObject allow ) {
611
- self .getInternalVariables ().setInternalVariable (ALLOW_DUPLICATE_KEYS , allow );
612
-
613
- return allow ;
614
- }
615
-
616
- @ JRubyMethod (name = ALLOW_DUPLICATE_KEYS , meta = true )
617
- public static IRubyObject allow_duplicate_keys (ThreadContext context , IRubyObject self ) {
618
- return (IRubyObject ) self .getInternalVariables ().getInternalVariable (ALLOW_DUPLICATE_KEYS );
619
- }
620
-
621
- @ JRubyMethod (name = "allow_recursive_keys=" , meta = true )
622
- public static IRubyObject allow_recursive_keys_set (IRubyObject self , IRubyObject allow ) {
623
- self .getInternalVariables ().setInternalVariable (ALLOW_RECURSIVE_KEYS , allow );
624
-
625
- return allow ;
626
- }
627
-
628
- @ JRubyMethod (name = ALLOW_RECURSIVE_KEYS , meta = true )
629
- public static IRubyObject allow_recursive_keys (ThreadContext context , IRubyObject self ) {
630
- return (IRubyObject ) self .getInternalVariables ().getInternalVariable (ALLOW_RECURSIVE_KEYS );
631
- }
632
-
633
546
@ JRubyMethod (name = "code_point_limit=" , meta = true )
634
547
public static IRubyObject code_point_limit_set (ThreadContext context , IRubyObject self , IRubyObject limit ) {
635
548
int codePointLimit = RubyNumeric .num2int (limit );
0 commit comments