Skip to content
Permalink
Browse files

Merge branch 'master' into add-code-of-conduct-1

  • Loading branch information
jamesmudd committed Oct 19, 2019
2 parents cf3bdf5 + 5a2e304 commit 60f16de82b7c44293f5b729d1e362b4c19f38e61
@@ -21,8 +21,9 @@ A clear and concise description of what you expected to happen.
**Please complete the following information:**
- `jhdf` version
- Java version
- OS (Windows, Mac, Linux)
- Stack trace
- `jhdf` logging if possible.

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here, or possible solutions/workarounds.
@@ -25,6 +25,7 @@
import java.util.List;

import static io.jhdf.TestUtils.flatten;
import static io.jhdf.TestUtils.getDimensions;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
@@ -67,14 +68,4 @@ private Executable createTest(String datasetPath) {
};
}

private int[] getDimensions(Object data) {
List<Integer> dims = new ArrayList<>();
dims.add(Array.getLength(data));

while (Array.get(data, 0).getClass().isArray()) {
data = Array.get(data, 0);
dims.add(Array.getLength(data));
}
return ArrayUtils.toPrimitive(dims.toArray(new Integer[0]));
}
}
@@ -36,6 +36,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static io.jhdf.TestUtils.getDimensions;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.anEmptyMap;
import static org.hamcrest.Matchers.equalTo;
@@ -162,17 +163,6 @@ private void verifyDataset(Dataset dataset, Group group) {
}
}

private int[] getDimensions(Object data) {
List<Integer> dims = new ArrayList<>();
dims.add(Array.getLength(data));

while (Array.get(data, 0).getClass().isArray()) {
data = Array.get(data, 0);
dims.add(Array.getLength(data));
}
return ArrayUtils.toPrimitive(dims.toArray(new Integer[0]));
}

private Class<?> getType(Object data) {
if (Array.get(data, 0).getClass().isArray()) {
return getType(Array.get(data, 0));

0 comments on commit 60f16de

Please sign in to comment.
You can’t perform that action at this time.