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) {
135135 return (field .getModifiers () & modifier ) != 0 ;
136136 }
137137
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 ();
160141 }
161142}
Original file line number Diff line number Diff line change 1717package com .google .gson ;
1818
1919import com .google .gson .reflect .TypeToken ;
20-
21- import junit .framework .TestCase ;
22-
2320import java .lang .reflect .Modifier ;
2421import java .lang .reflect .Type ;
2522import java .util .List ;
23+ import junit .framework .TestCase ;
2624
2725/**
2826 * Unit tests for the {@link FieldAttributes} class.
@@ -62,10 +60,6 @@ public void testModifiers() throws Exception {
6260 assertTrue (fieldAttributes .hasModifier (Modifier .TRANSIENT ));
6361 }
6462
65- public void testIsSynthetic () throws Exception {
66- assertFalse (fieldAttributes .isSynthetic ());
67- }
68-
6963 public void testName () throws Exception {
7064 assertEquals ("bar" , fieldAttributes .getName ());
7165 }
You can’t perform that action at this time.
0 commit comments