File tree Expand file tree Collapse file tree
src/main/java/org/scijava/ops/flim Expand file tree Collapse file tree Original file line number Diff line number Diff line change 106106 <scijava-taglets .version>1.0.1-SNAPSHOT</scijava-taglets .version>
107107 <scijava-types .version>1.0.1-SNAPSHOT</scijava-types .version>
108108
109+ <gson .version>2.14.0</gson .version>
110+
109111 <scijava .ops.parse>true</scijava .ops.parse>
110112
111113 <flimlib .version>2.1.1</flimlib .version>
Original file line number Diff line number Diff line change 3131
3232import com .google .gson .*;
3333import com .google .gson .annotations .Expose ;
34- import com .google .gson .reflect .TypeToken ;
3534import flimlib .FitFunc ;
3635import flimlib .NoiseType ;
3736import flimlib .RestrainType ;
@@ -309,8 +308,12 @@ public static <I extends RealType<I>> FitParams<I> fromJSON(
309308 };
310309 var gson = new GsonBuilder ().registerTypeAdapter (FitFunc .class ,
311310 fitfuncDeserializer ).create ();
312- return gson .fromJson (jsonString , new TypeToken <FitParams <I >>() {}
313- .getType ());
311+ // Deserialize to the raw FitParams type: the only field using the type
312+ // variable I ({@link #transMap}) is not serialized (no @Expose), and
313+ // recent Gson versions reject a TypeToken that contains a type variable.
314+ @ SuppressWarnings ("unchecked" )
315+ FitParams <I > params = gson .fromJson (jsonString , FitParams .class );
316+ return params ;
314317 }
315318
316319 @ Override
You can’t perform that action at this time.
0 commit comments