Skip to content

Commit 3e4064e

Browse files
committed
Apply new spotless plugin
1 parent dc27159 commit 3e4064e

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

cdm-test-utils/src/main/java/ucar/unidata/util/test/UtilsTestStructureArray.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ private void testArrayStructureByRecno(ArrayStructure as) {
7575
List<StructureMembers.Member> members = sdata.getMembers();
7676
for (StructureMembers.Member m : members) {
7777
Array sdataArray = sdata.getArray(m);
78-
assert (sdataArray.getElementType() == m.getDataType().getPrimitiveClassType()) : sdataArray.getElementType()
79-
+ " != " + m.getDataType().getPrimitiveClassType();
78+
assert (sdataArray.getElementType() == m.getDataType().getPrimitiveClassType())
79+
: sdataArray.getElementType() + " != " + m.getDataType().getPrimitiveClassType();
8080

8181
Array sdataArray2 = sdata.getArray(m.getName());
8282
UtilsMa2Test.testEquals(sdataArray, sdataArray2);

cdm-test/src/test/java/ucar/nc2/dataset/TestTransforms.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ private VerticalTransform test(NetcdfDataset ncd, String levName, String varName
309309
// should be compatible with vunit
310310
if (vunit != null) {
311311
String vertCoordUnit = vt.getUnitString();
312-
assert vunit.isCompatible(vertCoordUnit) : vertCoordUnit + " not udunits compatible with "
313-
+ vunit.getUnitString();
312+
assert vunit.isCompatible(vertCoordUnit)
313+
: vertCoordUnit + " not udunits compatible with " + vunit.getUnitString();
314314
}
315315

316316
return vt;

cdm-test/src/test/java/ucar/nc2/ncml/TestNcMLStrides.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public void testStride(String stride) throws IOException, InvalidRangeException
100100
Index ci = correct.getIndex();
101101
Index di = data.getIndex();
102102
for (int i = 0; i < data.getSize(); i++)
103-
assert (data.getInt(di.set(i)) == correct.getInt(ci.set(i))) : stride + " index " + i + " = "
104-
+ data.getInt(di.set(i)) + " != " + correct.getInt(ci.set(i));
103+
assert (data.getInt(di.set(i)) == correct.getInt(ci.set(i)))
104+
: stride + " index " + i + " = " + data.getInt(di.set(i)) + " != " + correct.getInt(ci.set(i));
105105
}
106106

107107
}

cdm/core/src/main/java/ucar/ma2/ArrayStructureMA.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ public static ArrayStructureMA factoryMA(ArrayStructure from) throws IOException
228228
if (numRecords == -1) {
229229
numRecords = firstDimLen;
230230
} else {
231-
assert numRecords == firstDimLen : String.format(
232-
"Expected all structure members to have the same first" + "dimension length, but %d != %d.", numRecords,
233-
firstDimLen);
231+
assert numRecords == firstDimLen
232+
: String.format("Expected all structure members to have the same first" + "dimension length, but %d != %d.",
233+
numRecords, firstDimLen);
234234
}
235235

236236
memberArrayMap.put(m.getName(), array);

cdm/core/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ protected TableConfig getTimeSeriesProfileConfig(NetcdfDataset ds, EncodingInfo
420420
// zDim = z.getDimension(0);
421421
}
422422
} else { // 1d time
423-
assert z.getRank() != 1
424-
|| !time.getDimension(0).equals(z.getDimension(0)) : "time and z dimensions must be different";
423+
assert z.getRank() != 1 || !time.getDimension(0).equals(z.getDimension(0))
424+
: "time and z dimensions must be different";
425425
}
426426

427427
TableConfig profileTable = makeMultidimInner(ds, stationTable, info.childDim, info, errlog);

cdm/core/src/main/java/ucar/nc2/ft2/coverage/HorizCoordSys.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,8 @@ private static int calcStride(int numTotal, int maxToInclude) {
756756
int stride = Math.max(1, (int) Math.ceil(numTotal / (double) maxToInclude));
757757
int numIncluded = (int) Math.ceil(numTotal / (double) stride);
758758

759-
assert numIncluded <= maxToInclude : String.format("We're set to include %d points, but we wanted a max of %d.",
760-
numIncluded, maxToInclude);
759+
assert numIncluded <= maxToInclude
760+
: String.format("We're set to include %d points, but we wanted a max of %d.", numIncluded, maxToInclude);
761761
return stride;
762762
}
763763

@@ -766,9 +766,9 @@ private static void assertNotExceedingMaxBoundaryPoints(int numBoundaryPoints, i
766766
// Widen to long to avoid possible overflow, because last two arguments will often be Integer.MAX_VALUE.
767767
long maxBoundaryPoints = 2 * (long) maxPointsInYEdge + 2 * (long) maxPointsInXEdge;
768768

769-
assert numBoundaryPoints <= maxBoundaryPoints : String.format(
770-
"We should be returning a maximum of %d boundary points, but we're returning %d instead.", maxBoundaryPoints,
771-
numBoundaryPoints);
769+
assert numBoundaryPoints <= maxBoundaryPoints
770+
: String.format("We should be returning a maximum of %d boundary points, but we're returning %d instead.",
771+
maxBoundaryPoints, numBoundaryPoints);
772772
}
773773

774774
/**

cdm/core/src/test/java/thredds/client/catalog/TestResolve.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public void testResolve() throws IOException {
2828
logger.debug("ACD service= {}", s);
2929

3030
assert getAccessURL(cat, "nest11").equals("http://www.acd.ucar.edu/dods/testServer/flux/CO2.nc");
31-
assert getAccessURL(cat, "nest12").equals(base + "netcdf/data/flux/NO2.nc") : getAccessURL(cat, "nest12") + " != "
32-
+ ClientCatalogUtil.makeFilepath() + "netcdf/data/flux/NO2.nc";
31+
assert getAccessURL(cat, "nest12").equals(base + "netcdf/data/flux/NO2.nc")
32+
: getAccessURL(cat, "nest12") + " != " + ClientCatalogUtil.makeFilepath() + "netcdf/data/flux/NO2.nc";
3333

3434
assert getMetadataURL(cat, "nest1", "NETCDF").equals("any.xml");
3535
assert getMetadataURL(cat, "nest1", "ADN").equals("http://you/corrupt.xml");

netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4Iosp.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ private void makeDimensions(Group4 g4) throws IOException {
331331
if (ret != 0)
332332
throw new IOException(ret + ": " + nc4.nc_strerror(ret));
333333

334-
assert numDimsInGoup_p.getValue() == numDimidsInGroup_p.getValue() : String.format(
335-
"Number of dimensions in group (%s) differed from number of dimension IDs in group (%s).",
336-
numDimsInGoup_p.getValue(), numDimidsInGroup_p.getValue());
334+
assert numDimsInGoup_p.getValue() == numDimidsInGroup_p.getValue()
335+
: String.format("Number of dimensions in group (%s) differed from number of dimension IDs in group (%s).",
336+
numDimsInGoup_p.getValue(), numDimidsInGroup_p.getValue());
337337

338338
// We need this in order to allocate the correct length for unlimitedDimIdsInGroup.
339339
IntByReference numUnlimitedDimsInGroup_p = new IntByReference();

waterml/src/main/java/ucar/nc2/ogc/waterml/NcMeasureType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public static MeasureType initValue(MeasureType value, PointFeature pointFeat, V
2222
.format("%s appeared in the list of data variables but not in the StructureData.", dataVar.getShortName());
2323

2424
Array dataArray = pointFeat.getDataAll().getArray(firstDataMember);
25-
assert dataArray.getSize() == 1 : String.format("Expected array to be scalar, but its shape was %s.",
26-
Arrays.toString(dataArray.getShape()));
25+
assert dataArray.getSize() == 1
26+
: String.format("Expected array to be scalar, but its shape was %s.", Arrays.toString(dataArray.getShape()));
2727

2828
double dataVal = dataArray.getDouble(0);
2929
value.setDoubleValue(dataVal);

0 commit comments

Comments
 (0)