| | | |
Offset 10, 268 lines modified | Offset 10, 268 lines modified |
10 | import·java.util.HashMap; | 10 | import·java.util.HashMap; |
11 | import·android.util.JsonReader; | 11 | import·android.util.JsonReader; |
12 | import·org.json.JSONObject; | 12 | import·org.json.JSONObject; |
13 | import·io.realm.internal.ColumnInfo; | 13 | import·io.realm.internal.ColumnInfo; |
14 | import·io.realm.internal.OsSchemaInfo; | 14 | import·io.realm.internal.OsSchemaInfo; |
15 | import·g.b.t; | 15 | import·g.b.t; |
16 | import·java.io.Serializable; | 16 | import·java.io.Serializable; |
17 | import·g.b.y; | |
18 | import·g.b.y$a; | |
19 | import·g.b.w; | 17 | import·g.b.w; |
20 | import·g.b.w$a; | 18 | import·g.b.w$a; |
| 19 | import·g.b.y; |
| 20 | import·g.b.y$a; |
21 | import·g.b.a0.k; | 21 | import·g.b.a0.k; |
22 | import·java.util.Map; | 22 | import·java.util.Map; |
23 | import·java.util.Collections; | 23 | import·java.util.Collections; |
24 | import·a.a.a.c.f.a; | |
25 | import·a.a.a.c.f.b; | 24 | import·a.a.a.c.f.b; |
| 25 | import·a.a.a.c.f.a; |
26 | import·java.util.HashSet; | 26 | import·java.util.HashSet; |
27 | import·java.util.Set; | 27 | import·java.util.Set; |
28 | import·io.realm.internal.RealmProxyMediator; | 28 | import·io.realm.internal.RealmProxyMediator; |
| |
29 | public·class·DefaultRealmModuleMediator·extends·RealmProxyMediator | 29 | public·class·DefaultRealmModuleMediator·extends·RealmProxyMediator |
30 | { | 30 | { |
31 | ····public·static·final·Set·a; | 31 | ····public·static·final·Set·a; |
32 | ···· | 32 | ···· |
33 | ····static·{ | 33 | ····static·{ |
34 | ········final·HashSet<Class<b>>·s·=·new·HashSet<Class<b>>(2); | 34 | ········final·HashSet<Class<a>>·s·=·new·HashSet<Class<a>>(2); |
35 | ········s.add(a.class); | |
36 | ········s.add(b.class); | 35 | ········s.add(b.class); |
| 36 | ········s.add(a.class); |
37 | ········a·=·Collections.unmodifiableSet((Set<?>)s); | 37 | ········a·=·Collections.unmodifiableSet((Set<?>)s); |
38 | ····} | 38 | ····} |
39 | ···· | 39 | ···· |
40 | ····public·RealmModel·copyOrUpdate(final·Realm·realm,·final·RealmModel·realmModel,·final·boolean·b,·final·Map·map,·final·Set·set)·{ | 40 | ····public·RealmModel·copyOrUpdate(final·Realm·realm,·final·RealmModel·realmModel,·final·boolean·b,·final·Map·map,·final·Set·set)·{ |
41 | ········final·Class<b>·obj·=·b.class; | |
42 | ········final·Class<a>·obj2·=·a.class; | 41 | ········final·Class<a>·obj·=·a.class; |
| 42 | ········final·Class<b>·obj2·=·b.class; |
43 | ········Serializable·s; | 43 | ········Serializable·s; |
44 | ········if·(realmModel·instanceof·k)·{ | 44 | ········if·(realmModel·instanceof·k)·{ |
45 | ············s·=·realmModel.getClass().getSuperclass(); | 45 | ············s·=·realmModel.getClass().getSuperclass(); |
46 | ········} | 46 | ········} |
47 | ········else·{ | 47 | ········else·{ |
48 | ············s·=·realmModel.getClass(); | 48 | ············s·=·realmModel.getClass(); |
49 | ········} | 49 | ········} |
50 | ········Object·obj3; | 50 | ········Object·obj3; |
51 | ········if·(s.equals(obj2))·{ | 51 | ········if·(s.equals(obj2))·{ |
52 | ············final·t·q·=·realm.q(); | 52 | ············final·t·q·=·realm.q(); |
53 | ············q.a(); | 53 | ············q.a(); |
54 | ············obj3·=·w.a(realm,·(w$a)q.f.a((Class)obj2),·(a)realmModel,·b,·map,·set); | 54 | ············obj3·=·y.a(realm,·(y$a)q.f.a((Class)obj2),·(b)realmModel,·b,·map,·set); |
55 | ········} | 55 | ········} |
56 | ········else·{ | 56 | ········else·{ |
57 | ············if·(!s.equals(obj))·{ | 57 | ············if·(!s.equals(obj))·{ |
58 | ················throw·RealmProxyMediator.getMissingProxyClassException((Class)s); | 58 | ················throw·RealmProxyMediator.getMissingProxyClassException((Class)s); |
59 | ············} | 59 | ············} |
60 | ············final·t·q2·=·realm.q(); | 60 | ············final·t·q2·=·realm.q(); |
61 | ············q2.a(); | 61 | ············q2.a(); |
62 | ············obj3·=·y.a(realm,·(y$a)q2.f.a((Class)obj),·(b)realmModel,·b,·map,·set); | 62 | ············obj3·=·w.a(realm,·(w$a)q2.f.a((Class)obj),·(a)realmModel,·b,·map,·set); |
63 | ········} | 63 | ········} |
64 | ········return·((Class<RealmModel>)s).cast(obj3); | 64 | ········return·((Class<RealmModel>)s).cast(obj3); |
65 | ····} | 65 | ····} |
66 | ···· | 66 | ···· |
67 | ····public·ColumnInfo·createColumnInfo(final·Class·clazz,·final·OsSchemaInfo·osSchemaInfo)·{ | 67 | ····public·ColumnInfo·createColumnInfo(final·Class·clazz,·final·OsSchemaInfo·osSchemaInfo)·{ |
68 | ········RealmProxyMediator.checkClass(clazz); | 68 | ········RealmProxyMediator.checkClass(clazz); |
69 | ········if·(clazz.equals(a.class))·{ | |
70 | ············return·(ColumnInfo)w.a(osSchemaInfo); | |
71 | ········} | |
72 | ········if·(clazz.equals(b.class))·{ | 69 | ········if·(clazz.equals(b.class))·{ |
73 | ············return·(ColumnInfo)y.a(osSchemaInfo); | 70 | ············return·(ColumnInfo)y.a(osSchemaInfo); |
74 | ········} | 71 | ········} |
| 72 | ········if·(clazz.equals(a.class))·{ |
| 73 | ············return·(ColumnInfo)w.a(osSchemaInfo); |
| 74 | ········} |
75 | ········throw·RealmProxyMediator.getMissingProxyClassException(clazz); | 75 | ········throw·RealmProxyMediator.getMissingProxyClassException(clazz); |
76 | ····} | 76 | ····} |
77 | ···· | 77 | ···· |
78 | ····public·RealmModel·createDetachedCopy(final·RealmModel·realmModel,·final·int·n,·final·Map·map)·{ | 78 | ····public·RealmModel·createDetachedCopy(final·RealmModel·realmModel,·final·int·n,·final·Map·map)·{ |
79 | ········final·Class<?·super·RealmModel>·superclass·=·realmModel.getClass().getSuperclass(); | 79 | ········final·Class<?·super·RealmModel>·superclass·=·realmModel.getClass().getSuperclass(); |
80 | ········Object·obj; | 80 | ········Object·obj; |
81 | ········if·(superclass.equals(a.class))·{ | 81 | ········if·(superclass.equals(b.class))·{ |
82 | ············obj·=·w.a((a)realmModel,·0,·n,·map); | 82 | ············obj·=·y.a((b)realmModel,·0,·n,·map); |
83 | ········} | 83 | ········} |
84 | ········else·{ | 84 | ········else·{ |
85 | ············if·(!superclass.equals(b.class))·{ | 85 | ············if·(!superclass.equals(a.class))·{ |
86 | ················throw·RealmProxyMediator.getMissingProxyClassException((Class)superclass); | 86 | ················throw·RealmProxyMediator.getMissingProxyClassException((Class)superclass); |
87 | ············} | 87 | ············} |
88 | ············obj·=·y.a((b)realmModel,·0,·n,·map); | 88 | ············obj·=·w.a((a)realmModel,·0,·n,·map); |
89 | ········} | 89 | ········} |
90 | ········return·superclass.cast(obj); | 90 | ········return·superclass.cast(obj); |
91 | ····} | 91 | ····} |
92 | ···· | 92 | ···· |
93 | ····public·RealmModel·createOrUpdateUsingJsonObject(final·Class·clazz,·final·Realm·realm,·final·JSONObject·jsonObject,·final·boolean·b)·{ | 93 | ····public·RealmModel·createOrUpdateUsingJsonObject(final·Class·clazz,·final·Realm·realm,·final·JSONObject·jsonObject,·final·boolean·b)·{ |
94 | ········RealmProxyMediator.checkClass(clazz); | 94 | ········RealmProxyMediator.checkClass(clazz); |
95 | ········Object·obj; | 95 | ········Object·obj; |
96 | ········if·(clazz.equals(a.class))·{ | 96 | ········if·(clazz.equals(b.class))·{ |
97 | ············obj·=·w.a(realm,·jsonObject,·b); | 97 | ············obj·=·y.a(realm,·jsonObject); |
98 | ········} | 98 | ········} |
99 | ········else·{ | 99 | ········else·{ |
100 | ············if·(!clazz.equals(b.class))·{ | 100 | ············if·(!clazz.equals(a.class))·{ |
101 | ················throw·RealmProxyMediator.getMissingProxyClassException(clazz); | 101 | ················throw·RealmProxyMediator.getMissingProxyClassException(clazz); |
102 | ············} | 102 | ············} |
103 | ············obj·=·y.a(realm,·jsonObject); | 103 | ············obj·=·w.a(realm,·jsonObject,·b); |
104 | ········} | 104 | ········} |
105 | ········return·clazz.cast(obj); | 105 | ········return·clazz.cast(obj); |
106 | ····} | 106 | ····} |
107 | ···· | 107 | ···· |
108 | ····public·RealmModel·createUsingJsonStream(final·Class·clazz,·final·Realm·realm,·final·JsonReader·jsonReader)·{ | 108 | ····public·RealmModel·createUsingJsonStream(final·Class·clazz,·final·Realm·realm,·final·JsonReader·jsonReader)·{ |
109 | ········RealmProxyMediator.checkClass(clazz); | 109 | ········RealmProxyMediator.checkClass(clazz); |
110 | ········Object·obj; | 110 | ········Object·obj; |
111 | ········if·(clazz.equals(a.class))·{ | 111 | ········if·(clazz.equals(b.class))·{ |
112 | ············obj·=·w.a(realm,·jsonReader); | 112 | ············obj·=·y.a(realm,·jsonReader); |
113 | ········} | 113 | ········} |
114 | ········else·{ | 114 | ········else·{ |
115 | ············if·(!clazz.equals(b.class))·{ | 115 | ············if·(!clazz.equals(a.class))·{ |
116 | ················throw·RealmProxyMediator.getMissingProxyClassException(clazz); | 116 | ················throw·RealmProxyMediator.getMissingProxyClassException(clazz); |
117 | ············} | 117 | ············} |
118 | ············obj·=·y.a(realm,·jsonReader); | 118 | ············obj·=·w.a(realm,·jsonReader); |
119 | ········} | 119 | ········} |
120 | ········return·clazz.cast(obj); | 120 | ········return·clazz.cast(obj); |
121 | ····} | 121 | ····} |
122 | ···· | 122 | ···· |
123 | ····public·Map·getExpectedObjectSchemaInfoMap()·{ | 123 | ····public·Map·getExpectedObjectSchemaInfoMap()·{ |
124 | ········final·HashMap<Class<a>,·OsObjectSchemaInfo>·hashMap·=·new·HashMap<Class<a>,·OsObjectSchemaInfo>(2); | 124 | ········final·HashMap<Class<b>,·OsObjectSchemaInfo>·hashMap·=·new·HashMap<Class<b>,·OsObjectSchemaInfo>(2); |
125 | ········hashMap.put(a.class,·w.h); | 125 | ········hashMap.put(b.class,·y.f); |
126 | ········hashMap.put((Class<a>)b.class,·y.f); | 126 | ········hashMap.put((Class<b>)a.class,·w.h); |
127 | ········return·hashMap; | 127 | ········return·hashMap; |
Max diff block lines reached; 6512/11902 bytes (54.71%) of diff not shown.
|