Skip to content

Commit 7610603

Browse files
committed
fixed problems
1 parent d038e2d commit 7610603

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/test/java/org/tensorics/gson/adapters/TensorbackedGsonAdapterTest.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,24 @@ public void simpleScalarDeserializationIsOk() {
8585
* number, type AND ORDER. However, the equality between the original and the deserialized object is then
8686
* not given, as the class of the object is taken into account. This behaviour is considered to be correct.
8787
*/
88+
@SuppressWarnings("AssertBetweenInconvertibleTypes")
8889
@Test
8990
public void deserializationIntoDifferentTbWorks() {
90-
/* This shows cross-deserialization: Into another tensoribacked with the same dimensions.*/
91+
/* This shows cross-deserialization: Into another tensorbacked with the same dimensions.*/
9192
AnInterfaceTensorbacked val = simpleGson.fromJson(JSON_STRING, AnInterfaceTensorbacked.class);
9293
assertThat(val).isNotNull();
9394

9495
/* The tensorbacked objects are not equal in this case ....*/
9596
assertThat(val).isNotEqualTo(TENSORBACKED);
9697

97-
/* However, the underlaying tensors are ...*/
98+
/* However, the underlying tensors are ...*/
9899
assertThat(val.tensor()).isEqualTo(TENSORBACKED.tensor());
99100
}
100101

101102
/**
102103
* The context is not serialized or deserialized currently. This is demonstrated here.
103104
* Can be discussed, if this is good behaviour.... tricky to change anyhow, as the context
104-
* dimensions are not well defined by a tensorbacked.
105+
* dimensions are not well-defined by a tensorbacked.
105106
*/
106107
@Test
107108
public void contextIsNotSerialized() {
@@ -137,9 +138,6 @@ public void complexCoordinateSerializationWithComplexMapKeySupport() {
137138
String string = complexMapKeyGson.toJson(COMPLEX_COORD_TB);
138139
System.out.println(string);
139140
assertThat(string).isEqualTo(COMPLEX_COORD_JSON_STRING);
140-
141-
/* deserialization works, no matter if the flag is set or not */
142-
AComplexCoordTensorbacked deserialized = simpleGson.fromJson(string, AComplexCoordTensorbacked.class);
143141
}
144142

145143
@Test
@@ -163,16 +161,16 @@ public AnInheritedTensorbacked(Tensor<Double> tensor) {
163161

164162
}
165163

166-
public static interface AnInterfaceTensorbacked extends Tensorbacked2d<String, Integer, Double> {
164+
public interface AnInterfaceTensorbacked extends Tensorbacked2d<String, Integer, Double> {
167165

168166
}
169167

170-
public static interface AComplexCoordTensorbacked extends Tensorbacked1d<Pair, Double> {
168+
public interface AComplexCoordTensorbacked extends Tensorbacked1d<Pair, Double> {
171169

172170
}
173171

174-
public static enum AB {
175-
A, B
172+
public enum AB {
173+
A
176174
}
177175

178176
public static class Pair {

0 commit comments

Comments
 (0)