Skip to content

Commit 04f2492

Browse files
Tara Drwenskihaileyajohnson
authored andcommitted
Remove unnecessary cast from Object
1 parent 390ed8d commit 04f2492

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

cdm-test/src/test/java/ucar/nc2/iosp/grib/TestIntervalsTimeCoords2D.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ public static Collection<Object[]> getTestParameters() throws IOException {
8080

8181
String filename;
8282
String parameter;
83-
Object bounds;
83+
int[][] bounds;
8484
int ndim;
8585

86-
public TestIntervalsTimeCoords2D(String filename, String parameter, Object bounds, int ndim) {
86+
public TestIntervalsTimeCoords2D(String filename, String parameter, int[][] bounds, int ndim) {
8787
this.filename = filename;
8888
this.parameter = parameter;
8989
this.bounds = bounds;
@@ -95,8 +95,6 @@ public TestIntervalsTimeCoords2D(String filename, String parameter, Object bound
9595
*/
9696
@Test
9797
public void checkTimeIntervalCoordinates() throws Exception {
98-
int[][] tb = (int[][]) bounds;
99-
10098
logger.debug("Open " + filename + "(" + parameter + ")");
10199

102100
try (NetcdfFile ncf = NetcdfFiles.open(filename)) {
@@ -111,8 +109,8 @@ public void checkTimeIntervalCoordinates() throws Exception {
111109
Dimension dim = var.getDimension(0);
112110
if (dim.getShortName().startsWith("reftime"))
113111
dim = var.getDimension(1);
114-
String bounds = dim.getShortName() + "_bounds";
115-
Variable interval = best.findVariableLocal(bounds);
112+
String dimBounds = dim.getShortName() + "_bounds";
113+
Variable interval = best.findVariableLocal(dimBounds);
116114
assertThat(interval != null).isTrue();
117115

118116
Array data = interval.read();
@@ -121,13 +119,13 @@ public void checkTimeIntervalCoordinates() throws Exception {
121119
while (iter.hasNext()) {
122120
int start = iter.getIntNext();
123121
int end = iter.getIntNext();
124-
if (start != tb[idx][0] || end != tb[idx][1]) {
122+
if (start != bounds[idx][0] || end != bounds[idx][1]) {
125123
logger.error("bounds " + interval.getFullName() + " for file " + filename + ", parameter " + var.getFullName()
126124
+ " failed");
127-
logger.error("interval " + start + " - " + end + " known " + tb[idx][0] + " - " + tb[idx][0]);
125+
logger.error("interval " + start + " - " + end + " known " + bounds[idx][0] + " - " + bounds[idx][0]);
128126
}
129-
assertThat(start).isEqualTo(tb[idx][0]);
130-
assertThat(end).isEqualTo(tb[idx][1]);
127+
assertThat(start).isEqualTo(bounds[idx][0]);
128+
assertThat(end).isEqualTo(bounds[idx][1]);
131129
idx++;
132130
}
133131

0 commit comments

Comments
 (0)