File tree Expand file tree Collapse file tree 2 files changed +4
-29
lines changed
main/java/com/google/gson
test/java/com/google/gson Expand file tree Collapse file tree 2 files changed +4
-29
lines changed Original file line number Diff line number Diff line change @@ -135,27 +135,8 @@ public boolean hasModifier(int modifier) {
135
135
return (field .getModifiers () & modifier ) != 0 ;
136
136
}
137
137
138
- /**
139
- * Returns the value of the field represented by this {@code Field}, on
140
- * the specified object. The value is automatically wrapped in an
141
- * object if it has a primitive type.
142
- *
143
- * @return the value of the represented field in object
144
- * {@code obj}; primitive values are wrapped in an appropriate
145
- * object before being returned
146
- * @throws IllegalAccessException
147
- * @throws IllegalArgumentException
148
- */
149
- Object get (Object instance ) throws IllegalAccessException {
150
- return field .get (instance );
151
- }
152
-
153
- /**
154
- * This is exposed internally only for the removing synthetic fields from the JSON output.
155
- *
156
- * @return true if the field is synthetic; otherwise false
157
- */
158
- boolean isSynthetic () {
159
- return field .isSynthetic ();
138
+ @ Override
139
+ public String toString () {
140
+ return field .toString ();
160
141
}
161
142
}
Original file line number Diff line number Diff line change 17
17
package com .google .gson ;
18
18
19
19
import com .google .gson .reflect .TypeToken ;
20
-
21
- import junit .framework .TestCase ;
22
-
23
20
import java .lang .reflect .Modifier ;
24
21
import java .lang .reflect .Type ;
25
22
import java .util .List ;
23
+ import junit .framework .TestCase ;
26
24
27
25
/**
28
26
* Unit tests for the {@link FieldAttributes} class.
@@ -62,10 +60,6 @@ public void testModifiers() throws Exception {
62
60
assertTrue (fieldAttributes .hasModifier (Modifier .TRANSIENT ));
63
61
}
64
62
65
- public void testIsSynthetic () throws Exception {
66
- assertFalse (fieldAttributes .isSynthetic ());
67
- }
68
-
69
63
public void testName () throws Exception {
70
64
assertEquals ("bar" , fieldAttributes .getName ());
71
65
}
You can’t perform that action at this time.
0 commit comments