Permalink
Browse files

Improved style with checkstyle. Pom.xml and checkstyle-suppression im…

…proved for better logging of checkstyle results. TODO's still have to be resolved.
  • Loading branch information...
1 parent d3371b1 commit e745d6b0fdb889055556aaab308f5705021bef5c @wardblonde wardblonde committed Sep 22, 2014
@@ -11,6 +11,12 @@
<suppressions>
+ <!-- Exclude source files from the com.recomdata package. -->
+ <suppress checks="[a-zA-Z0-9]*" files="[\\/]recomdata[\\/]" />
+
+ <!--&lt;!&ndash; Exclude source files from the cdisk.odm.jaxb and w3.xmldsig.jaxb packages. &ndash;&gt;-->
+ <!--<suppress checks="[a-zA-Z0-9]*" files="[\\/]jaxb[\\/]" />-->
+
<!-- Disable requiring method javadoc in the test cases. -->
<suppress checks="JavadocMethod" files="^*Test\.java$"/>
View
21 pom.xml
@@ -41,7 +41,7 @@
<build-helper-maven-plugin.version>1.9</build-helper-maven-plugin.version>
<coveralls-maven-plugin.version>2.2.0</coveralls-maven-plugin.version>
<jacoco-maven-plugin.version>0.7.1.201405082137</jacoco-maven-plugin.version>
- <!--<maven-checkstyle-plugin.version>2.12.1</maven-checkstyle-plugin.version>-->
+ <maven-checkstyle-plugin.version>2.12.1</maven-checkstyle-plugin.version>
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<maven-jar-plugin.version>2.4</maven-jar-plugin.version>
<maven-jxr-plugin.version>2.4</maven-jxr-plugin.version>
@@ -190,9 +190,8 @@
<!--</configuration>-->
<!--</plugin>-->
- <!-- Disabled Checkstyle for now. -->
<!-- Run Checkstyle in the verify phase. -->
- <!-- <plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
@@ -208,15 +207,15 @@
<configuration>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
- <!-**-
+ <!--
Workaround for resolving the suppressions file in a Maven build: always check two
module levels above the current project. IDE builds should provide the config_loc
property, hence this setting will not influence the builds triggered in IDEs.
- -**->
- <!-**-<propertyExpansion>config_loc=${project.parent.parent.basedir}/</propertyExpansion>-**->
+ -->
+ <!--<propertyExpansion>config_loc=${project.parent.parent.basedir}/</propertyExpansion>-->
<failsOnError>true</failsOnError>
</configuration>
- </plugin> -->
+ </plugin>
<!-- JaCoCo is used to determine the code coverage of the unit tests. -->
<plugin>
@@ -302,16 +301,16 @@
</plugins>
</build>
- <!-- <reporting>
+ <reporting>
<plugins>
- <!-**- Added the JXR plugin (Java cross-reference tool) to get rid of the "Unable to locate Source XRef to
- - link to - DISABLED" warning when running Checkstyle. -**->
+ <!-- Added the JXR plugin (Java cross-reference tool) to get rid of the "Unable to locate Source XRef to
+ - link to - DISABLED" warning when running Checkstyle. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>${maven-jxr-plugin.version}</version>
</plugin>
</plugins>
- </reporting> -->
+ </reporting>
</project>
@@ -8,26 +8,44 @@
package nl.vumc.odmtoi2b2.export;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* todo: add Javadocs.
+ *
+ * @author <a href="mailto:w.blonde@vumc.nl">Ward Blondé</a>
*/
public class Configuration {
- /**
- * The logger for this class.
- */
- private static final Logger logger = LoggerFactory.getLogger(Configuration.class);
+ /**
+ * The logger for this class.
+ */
+ private static final Logger logger = LoggerFactory.getLogger(Configuration.class);
+
+ /**
+ * todo: add Javadocs.
+ */
+ private int maxClinicalDataEntry;
- private int maxClinicalDataEntry;
+ /**
+ * todo: add Javadocs.
+ */
private String forbiddenSymbolRegex;
+
+ /**
+ * todo: add Javadocs.
+ */
private boolean avoidTransmartSymbolBugs;
+ /**
+ * todo: add Javadocs.
+ *
+ * @param propertiesFilePath
+ */
public Configuration(final String propertiesFilePath) {
try {
final Properties properties = new Properties();
@@ -40,21 +58,35 @@ public Configuration(final String propertiesFilePath) {
this.avoidTransmartSymbolBugs = Boolean.parseBoolean(avoidTransmartSymbolBugsAsString);
} catch (final IOException e) {
- final String message = "Exception while reading configuration properties from file %s.";
- logger.error(String.format(message, propertiesFilePath), e);
+ final String message = "Exception while reading configuration properties from file %s.";
+ logger.error(String.format(message, propertiesFilePath), e);
}
}
+ /**
+ * todo: add Javadocs.
+ *
+ * @return
+ */
public int getMaxClinicalDataEntry() {
return maxClinicalDataEntry;
}
+ /**
+ * todo: add Javadocs.
+ *
+ * @return
+ */
public String getForbiddenSymbolRegex() {
return forbiddenSymbolRegex;
}
+ /**
+ * todo: add Javadocs.
+ *
+ * @return
+ */
public boolean getAvoidTransmartSymbolBugs() {
return avoidTransmartSymbolBugs;
}
-
}
Oops, something went wrong.

0 comments on commit e745d6b

Please sign in to comment.