Skip to content

Commit 4ba173e

Browse files
Alexandre Dutraolim7t
authored andcommitted
Fix failing test under JDK 7
The test "should_save_and_retrieve_sphere" was failing because it relied on a setter declared in Sphere that overloads a setter declared in Circle. JDK 7 fails to detect the overloading setter. This fix simply modifies the test to avoid this edge case.
1 parent 70c3631 commit 4ba173e

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

driver-mapping/src/test/java/com/datastax/driver/mapping/MapperPolymorphismTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static class Circle extends Shape {
207207

208208
@Column(name = "center2d") // overridden by a getter in Sphere
209209
@Frozen
210-
private Point2D center;
210+
protected Point2D center;
211211

212212
// tests unusual field name (i.e. does not correspond to getter/setter)
213213
// will be considered as a separate "property" with no getter nor setter;
@@ -401,10 +401,6 @@ public boolean equals(Object o) {
401401
@Table(name = "spheres")
402402
static class Sphere extends Circle implements Shape3D {
403403

404-
// masks field Circle.center
405-
@Frozen
406-
private Point3D center;
407-
408404
private long writeTime;
409405

410406
public Sphere() {
@@ -426,10 +422,12 @@ public UUID getId() {
426422
@Frozen
427423
@Override
428424
public Point3D getCenter() {
429-
return center;
425+
return (Point3D) center;
430426
}
431427

432-
public void setCenter(Point3D center) {
428+
@Override
429+
public void setCenter(Point2D center) {
430+
assert center instanceof Point3D;
433431
this.center = center;
434432
}
435433

0 commit comments

Comments
 (0)