You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2017/04/01 14:22:52 UTC
svn commit: r1789805 - in /sis/branches/JDK8: ./
application/sis-webapp/src/main/java/org/apache/sis/index/tree/
core/sis-feature/src/main/java/org/apache/sis/filter/
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/
core/sis-metada...
Author: desruisseaux
Date: Sat Apr 1 14:22:51 2017
New Revision: 1789805
URL: http://svn.apache.org/viewvc?rev=1789805&view=rev
Log:
Enforce more checkstyle rules regarding whitespaces.
Modified:
sis/branches/JDK8/application/sis-webapp/src/main/java/org/apache/sis/index/tree/GeoRSSData.java
sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/filter/DefaultFilterFactory.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/TypeMapper.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java
sis/branches/JDK8/pom.xml
sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
sis/branches/JDK8/storage/sis-shapefile/pom.xml
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeNode.java
Modified: sis/branches/JDK8/application/sis-webapp/src/main/java/org/apache/sis/index/tree/GeoRSSData.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/application/sis-webapp/src/main/java/org/apache/sis/index/tree/GeoRSSData.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/application/sis-webapp/src/main/java/org/apache/sis/index/tree/GeoRSSData.java [UTF-8] (original)
+++ sis/branches/JDK8/application/sis-webapp/src/main/java/org/apache/sis/index/tree/GeoRSSData.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -106,7 +106,7 @@ public class GeoRSSData implements QuadT
*/
public void saveToFile(Item item, GeoRSSModule geoRSSModule,
String directory) {
- if(!new File(directory).exists()) new File(directory).mkdirs();
+ if (!new File(directory).exists()) new File(directory).mkdirs();
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(directory
+ filename));
Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/filter/DefaultFilterFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/filter/DefaultFilterFactory.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/filter/DefaultFilterFactory.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/filter/DefaultFilterFactory.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -712,7 +712,7 @@ public class DefaultFilterFactory implem
* {@inheritDoc }
*/
@Override
- public Function function(final String name, final Expression ... parameters) {
+ public Function function(final String name, final Expression... parameters) {
throw new UnsupportedOperationException("Not supported yet.");
}
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/TypeMapper.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/TypeMapper.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/TypeMapper.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/TypeMapper.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -40,7 +40,7 @@ public final class TypeMapper {
new TypeMapper(Boolean.class, Types.BOOLEAN, "BOOLEAN"),
new TypeMapper(Date .class, Types.TIMESTAMP, "TIMESTAMP"),
new TypeMapper(Double .class, Types.DOUBLE, "DOUBLE PRECISION"),
- new TypeMapper(Float .class, Types.REAL , "REAL"),
+ new TypeMapper(Float .class, Types.REAL, "REAL"),
new TypeMapper(Long .class, Types.BIGINT, "BIGINT"),
new TypeMapper(Integer.class, Types.INTEGER, "INTEGER"),
new TypeMapper(Short .class, Types.SMALLINT, "SMALLINT"),
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -265,7 +265,7 @@ class MathTransformParser extends Abstra
final void parseParameters(final Element element, final ParameterValueGroup parameters,
final Unit<?> defaultUnit, final Unit<Angle> defaultAngularUnit) throws ParseException
{
- final Unit<?> defaultSI = (defaultUnit != null) ? defaultUnit.getSystemUnit(): null;
+ final Unit<?> defaultSI = (defaultUnit != null) ? defaultUnit.getSystemUnit() : null;
Element param = element;
try {
while ((param = element.pullElement(OPTIONAL, WKTKeywords.Parameter)) != null) {
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -248,7 +248,7 @@ public class DefaultFormat extends ISOMe
@XmlElement(name = "specification")
public InternationalString getSpecification() {
final Citation citation = getFormatSpecificationCitation();
- return (citation != null) ? citation.getTitle(): null;
+ return (citation != null) ? citation.getTitle() : null;
}
/**
@@ -317,7 +317,7 @@ public class DefaultFormat extends ISOMe
@XmlElement(name = "version", required = true)
public InternationalString getVersion() {
final Citation citation = getFormatSpecificationCitation();
- return (citation != null) ? citation.getEdition(): null;
+ return (citation != null) ? citation.getEdition() : null;
}
/**
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -825,7 +825,7 @@ class CoordinateOperationRegistry {
* would not know which value to give to the new dimension.
*/
CoordinateReferenceSystem sourceCRS, targetCRS;
- if (! ((sourceCRS = op.getSourceCRS()) instanceof GeodeticCRS
+ if ( !((sourceCRS = op.getSourceCRS()) instanceof GeodeticCRS
&& (targetCRS = op.getTargetCRS()) instanceof GeodeticCRS
&& sourceCRS.getCoordinateSystem() instanceof EllipsoidalCS
&& targetCRS.getCoordinateSystem() instanceof EllipsoidalCS))
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -440,8 +440,8 @@ public class TransverseMercator extends
//-- dQ_d\u03bb = 0;
final double dQ_d\u03c6 = 1 / cos\u03c6 - eccentricitySquared * cos\u03c6 / (1 - \u212fsin\u03c6 * \u212fsin\u03c6);
- final double d\u03b70_d\u03bb = cos\u03bb * coshQ / cosh2Q_sin2\u03bb;
- final double d\u03b70_d\u03c6 = - dQ_d\u03c6 * sin\u03bb * sinhQ / cosh2Q_sin2\u03bb;
+ final double d\u03b70_d\u03bb = cos\u03bb * coshQ / cosh2Q_sin2\u03bb;
+ final double d\u03b70_d\u03c6 = -dQ_d\u03c6 * sin\u03bb * sinhQ / cosh2Q_sin2\u03bb;
final double d\u03be0_d\u03bb = sinhQ * sinh\u03b70 * cos\u03bb / (cosh2Q_sin2\u03bb * sqrt1_thQch\u03b70);
final double d\u03be0_d\u03c6 = (dQ_d\u03c6 * cosh\u03b70 / cosh2Q + d\u03b70_d\u03c6 * sinh\u03b70 * tanhQ) / sqrt1_thQch\u03b70;
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/RangeSet.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -440,12 +440,12 @@ public class RangeSet<E extends Comparab
final int binarySearch(final E value, final int lower, final int upper) {
switch (elementCode) {
case DOUBLE: return Arrays.binarySearch((double[]) array, lower, upper, (Double) value);
- case FLOAT: return Arrays.binarySearch((float []) array, lower, upper, (Float) value);
- case LONG: return Arrays.binarySearch((long []) array, lower, upper, (Long) value);
- case INTEGER: return Arrays.binarySearch((int []) array, lower, upper, (Integer) value);
- case SHORT: return Arrays.binarySearch((short []) array, lower, upper, (Short) value);
- case BYTE: return Arrays.binarySearch((byte []) array, lower, upper, (Byte) value);
- case CHARACTER: return Arrays.binarySearch((char []) array, lower, upper, (Character) value);
+ case FLOAT: return Arrays.binarySearch((float[]) array, lower, upper, (Float) value);
+ case LONG: return Arrays.binarySearch((long[]) array, lower, upper, (Long) value);
+ case INTEGER: return Arrays.binarySearch((int[]) array, lower, upper, (Integer) value);
+ case SHORT: return Arrays.binarySearch((short[]) array, lower, upper, (Short) value);
+ case BYTE: return Arrays.binarySearch((byte[]) array, lower, upper, (Byte) value);
+ case CHARACTER: return Arrays.binarySearch((char[]) array, lower, upper, (Character) value);
default: return Arrays.binarySearch((Object[]) array, lower, upper, value);
}
}
@@ -1580,12 +1580,12 @@ public class RangeSet<E extends Comparab
final Object a2 = that.array;
switch (elementCode) {
case DOUBLE: return Arrays.equals((double[]) a1, (double[]) a2);
- case FLOAT: return Arrays.equals((float []) a1, ( float[]) a2);
- case LONG: return Arrays.equals((long []) a1, ( long[]) a2);
- case INTEGER: return Arrays.equals((int []) a1, ( int[]) a2);
- case SHORT: return Arrays.equals((short []) a1, ( short[]) a2);
- case BYTE: return Arrays.equals((byte []) a1, ( byte[]) a2);
- case CHARACTER: return Arrays.equals((char []) a1, ( char[]) a2);
+ case FLOAT: return Arrays.equals((float[]) a1, (float[]) a2);
+ case LONG: return Arrays.equals((long[]) a1, (long[]) a2);
+ case INTEGER: return Arrays.equals((int[]) a1, (int[]) a2);
+ case SHORT: return Arrays.equals((short[]) a1, (short[]) a2);
+ case BYTE: return Arrays.equals((byte[]) a1, (byte[]) a2);
+ case CHARACTER: return Arrays.equals((char[]) a1, (char[]) a2);
default: return Arrays.equals((Object[]) a1, (Object[]) a2);
}
}
Modified: sis/branches/JDK8/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/pom.xml?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/pom.xml (original)
+++ sis/branches/JDK8/pom.xml Sat Apr 1 14:22:51 2017
@@ -677,6 +677,13 @@ Apache SIS is a free software, Java lang
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.puppycrawl.tools</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>7.6.1</version>
+ </dependency>
+ </dependencies>
<executions>
<execution>
<goals>
@@ -688,11 +695,42 @@ Apache SIS is a free software, Java lang
<consoleOutput>true</consoleOutput>
<checkstyleRules>
<module name="Checker">
- <module name="FileTabCharacter"/> <!-- Checks that there are no tab characters in the file. -->
- <module name="NewlineAtEndOfFile"/> <!-- Checks that there is a newline at the end of each file. -->
+ <module name="FileTabCharacter"/> <!-- No tab characters in the file. -->
+ <module name="NewlineAtEndOfFile"/> <!-- Newline at the end of each file. -->
<module name="TreeWalker">
- <module name="RedundantImport"/> <!-- Checks for redundant import statements. -->
- <module name="GenericWhitespace"/> <!-- Checks that the whitespace around the Generic tokens follow the typical convention. -->
+ <module name="NoLineWrap"/> <!-- Imports and package statements are not line-wrapped. -->
+ <module name="RedundantImport"/> <!-- No redundant import statements. -->
+ <module name="GenericWhitespace"/> <!-- Whitespace around the Generic tokens follow typical convention. -->
+ <module name="TypecastParenPad"/> <!-- No space inside parentheses for typecasts. -->
+ <module name="SeparatorWrap"> <!-- No line wrapping before comma. -->
+ <property name="tokens" value="COMMA"/>
+ </module>
+ <module name="WhitespaceAfter"> <!-- Checks that a token is followed by whitespace. -->
+ <property name="tokens" value="TYPECAST, LITERAL_IF, LITERAL_ELSE, LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/>
+ </module>
+ <module name="NoWhitespaceAfter"> <!-- No whitespace after "++" in ++x, etc. -->
+ <property name="tokens" value="INC, DEC, BNOT, LNOT"/>
+ </module>
+ <module name="NoWhitespaceBefore"> <!-- No whitespace before "++" in x++, etc. -->
+ <property name="tokens" value="COMMA, POST_INC, POST_DEC, ELLIPSIS"/>
+ </module>
+ <module name="WhitespaceAround">
+ <property name="tokens" value="
+ MINUS_ASSIGN, STAR_ASSIGN, DIV_ASSIGN, MOD_ASSIGN, MOD,
+ SL, SL_ASSIGN, SR, SR_ASSIGN, BSR, BSR_ASSIGN,
+ BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BXOR, BXOR_ASSIGN,
+ TYPE_EXTENSION_AND, LAND, LOR, QUESTION, LAMBDA,
+ COLON, DO_WHILE, LITERAL_DO, LITERAL_WHILE, LITERAL_FOR,
+ LITERAL_ELSE, LITERAL_SWITCH,
+ LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY,
+ LITERAL_SYNCHRONIZED"/>
+ <property name="allowEmptyConstructors" value="true"/>
+ <property name="allowEmptyMethods" value="true"/>
+ <property name="allowEmptyTypes" value="true"/>
+ <property name="allowEmptyLoops" value="true"/>
+ <property name="allowEmptyLambdas" value="true"/>
+ <property name="allowEmptyCatches" value="true"/>
+ </module>
</module>
</module>
</checkstyleRules>
Modified: sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -1009,7 +1009,7 @@ final class LandsatReader {
* Invoked when a non-fatal exception occurred while reading metadata. This method
* sends a record to the registered listeners if any, or logs the record otherwise.
*/
- private void warning(String key, final BufferedReader reader ,final Exception e) {
+ private void warning(String key, final BufferedReader reader, final Exception e) {
if (key != null) {
String file = getFilename();
if (reader instanceof LineNumberReader) {
Modified: sis/branches/JDK8/storage/sis-shapefile/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/pom.xml?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/pom.xml (original)
+++ sis/branches/JDK8/storage/sis-shapefile/pom.xml Sat Apr 1 14:22:51 2017
@@ -91,6 +91,18 @@ Read and write files in the Shapefile fo
</instructions>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <skip>true</skip> <!-- Java code formatting in this module is different than other modules. -->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeNode.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeNode.java?rev=1789805&r1=1789804&r2=1789805&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeNode.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeNode.java [UTF-8] Sat Apr 1 14:22:51 2017
@@ -43,7 +43,7 @@ final class QuadTreeNode {
* node's capcacity
*/
public QuadTreeNode(int id, int capacity) {
- this.capacity = capacity > 0 ? capacity:MIN_CAPACITY;
+ this.capacity = capacity > 0 ? capacity : MIN_CAPACITY;
this.dataCount = 0;
this.data = new QuadTreeData[this.capacity];
this.type = NodeType.BLACK;