@@ -3,53 +3,6 @@ component accessors="true" singleton {
3
3
property name = " appEnvironment" inject = " box:setting:environment" ;
4
4
property name = " interceptorService" inject = " coldbox:InterceptorService" ;
5
5
6
- /**
7
- * Ensures a CF native struct is returned ( allowing for dot-notation )
8
- *
9
- * @memento A struct to ensure
10
- */
11
- function ensureNativeStruct ( required struct memento ){
12
- // deserialize/serialize JSON is currently the only way to to ensure deeply nested items are converted without deep recursion
13
- return deserializeJSON (
14
- serializeJSON (
15
- memento ,
16
- false ,
17
- listFindNoCase ( " Lucee" , server .coldfusion .productname ) ? " utf-8" : false
18
- )
19
- );
20
- }
21
-
22
- /**
23
- * Creates a new java.util.HashMap with an optional struct to populate
24
- *
25
- * @memento a struct to populate the memento with
26
- */
27
- function newHashMap ( struct memento ){
28
- var hashMap = createObject ( " java" , " java.util.HashMap" ).init ();
29
-
30
- if ( ! isNull ( arguments .memento ) ) {
31
- // make sure we detach any references
32
- hashMap .putAll ( ensureBooleanCasting ( duplicate ( arguments .memento ) ) );
33
- for ( var key in hashMap ) {
34
- if ( isNull ( hashMap [ key ] ) ) continue ;
35
-
36
- if ( isStruct ( hashMap [ key ] ) && ! isInstanceOf ( hashMap [ key ], " java.util.HashMap" ) ) {
37
- hashMap [ key ] = newHashMap ( ensureBooleanCasting ( hashMap [ key ] ) );
38
- } else if ( isArray ( hashMap [ key ] ) ) {
39
- // scope this in for CF's compiler
40
- var segment = hashMap [ key ];
41
- segment .each ( function ( item , index ){
42
- if ( isStruct ( item ) && ! isInstanceOf ( item , " java.util.HashMap" ) ) {
43
- hashMap [ key ][ index ] = newHashMap ( ensureBooleanCasting ( item ) );
44
- }
45
- } );
46
- }
47
- }
48
- }
49
-
50
- return hashMap ;
51
- }
52
-
53
6
/**
54
7
* Workaround for Adobe 2018 metadata mutation bug with GSON: https://tracker.adobe.com/#/view/CF-4206423
55
8
* @deprecated As soon as the bug above is fixed
0 commit comments