Skip to content

Commit

Permalink
fix/ignore UseDiamondOperator violations + reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mprins committed Apr 26, 2024
1 parent 8a4e640 commit 2134233
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static class CoveragesConsistencyChecker {

private static double DELTA = 1E-10;

private Set<ParameterDescriptor<List>> dynamicParameters; //NOPMD
private Set<ParameterDescriptor<List>> dynamicParameters; // NOPMD

private String[] metadataNames;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ protected List<LayerInfo> getRemoteLayersFromUserLayer(UserLayer ul) throws Serv

List<LayerInfo> layers = new ArrayList<>();
// not sure if this has side-effects
Style[] layerStyles = ul.getUserStyles(); //NOPMD
Style[] layerStyles = ul.getUserStyles(); // NOPMD

for (FeatureTypeConstraint featureConstraint : featureConstraints) {
// make sure the layer is there
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static class GranuleStoreView implements GranuleStore {

private CoverageView coverageView;

private String name; //NOPMD
private String name; // NOPMD

private boolean readOnly;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,10 @@ CoverageInfo readCoverage(LegacyCoverageInfoReader cInfoReader) throws Exception
CoverageDimensionInfo cd = factory.createCoverageDimension();
cd.setName((String) stringObjectMap.get("name"));
cd.setDescription((String) stringObjectMap.get("description"));
cd.setRange(NumberRange.create((Double) stringObjectMap.get("min"), (Double) stringObjectMap.get("max")));
cd.setRange(
NumberRange.create(
(Double) stringObjectMap.get("min"),
(Double) stringObjectMap.get("max")));
coverage.getDimensions().add(cd);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void configureGeoServerLogging(
List<Appender> savedAppenders = new ArrayList<>();
{
@SuppressWarnings({
"PMD.CloseResource"
"PMD.CloseResource"
}) // current context, no need to enforce AutoClosable
LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false);
Configuration configuration = loggerContext.getConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ private Map<String, Object> buildDummyFeatureTypeInfo(ComplexAttribute f) {
* @author Gabriel Roldan
* @see AttributeMap
*/
@SuppressWarnings("PMD.UseDiamondOperator")
private class FeatureAttributesMap extends AbstractMap {
private Set<MapEntry> entrySet;

Expand Down Expand Up @@ -388,6 +389,7 @@ private List<Map> getListMaps(Name attName) {
* <li>isGeometry: Boolean indicating whether the attribute is of a geometric type
* </ul>
*/
@SuppressWarnings("PMD.UseDiamondOperator")
private class AttributeMap extends AbstractMap {

private final Name attributeName;
Expand Down Expand Up @@ -489,8 +491,7 @@ public Set entrySet() {
Object rawValue = value == null ? "" : value;
boolean isGeometry =
Geometry.class.isAssignableFrom(attributeDescr.getType().getBinding());
entrySet.add(
new MapEntry<Object, Object>("isGeometry", Boolean.valueOf(isGeometry)));
entrySet.add(new MapEntry<Object, Object>("isGeometry", isGeometry));
entrySet.add(new MapEntry<Object, Object>("rawValue", rawValue));
}
return entrySet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public void doInputStreamTest(String testString) throws Exception {
req, WebUtils.DEFAULT_CHARACTER_ENCODING, testString.getBytes());
byte[] b = new byte[32];
try (ServletInputStream sis = req.getInputStream()) {
while ((sis.readLine(b, 0, 32)) > 0) { //NOPMD
// clear out the request body
while ((sis.readLine(b, 0, 32)) > 0) { // NOPMD
// clear out the request body
}
}

Expand Down Expand Up @@ -96,9 +96,10 @@ public void testMixedRequest() throws Exception {
@SuppressWarnings("PMD.EmptyWhileStmt")
private void clearOutBody(HttpServletRequest req) throws IOException {
try (BufferedReader br = req.getReader()) {
while ((br.readLine()) != null) { //NOPMD
while ((br.readLine()) != null) { // NOPMD
// clear out the request body
};
}
;

Check warning on line 102 in src/main/src/test/java/org/geoserver/filters/BufferedRequestWrapperTest.java

View workflow job for this annotation

GitHub Actions / PMD

Code Style UnnecessarySemicolon

Unnecessary semicolon
}
}

Expand Down

0 comments on commit 2134233

Please sign in to comment.