diff --git a/Kieker.WebGUI/.classpath b/Kieker.WebGUI/.classpath index da5037b3eb890697660be5b7095ea8aa1ad0bdcb..595a5bf4f25946f35d122d0c250b79c689cc4693 100644 --- a/Kieker.WebGUI/.classpath +++ b/Kieker.WebGUI/.classpath @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" output="target/classes" path="src/main/java"/> - <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/> <classpathentry kind="output" path="target/classes"/> diff --git a/Kieker.WebGUI/.settings/org.eclipse.core.resources.prefs b/Kieker.WebGUI/.settings/org.eclipse.core.resources.prefs index 4b31b758548c5d3821d7f8c014e290e0d15a2604..f8e2785f2a2ac234a93facdf66a8d970bdf372ff 100644 --- a/Kieker.WebGUI/.settings/org.eclipse.core.resources.prefs +++ b/Kieker.WebGUI/.settings/org.eclipse.core.resources.prefs @@ -1,5 +1,4 @@ -#Sat Jan 21 18:45:36 CET 2012 +#Fri Feb 03 16:06:50 CET 2012 eclipse.preferences.version=1 encoding//src/main/java=UTF-8 -encoding//src/main/resources=UTF-8 encoding/<project>=UTF-8 diff --git a/Kieker.WebGUI/doc/Overview.pdf b/Kieker.WebGUI/doc/Overview.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5cab2c5f6c432327b9ab3a4f69454ebea80cb795 Binary files /dev/null and b/Kieker.WebGUI/doc/Overview.pdf differ diff --git a/Kieker.WebGUI/pom.xml b/Kieker.WebGUI/pom.xml index c7654be5dfba94e7a3170d4ecc9002583bd57104..64d5907992a6e39d894c1e3c9a3dd51d536b48e4 100644 --- a/Kieker.WebGUI/pom.xml +++ b/Kieker.WebGUI/pom.xml @@ -1,283 +1,324 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <groupId>kieker</groupId> - <artifactId>Kieker.WebGUI</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>war</packaging> + <groupId>kieker</groupId> + <artifactId>Kieker.WebGUI</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>war</packaging> - <name>Kieker.WebGUI</name> + <name>Kieker.WebGUI</name> - <properties> - <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> + <properties> + <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> - <dependencies> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-maven-plugin</artifactId> - <version>8.1.0.RC1</version> - </dependency> - <dependency> - <groupId>com.ocpsoft</groupId> - <artifactId>prettyfaces-jsf2</artifactId> - <version>3.3.2</version> - </dependency> - <dependency> - <groupId>com.sun.faces</groupId> - <artifactId>jsf-api</artifactId> - <version>2.1.6</version> - </dependency> - <dependency> - <groupId>com.sun.faces</groupId> - <artifactId>jsf-impl</artifactId> - <version>2.1.6</version> - </dependency> - <dependency> - <groupId>org.eclipse.emf</groupId> - <artifactId>org.eclipse.emf.common</artifactId> - <version>2.6.0.v20100614-1136</version> - </dependency> - <dependency> - <groupId>org.eclipse.emf</groupId> - <artifactId>ecore-xmi</artifactId> - <version>2.2.3</version> - </dependency> - <dependency> - <groupId>org.eclipse.emf</groupId> - <artifactId>org.eclipse.emf.ecore</artifactId> - <version>2.6.0.v20100614-1136</version> - </dependency> - <dependency> - <groupId>javax</groupId> - <artifactId>javaee-web-api</artifactId> - <version>6.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.primefaces</groupId> - <artifactId>primefaces</artifactId> - <version>3.0.RC1</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>black-tie</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>blitzer</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>bluesky</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>casablanca</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>cupertino</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>dark-hive</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>dot-luv</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>eggplant</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>excite-bike</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>flick</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>hot-sneaks</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>humanity</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>le-frog</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>midnight</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>mint-choc</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>overcast</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>pepper-grinder</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>redmond</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>rocket</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>sam</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>smoothness</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>south-street</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>start</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>sunny</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>swanky-purse</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>trontastic</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>ui-darkness</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>ui-lightness</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>vader</artifactId> - <version>1.0.2</version> - </dependency> - <dependency> - <groupId>org.primefaces.themes</groupId> - <artifactId>glass-x</artifactId> - <version>1.0.2</version> - </dependency> + <dependencies> + <dependency> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>8.1.0.RC1</version> + </dependency> + <dependency> + <groupId>com.ocpsoft</groupId> + <artifactId>prettyfaces-jsf2</artifactId> + <version>3.3.2</version> + </dependency> + <dependency> + <groupId>com.sun.faces</groupId> + <artifactId>jsf-api</artifactId> + <version>2.1.6</version> + </dependency> + <dependency> + <groupId>com.sun.faces</groupId> + <artifactId>jsf-impl</artifactId> + <version>2.1.6</version> + </dependency> + <dependency> + <groupId>org.eclipse.emf</groupId> + <artifactId>org.eclipse.emf.common</artifactId> + <version>2.6.0.v20100614-1136</version> + </dependency> + <dependency> + <groupId>org.eclipse.emf</groupId> + <artifactId>ecore-xmi</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>org.eclipse.emf</groupId> + <artifactId>org.eclipse.emf.ecore</artifactId> + <version>2.6.0.v20100614-1136</version> + </dependency> + <dependency> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.8</version> + </dependency> + <dependency> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>2.4.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <version>2.6</version> + </dependency> + <dependency> + <groupId>javax</groupId> + <artifactId>javaee-web-api</artifactId> + <version>6.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.primefaces</groupId> + <artifactId>primefaces</artifactId> + <version>3.0.RC1</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>black-tie</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>blitzer</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>bluesky</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>casablanca</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>cupertino</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>dark-hive</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>dot-luv</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>eggplant</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>excite-bike</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>flick</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>hot-sneaks</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>humanity</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>le-frog</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>midnight</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>mint-choc</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>overcast</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>pepper-grinder</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>redmond</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>rocket</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>sam</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>smoothness</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>south-street</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>start</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>sunny</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>swanky-purse</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>trontastic</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>ui-darkness</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>ui-lightness</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>vader</artifactId> + <version>1.0.2</version> + </dependency> + <dependency> + <groupId>org.primefaces.themes</groupId> + <artifactId>glass-x</artifactId> + <version>1.0.2</version> + </dependency> - <dependency> - <groupId>kieker</groupId> - <artifactId>kieker</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>system</scope> - <systemPath>${project.basedir}/lib/kieker-1.5-SNAPSHOT.jar</systemPath> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.3.2</version> - </dependency> - <dependency> - <groupId>commons-fileupload</groupId> - <artifactId>commons-fileupload</artifactId> - <version>1.2.1</version> - </dependency> - </dependencies> + <dependency> + <groupId>kieker</groupId> + <artifactId>kieker</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>system</scope> + <systemPath>${project.basedir}/lib/kieker-1.5-SNAPSHOT.jar</systemPath> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3.2</version> + </dependency> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.2.1</version> + </dependency> + </dependencies> - <repositories> - <repository> - <id>prime-repo</id> - <name>PrimeFaces Maven Repository</name> - <url>http://repository.primefaces.org</url> - <layout>default</layout> - </repository> - </repositories> + <repositories> + <repository> + <id>prime-repo</id> + <name>PrimeFaces Maven Repository</name> + <url>http://repository.primefaces.org</url> + <layout>default</layout> + </repository> + </repositories> - <build> - <plugins> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-maven-plugin</artifactId> - <version>8.1.0.RC1</version> - <configuration> - <scanIntervalSeconds>5</scanIntervalSeconds> - <connectors> - <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> - <port>8080</port> - <maxIdleTime>600000</maxIdleTime> <!-- 10 minutes in milliseconds! --> - <lowResourcesMaxIdleTime>600000</lowResourcesMaxIdleTime> - </connector> - </connectors> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.6</source> - <target>1.6</target> - <compilerArguments> - <endorseddirs>${endorsed.dir}</endorseddirs> - </compilerArguments> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <version>2.1.1</version> - <configuration> - <failOnMissingWebXml>false</failOnMissingWebXml> - </configuration> - </plugin> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.8</version> + <configuration> + <configLocation>quality-config/cs-conf.xml</configLocation> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>2.4.0</version> + <configuration> + <effort>Max</effort> + <threshold>Low</threshold> + <includeFilterFile>quality-config/fb-filter.xml</includeFilterFile> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <version>2.6</version> + <configuration> + <rulesets>quality-config/pmdrules.xml</rulesets> + </configuration> + </plugin> + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>8.1.0.RC1</version> + <configuration> + <scanIntervalSeconds>5</scanIntervalSeconds> + <connectors> + <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> + <port>8080</port> + <maxIdleTime>600000</maxIdleTime> <!-- 10 minutes in milliseconds! --> + <lowResourcesMaxIdleTime>600000</lowResourcesMaxIdleTime> + </connector> + </connectors> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + <compilerArguments> + <endorseddirs>${endorsed.dir}</endorseddirs> + </compilerArguments> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>2.1.1</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> <!--<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.1</version> <executions> <execution> <phase>validate</phase> <goals> <goal>copy</goal> </goals> <configuration> <outputDirectory>${endorsed.dir}</outputDirectory> @@ -285,7 +326,8 @@ <artifactId>javaee-endorsed-api</artifactId> <version>6.0</version> <type>jar</type> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> --> - </plugins> - </build> + </plugins> + </build> + </project> diff --git a/Kieker.WebGUI/quality-config/cs-conf.xml b/Kieker.WebGUI/quality-config/cs-conf.xml new file mode 100644 index 0000000000000000000000000000000000000000..e0c075acaaea8a97b96aa56b607c6f35affa4211 --- /dev/null +++ b/Kieker.WebGUI/quality-config/cs-conf.xml @@ -0,0 +1,1190 @@ +<?xml version="1.0"?> +<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> + +<module name="Checker"> + + <!-- KIEKER default is warning instead of error --> + <property name="severity" value="warning"/> + + <!-- KIEKER Filter --> + <module name="SuppressWithNearbyCommentFilter"> + <property name="commentFormat" value="NOCS"/> + <property name="checkFormat" value=".*"/> + <property name="influenceFormat" value="0"/> + </module> + + <!-- + <property name="basedir" value=""/> + <property name="localeCountry" value=""/> JVM locale country + <property name="localeLanguage" value=""/> JVM locale language + <property name="charset" value=""/> JVM file.encoding property + !--> + + + <!-- + !________________________________________________________________________________________ + ! + ! D U P L I C A T E S + !________________________________________________________________________________________ + !--> + <!-- Performs a line-by-line comparison of all code lines and reports duplicate code. !--> + <!-- See http://checkstyle.sf.net/config_duplicates.html !--> + <!-- KIEKER Does not work with headers!! + <module name="StrictDuplicateCode"> + <property name="min" value="12"/> + <property name="fileExtensions" value=""/> + </module> + --> + + <!-- + !________________________________________________________________________________________ + ! + ! H E A D E R S + !________________________________________________________________________________________ + !--> + <!-- NOTE: You may enable zero or one of these header checks, but not both. !--> + + <!-- Checks that a source file begins with a specified header. !--> + <!-- See http://checkstyle.sf.net/config_header.html !--> + <!-- KIEKER !--> + <module name="Header"> + <!--<property name="headerFile" value="lib/checkstyle-5.4/header.txt"/>--> + <!--<property name="charset" value=""/>--> + <property name="header" value="/***************************************************************************\n * Copyright 2011 by\n * + Christian-Albrechts-University of Kiel\n * + Department of Computer Science\n * + Software Engineering Group \n * and others.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n ***************************************************************************/\n"/> + <property name="ignoreLines" value="2"/> + <property name="fileExtensions" value="java"/> + </module> + + <!-- Checks the header of a source file against a header file that contains a regular expression !--> + <!-- for each line of the source header. !--> + <!-- See http://checkstyle.sf.net/config_header.html !--> + <!-- Default: OFF + <module name="RegexpHeader"> + <property name="headerFile" value=""/> + <property name="charset" value=""/> + <property name="header" value=""/> + <property name="multiLines" value=""/> + <property name="fileExtensions" value=""/> + </module> + !--> + + <!-- + !________________________________________________________________________________________ + ! + ! J A V A D O C S + !________________________________________________________________________________________ + !--> + <!-- Checks that each Java package has a Javadoc file used for commenting. !--> + <!-- See http://checkstyle.sourceforge.net/config_javadoc.html#JavadocPackage !--> + <module name="JavadocPackage"> + <property name="severity" value="info"/> + <property name="allowLegacy" value="false"/> + </module> + + <!-- + !________________________________________________________________________________________ + ! + ! R E G E X P + !________________________________________________________________________________________ + !--> + <!-- A check for detecting that matches across multiple lines. Works with any file type. !--> + <!-- See http://checkstyle.sourceforge.net/config_regexp.html#RegexpMultiline !--> + <!-- Default: OFF + <module name="RegexpMultiline"> + <property name="format" value=""/> + <property name="message" value=""/> + <property name="ignoreCase" value="false"/> + <property name="minimum" value="0"/> + <property name="maximum" value="0"/> + <property name="fileExtensions" value=""/> + </module> + !--> + + <!-- A check for detecting single lines that match a supplied regular expression. Works with any file type. !--> + <!-- See http://checkstyle.sourceforge.net/config_regexp.html#RegexpSingleline !--> + <!-- Default: OFF + <module name="RegexpSingleline"> + <property name="format" value=""/> + <property name="message" value=""/> + <property name="ignoreCase" value="false"/> + <property name="minimum" value="0"/> + <property name="maximum" value="0"/> + <property name="fileExtensions" value=""/> + </module> + !--> + + <!-- + !________________________________________________________________________________________ + ! + ! M I S C E L L A N E O U S + !________________________________________________________________________________________ + !--> + <!-- Checks whether files end with a new line. !--> + <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile !--> + <module name="NewlineAtEndOfFile"> + <property name="lineSeparator" value="system"/> + <property name="fileExtensions" value="*.*"/> + </module> + + <!-- Checks that property files contain the same keys. !--> + <!-- See http://checkstyle.sf.net/config_misc.html#Translation !--> + <module name="Translation"> + <property name="fileExtensions" value="properties"/> + </module> + + + <!-- + !________________________________________________________________________________________ + ! + ! S I Z E V I O L A T I O N S + !________________________________________________________________________________________ + !--> + <!-- Checks for long source files. !--> + <!-- See http://checkstyle.sf.net/config_sizes.html !--> + <module name="FileLength"> + <property name="max" value="2000"/> + <property name="fileExtensions" value=""/> + </module> + + + <!-- + !________________________________________________________________________________________ + ! + ! W H I T E S P A C E + !________________________________________________________________________________________ + !--> + <!-- Checks that there are no tab characters ('\t') in the source code. !--> + <!-- See http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter !--> + <!-- KIEKER we use TABs + <module name="FileTabCharacter"> + <property name="eachLine" value="false"/> + <property name="fileExtensions" value=""/> + </module> + --> + + <module name="TreeWalker"> + <!-- KIEKER --> + <property name="tabWidth" value="4"/> + <module name="FileContentsHolder"/> + + <!-- + !________________________________________________________________________________________ + ! + ! A N N O T A T I O N S + !________________________________________________________________________________________ + !--> + <!-- This check controls the usage style of annotations. !--> + <!-- See http://checkstyle.sourceforge.net/config_annotation.html#AnnotationUseStyle !--> + <module name ="AnnotationUseStyle"> + <property name="elementStyle" value="compact_no_array"/> + <property name="closingParens" value="never"/> + <property name="trailingArrayComma" value="never"/> + </module> + + <!-- Verifies that both the java.lang.Deprecated import is present and the @deprecated Javadoc tag is present when either is present. !--> + <!-- See http://checkstyle.sourceforge.net/config_annotation.html#MissingDeprecated !--> + <!-- KIEKER --> + <module name="MissingDeprecated"> + <property name="severity" value="info"/> + </module> + + <!-- Verifies that the java.lang.Override annotation is present when the {@inheritDoc} javadoc tag is present. !--> + <!-- See http://checkstyle.sourceforge.net/config_annotation.html#MissingOverride !--> + <module name="MissingOverride"> + <property name="javaFiveCompatibility" value="false"/> + </module> + + <!-- This check makes sure that all package annotations are in the package-info.java file. !--> + <!-- See http://checkstyle.sourceforge.net/config_annotation.html#PackageAnnotation !--> + <module name="PackageAnnotation"/> + + <!-- This check allows you to specify what warnings that SuppressWarnings is not allowed to suppress. !--> + <!-- You can also specify a list of TokenTypes that the configured warning(s) cannot be suppressed on. !--> + <!-- See http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarnings !--> + <module name="SuppressWarnings"> + <property name="format" value="^$|^\s+$"/> + <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, + ANNOTATION_FIELD_DEF, ENUM_CONSTANT_DEF, PARAMETER_DEF, + VARIABLE_DEF, METHOD_DEF, CTOR_DEF"/> + </module> + + + <!-- + !________________________________________________________________________________________ + ! + ! B L O C K S + !________________________________________________________________________________________ + !--> + <!-- Finds nested blocks, i.e. blocks that are used freely in the code. !--> + <!-- See http://checkstyle.sf.net/config_blocks.html !--> + <!-- KIEKER allowInSwitchCase !--> + <module name="AvoidNestedBlocks"> + <property name="allowInSwitchCase" value="true"/> + </module> + + <!-- Checks for empty blocks. !--> + <!-- See http://checkstyle.sf.net/config_blocks.html !--> + <!-- KIEKER removed LITERAL_CATCH !--> + <module name="EmptyBlock"> + <property name="option" value="stmt"/> + <property name="tokens" value="LITERAL_DO, + LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF, LITERAL_FOR, + LITERAL_TRY, LITERAL_WHILE, INSTANCE_INIT, STATIC_INIT"/> + </module> + + <!-- Checks for the placement of left curly braces ('{') for code blocks. !--> + <!-- See http://checkstyle.sf.net/config_blocks.html !--> + <module name="LeftCurly"> + <property name="option" value="eol"/> + <property name="maxLineLength" value="165"/> + <property name="tokens" value="CLASS_DEF, CTOR_DEF, + INTERFACE_DEF, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, + LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, + LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, + METHOD_DEF"/> + </module> + + <!-- Checks for braces around code blocks. !--> + <!-- See http://checkstyle.sf.net/config_blocks.html !--> + <module name="NeedBraces"> + <property name="tokens" value="LITERAL_DO, LITERAL_ELSE, LITERAL_IF, LITERAL_FOR, LITERAL_WHILE"/> + </module> + + <!-- Checks the placement of right curly braces ('}') for else, try, and catch tokens. !--> + <!-- See http://checkstyle.sf.net/config_blocks.html !--> + <module name="RightCurly"> + <property name="option" value="same"/> + <property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE"/> + <property name="shouldStartLine" value="true"/> + </module> + + + <!-- + !________________________________________________________________________________________ + ! + ! C L A S S D E S I G N + !________________________________________________________________________________________ + !--> + <!-- Checks that classes are designed for extension. !--> + <!-- See http://checkstyle.sf.net/config_design.html !--> + <!-- Default: OFF + <module name="DesignForExtension"/> + !--> + + <!-- Checks that a class which has only private constructors is declared as final. !--> + <!-- See http://checkstyle.sf.net/config_design.html !--> + <module name="FinalClass"/> + + <!-- Make sure that utility classes (classes that contain only static methods) do not have a public constructor. !--> + <!-- See http://checkstyle.sf.net/config_design.html !--> + <module name="HideUtilityClassConstructor"/> + + <!-- Check nested (internal) classes/interfaces are declared at the bottom of the class after all method and field declarations. !--> + <!-- See http://checkstyle.sourceforge.net/config_design.html#InnerTypeLast !--> + <module name="InnerTypeLast"/> + + <!-- Implements Bloch, Effective Java, Item 17 - Use Interfaces only to define types. !--> + <!-- See http://checkstyle.sf.net/config_design.html !--> + <module name="InterfaceIsType"> + <property name="allowMarkerInterfaces" value="true"/> + </module> + + <!-- Ensures that exceptions (defined as any class name conforming to some regular expression) are immutable. !--> + <!-- That is, have only final fields. !--> + <!-- See http://checkstyle.sf.net/config_design.html !--> + <module name="MutableException"> + <property name="format" value="^.*Exception$|^.*Error$"/> + </module> + + <!-- Restricts throws statements to a specified count. !--> + <!-- See http://checkstyle.sf.net/config_design.html !--> + <!-- KIEKER off + <module name="ThrowsCount"> + <property name="max" value="1"/> + </module> + !--> + + <!-- Checks visibility of class members. !--> + <!-- See http://checkstyle.sf.net/config_design.html !--> + <module name="VisibilityModifier"> + <property name="packageAllowed" value="false"/> + <property name="protectedAllowed" value="true"/> + <property name="publicMemberPattern" value="^serialVersionUID$"/> + </module> + + + <!-- + !________________________________________________________________________________________ + ! + ! C O D I N G + !________________________________________________________________________________________ + !--> + <!-- Checks that array initialization contains a trailing comma. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="ArrayTrailingComma"/> + + <!-- Detects inline conditionals. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="AvoidInlineConditionals"/> + + <!-- Checks that classes that define a covariant equals() method also override method equals(java.lang.Object). !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="CovariantEquals"/> + + <!-- Checks declaration order according to Code Conventions for the Java Programming Language. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="DeclarationOrder"> + <property name="ignoreConstructors" value="false"/> + <property name="ignoreMethods" value="false"/> + <property name="ignoreModifiers" value="false"/> + </module> + + <!-- Check that the default is after all the cases in a switch statement. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="DefaultComesLast"/> + + <!-- The "double-checked locking" idiom (DCL) tries to avoid the runtime cost of synchronization. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="DoubleCheckedLocking"/> + + <!-- Detects empty statements (standalone ;). !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="EmptyStatement"/> + + <!-- Checks that any combination of String literals with optional assignment is on the left side of an equals() comparison. !--> + <!-- See http://checkstyle.sourceforge.net/config_coding.html#EqualsAvoidNull !--> + <module name="EqualsAvoidNull"/> + + <!-- Checks that classes that override equals() also override hashCode(). !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="EqualsHashCode"/> + + <!-- Checks if any class or object member explicitly initialized to default for its type value. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <!-- KIEKER off + <module name="ExplicitInitialization"/> + !--> + + <!-- Checks for fall through in switch statements Finds locations where a case contains Java code ... !--> + <!-- but lacks a break, return, throw or continue statement. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="FallThrough"> + <property name="checkLastCaseGroup" value="false"/> + <property name="reliefPattern" value="fallthru|falls??through"/> + </module> + + <!-- Checks that local variables that never have their values changed are declared final. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="FinalLocalVariable"> + <property name="tokens" value="VARIABLE_DEF"/> + </module> + + <!-- Checks that a local variable or a parameter does not shadow a field that is defined in the same class. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <!-- KIEKER ignoreConstructorParameter, ignoreSetter --> + <module name="HiddenField"> + <property name="tokens" value="PARAMETER_DEF, VARIABLE_DEF"/> + <!-- + <property name="ignoreFormat" value=""/> + !--> + <property name="ignoreConstructorParameter" value="true"/> + <property name="ignoreSetter" value="true"/> + <property name="ignoreAbstractMethods" value="false"/> + </module> + + <!-- Catching java.lang.Exception, java.lang.Error or java.lang.RuntimeException is almost never acceptable. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="IllegalCatch"> + <property name="illegalClassNames" value="java.lang.Exception, java.lang.Throwable, java.lang.RuntimeException"/> + </module> + + <!-- Checks for illegal instantiations where a factory method is preferred. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <!-- KIEKER on for ??? !--> + <module name="IllegalInstantiation"> + <property name="classes" value="java.lang.Boolean"/> + </module> + + <!-- This check can be used to ensure that types are not declared to be thrown. !--> + <!-- Declaring to throw java.lang.Error or java.lang.RuntimeException is almost never acceptable. !--> + <!-- See http://checkstyle.sourceforge.net/config_coding.html#IllegalThrows !--> + <module name="IllegalThrows"> + <property name="illegalClassNames" value="java.lang.Throwable, java.lang.Error, java.lang.RuntimeException"/> + </module> + + <!-- Checks for illegal tokens. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <!-- KIEKER off + <module name="IllegalToken"> + <property name="tokens" value="LITERAL_SWITCH, POST_INC, POST_DEC"/> + </module> + !--> + + <!-- Checks for illegal token text. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <!-- Default: OFF + <module name="IllegalTokenText"> + <property name="tokens" value=""/> + <property name="format" value=""/> + <property name="ignoreCase" value="false"/> + <property name="message" value=""/> + </module> + !--> + + <!-- Checks that particular classes are never used as types in variable declarations, return values or parameters. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <!-- KIEKER removed format value="^(.*[\\.])?Abstract.*$" !--> + <module name="IllegalType"> + <property name="tokens" value="PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF"/> + <property name="illegalClassNames" value="java.util.GregorianCalendar, java.util.Hashtable, + java.util.HashSet, java.util.HashMap, java.util.ArrayList, + java.util.LinkedList, java.util.LinkedHashMap, + java.util.LinkedHashSet, java.util.TreeSet, + java.util.TreeMap, java.util.Vector"/> + <property name="legalAbstractClassNames" value=""/> + <property name="ignoredMethodNames" value="getInitialContext, getEnvironment"/> + <property name="format" value="XXX"/> + </module> + + <!-- Checks for assignments in subexpressions, such as in String s = Integer.toString(i = 2);. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="InnerAssignment"> + <property name="tokens" value="ASSIGN, BAND_ASSIGN, BOR_ASSIGN, BSR_ASSIGN, BXOR_ASSIGN, + DIV_ASSIGN, MINUS_ASSIGN, MOD_ASSIGN, PLUS_ASSIGN, SL_ASSIGN, + SR_ASSIGN, STAR_ASSIGN"/> + </module> + + <!-- Ensures that the setUp(), tearDown()methods are named correctly, have no arguments, !--> + <!-- return void and are either public or protected. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="JUnitTestCase"/> + + <!-- Checks that there are no "magic numbers", where a magic number is a numeric literal !--> + <!-- that is not defined as a constant. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="MagicNumber"> + <property name="tokens" value="NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG"/> + <property name="ignoreNumbers" value="-1, 0, 1, 2"/> + <property name="ignoreHashCodeMethod" value="false"/> + </module> + + <!-- Checks that classes (except abtract one) define a ctor and don't rely on the default one. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="MissingCtor"/> + + <!-- Checks that switch statement has "default" clause. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="MissingSwitchDefault"/> + + <!-- Check for ensuring that for loop control variables are not modified inside the for block. !--> + <!-- See http://checkstyle.sourceforge.net/config_coding.html#ModifiedControlVariable !--> + <module name="ModifiedControlVariable"/> + + <!-- Checks for multiple occurrences of the same string literal within a single file. !--> + <!-- See http://checkstyle.sourceforge.net/config_coding.html#MultipleStringLiterals !--> + <!-- KIEKER off for now + <module name="MultipleStringLiterals"> + <property name="allowedDuplicates" value="1"/> + <property name="ignoreStringsRegexp" value='^""$'/> + <property name="ignoreOccurrenceContext" value="ANNOTATION"/> + </module> + !--> + + <!-- Checks that each variable declaration is in its own statement and on its own line. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="MultipleVariableDeclarations"/> + + <!-- Restricts nested for blocks to a specified depth. !--> + <!-- See http://checkstyle.sourceforge.net/config_coding.html#NestedForDepth !--> + <module name="NestedForDepth"> + <property name="max" value="1"/> + </module> + + <!-- Restricts nested if-else blocks to a specified depth. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="NestedIfDepth"> + <property name="max" value="1"/> + </module> + + <!-- Restricts nested try-catch blocks to a specified depth. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="NestedTryDepth"> + <property name="max" value="1"/> + </module> + + <!-- Checks that the clone method is not overridden from the Object class. !--> + <!-- See http://checkstyle.sourceforge.net/config_coding.html#NoClone !--> + <module name="NoClone"/> + + <!-- Verifies there are no finalize() methods defined in a class. !--> + <!-- See http://checkstyle.sourceforge.net/config_coding.html#NoFinalizer !--> + <module name="NoFinalizer"/> + + <!-- Checks there is only one statement per line. !--> + <!-- See http://checkstyle.sourceforge.net/config_coding.html#OneStatementPerLine !--> + <module name="OneStatementPerLine"/> + + <!-- Ensure a class has a package declaration. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="PackageDeclaration"> + <property name="ignoreDirectoryName" value="false"/> + </module> + + <!-- Disallow assignment of parameters. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="ParameterAssignment"/> + + <!-- Checks for redundant exceptions declared in throws clause such as duplicates, !--> + <!-- unchecked exceptions or subclasses of another declared exception. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="RedundantThrows"> + <property name="allowUnchecked" value="true"/> + <property name="allowSubclasses" value="false"/> + <property name="logLoadErrors" value="true"/> + <property name="suppressLoadErrors" value="false"/> + </module> + + <!-- Checks that code doesn't rely on the "this." default. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="RequireThis"> + <property name="checkFields" value="true"/> + <property name="checkMethods" value="true"/> + </module> + + <!-- Restrict the number of return statements. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="ReturnCount"> + <property name="max" value="2"/> + <property name="format" value=""/> + </module> + + <!-- Checks for overly complicated boolean expressions. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="SimplifyBooleanExpression"/> + + <!-- Checks for overly complicated boolean return statements. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="SimplifyBooleanReturn"/> + + <!-- Checks that string literals are not used with == or !=. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="StringLiteralEquality"/> + + <!-- Checks that an overriding clone() method invokes super.clone(). !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="SuperClone"/> + + <!-- Checks that an overriding finalize() method invokes super.finalize(). !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="SuperFinalize"/> + + <!-- Checks for the use of unnecessary parentheses. !--> + <!-- See http://checkstyle.sf.net/config_coding.html !--> + <module name="UnnecessaryParentheses"/> + + + <!-- + !________________________________________________________________________________________ + ! + ! I M P O R T S + !________________________________________________________________________________________ + !--> + <!-- Checks that there are no import statements that use the * notation. !--> + <!-- See http://checkstyle.sf.net/config_import.html !--> + <module name="AvoidStarImport"> + <property name="excludes" value=""/> + <property name="allowClassImports" value="false"/> + <property name="allowStaticMemberImports" value="false"/> + </module> + + <!-- Checks that there are no static import statements. !--> + <!-- See http://checkstyle.sourceforge.net/config_imports.html#AvoidStaticImport !--> + <module name="AvoidStaticImport"> + <property name="excludes" value=""/> + </module> + + <!-- Checks for imports from a set of illegal packages. !--> + <!-- See http://checkstyle.sf.net/config_import.html !--> + <module name="IllegalImport"> + <property name="illegalPkgs" value="sun"/> + <property name="illegalPkgs" value="org.apache.commons.logging"/> + </module> + + <!-- Controls what can be imported in each package. Useful for ensuring that application layering rules !--> + <!-- are not violated, especially on large projects. !--> + <!-- See http://checkstyle.sourceforge.net/config_imports.html#ImportControl !--> + <!-- Default: OFF + <module name="ImportControl"> + <property name="file" value=""/> + <property name="url" value=""/> + </module> + !--> + + <!-- Checks the ordering/grouping of imports. !--> + <!-- See http://checkstyle.sf.net/config_import.html !--> + <module name="ImportOrder"> + <property name="option" value="under"/> + <property name="groups" value=""/> + <property name="ordered" value="true"/> + <property name="separated" value="false"/> + <property name="caseSensitive" value="true"/> + </module> + + <!-- Checks for redundant import statements. !--> + <!-- See http://checkstyle.sf.net/config_import.html !--> + <module name="RedundantImport"/> + + <!-- Checks for unused import statements. !--> + <!-- See http://checkstyle.sf.net/config_import.html !--> + <module name="UnusedImports"/> + + + <!-- + !________________________________________________________________________________________ + ! + ! J A V A D O C S + !________________________________________________________________________________________ + !--> + <!-- Checks to ensure that the javadoc tags exist (if required) !--> + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocMethod !--> + <module name="JavadocMethod"> + <property name="severity" value="info"/> + <property name="scope" value="private"/> + <!-- + <property name="excludeScope" value=""/> + !--> + <property name="allowUndeclaredRTE" value="false"/> + <property name="allowThrowsTagsForSubclasses" value="false"/> + <property name="allowMissingParamTags" value="false"/> + <property name="allowMissingThrowsTags" value="false"/> + <property name="allowMissingReturnTag" value="false"/> + <property name="allowMissingJavadoc" value="false"/> + <property name="allowMissingPropertyJavadoc" value="false"/> + <property name="logLoadErrors" value="true"/> + <property name="suppressLoadErrors" value="false"/> + <property name="tokens" value="METHOD_DEF, CTOR_DEF"/> + </module> + + <!-- Validates Javadoc comments to help ensure they are well formed. !--> + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocStyle !--> + <module name="JavadocStyle"> + <property name="severity" value="info"/> + <property name="scope" value="private"/> + <!-- + <property name="excludeScope" value=""/> + !--> + <property name="checkFirstSentence" value="true"/> +<!--TODO: <property name="endOfSentenceFormat" value="([.?!][ \t\n\r\f<])|([.?!]$)"/> !--> + <property name="checkEmptyJavadoc" value="false"/> + <property name="checkHtml" value="true"/> + <property name="tokens" value="INTERFACE_DEF, CLASS_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/> + </module> + + <!-- Checks Javadoc comments for class and interface definitions. !--> + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocType !--> + <module name="JavadocType"> + <property name="severity" value="info"/> + <property name="scope" value="private"/> + <!-- + <property name="excludeScope" value=""/> + !--> + <property name="authorFormat" value=""/> + <property name="versionFormat" value=""/> + <property name="allowMissingParamTags" value="false"/> + <property name="allowUnknownTags" value="false"/> + <property name="tokens" value="INTERFACE_DEF, CLASS_DEF"/> + </module> + + <module name="JavadocType"> + <property name="severity" value="warning"/> + <property name="scope" value="package"/> + <property name="authorFormat" value="\S"/> + </module> + + <!-- Checks that variables have Javadoc comments. !--> + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocVariable !--> + <module name="JavadocVariable"> + <property name="severity" value="info"/> + <property name="scope" value="private"/> + <!-- + <property name="excludeScope" value=""/> + !--> + </module> + + <!-- Outputs a JavaDoc tag as information. !--> + <!-- See http://checkstyle.sourceforge.net/config_javadoc.html#WriteTag !--> + <!-- KIEKER + <module name="WriteTag"> + <property name="severity" value="info"/> + <property name="tag" value=""/> + <property name="tagFormat" value=""/> + <property name="tagSeverity" value="info"/> + </module> + --> + + + <!-- + !________________________________________________________________________________________ + ! + ! M E T R I C S + !________________________________________________________________________________________ + !--> + <!-- Restrict the number of number of &&, || and ^ in an expression. !--> + <!-- See http://checkstyle.sf.net/config_metrics.html !--> + <module name="BooleanExpressionComplexity"> + <property name="severity" value="info"/> + <property name="max" value="3"/> + <property name="tokens" value="LAND, BAND, LOR, BOR, BXOR"/> + </module> + + <!-- This metric measures the number of instantiations of other classes within the given class. !--> + <!-- See http://checkstyle.sf.net/config_metrics.html !--> + <module name="ClassDataAbstractionCoupling"> + <property name="severity" value="info"/> + <property name="max" value="7"/> + </module> + + <!-- The number of other classes a given class relies on. !--> + <!-- See http://checkstyle.sf.net/config_metrics.html !--> + <module name="ClassFanOutComplexity"> + <property name="severity" value="info"/> + <property name="max" value="20"/> + </module> + + <!-- Checks cyclomatic complexity against a specified limit. !--> + <!-- See http://checkstyle.sf.net/config_metrics.html !--> + <module name="CyclomaticComplexity"> + <property name="severity" value="info"/> + <property name="max" value="10"/> + </module> + + <!-- Determines complexity of methods, classes and files by counting the Non Commenting Source Statements (NCSS). !--> + <!-- See http://checkstyle.sourceforge.net/config_metrics.html#JavaNCSS !--> + <module name="JavaNCSS"> + <property name="severity" value="info"/> + <property name="methodMaximum" value="50"/> + <property name="classMaximum" value="1500"/> + <property name="fileMaximum" value="2000"/> + </module> + + <!-- The NPATH metric computes the number of possible execution paths through a function. !--> + <!-- See http://checkstyle.sf.net/config_metrics.html !--> + <module name="NPathComplexity"> + <property name="severity" value="info"/> + <property name="max" value="200"/> + </module> + + + <!-- + !________________________________________________________________________________________ + ! + ! M I S C E L L A N E O U S + !________________________________________________________________________________________ + !--> + <!-- Checks the style of array type definitions. !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <module name="ArrayTypeStyle"> + <property name="javaStyle" value="true"/> + </module> + + <!-- Checks for restricted tokens beneath other tokens. !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <!-- Default: OFF + <module name="DescendantToken"> + <property name="tokens" value=""/> + <property name="limitedTokens" value=""/> + <property name="minimumDepth" value="0"/> + <property name="maximumDepth" value="java.lang.Integer.MAX_VALUE"/> + <property name="minimumNumber" value="0"/> + <property name="maximumNumber" value="java.lang.Integer.MAX_VALUE"/> + <property name="sumTokenCounts" value="false"/> + <property name="minimumMessage" value="descendant.token.min"/> + <property name="maximumMessage" value="descendant.token.max"/> + </module> + !--> + + <!-- Check that method/constructor parameters are final. !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <module name="FinalParameters"> + <property name="tokens" value="METHOD_DEF, CTOR_DEF"/> + </module> + + <!-- A generic check for code problems - the user can search for any pattern. !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <!-- Default: OFF + <module name="GenericIllegalRegexp"> + <property name="format" value="\S\s+$"/> + <property name="message" value="Line has trailing spaces."/> + <property name="ignoreCase" value="false"/> + <property name="ignoreComments" value="false"/> + </module> + !--> + + <!-- Checks correct indentation of Java Code. !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <!-- KIEKER --> + <module name="Indentation"> + <property name="severity" value="info"/> + <property name="basicOffset" value="4"/> + <property name="braceAdjustment" value="0"/> + <property name="caseIndent" value="0"/> + </module> + + <!-- Checks that the outer type name and the file name match. !--> + <!-- See http://checkstyle.sourceforge.net/config_misc.html#OuterTypeFilename !--> + <module name="OuterTypeFilename"/> + + <!-- A check for TODO: comments. Actually it is a generic regular expression matcher on Java comments. !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <!-- Kieker !--> + <module name="TodoComment"> + <property name="format" value="TODO"/> + </module> + + <!-- The check to ensure that requires that comments be the only thing on a line. !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <!-- KIEKER we use them + <module name="TrailingComment"> + <property name="format" value="^[\\s\\}\\);]*$"/> + <property name="legalComment" value=""/> + </module> + --> + + <!-- Checks for uncommented main() methods (debugging leftovers). !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <module name="UncommentedMain"> + <property name="severity" value="info"/> + <property name="excludedClasses" value="Main$"/> + </module> + + <!-- Checks that long constants are defined with an upper ell. That is 'L' and not 'l'. !--> + <!-- See http://checkstyle.sf.net/config_misc.html !--> + <module name="UpperEll"/> + + + <!-- + !________________________________________________________________________________________ + ! + ! M O D I F I E R S + !________________________________________________________________________________________ + !--> + <!-- Checks that the order of modifiers conforms to the suggestions in the Java Language specification, !--> + <!-- sections 8.1.1, 8.3.1 and 8.4.3. !--> + <!-- See http://checkstyle.sf.net/config_modifiers.html !--> + <module name="ModifierOrder"/> + + <!-- Checks that there are no redundant modifiers. !--> + <!-- See http://checkstyle.sf.net/config_modifiers.html !--> + <!-- KIEKER off + <module name="RedundantModifier"> + <property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF"/> + </module> + !--> + + <!-- + !________________________________________________________________________________________ + ! + ! N A M I N G C O N V E N T I O N S + !________________________________________________________________________________________ + !--> + <!-- Checks for abstract class name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <!-- KIEKER removed |^.*Factory$ --> + <module name="AbstractClassName"> + <property name="format" value="^Abstract.*$"/> + <property name="ignoreModifier" value="false"/> + <property name="ignoreName" value="false"/> + </module> + + <!-- Checks for class type parameter name naming conventions. !--> + <!-- See http://checkstyle.sourceforge.net/config_naming.html#ClassTypeParameterName !--> + <module name="ClassTypeParameterName"> + <property name="format" value="^[A-Z]$"/> + </module> + + <!-- Checks for constant name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <module name="ConstantName"> + <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/> + <property name="applyToPublic" value="true"/> + <property name="applyToProtected" value="true"/> + <property name="applyToPackage" value="true"/> + <property name="applyToPrivate" value="true"/> + </module> + + <!-- Checks for local final variable name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <module name="LocalFinalVariableName"> + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> + <property name="tokens" value="VARIABLE_DEF, PARAMETER_DEF"/> + </module> + + <!-- Checks for local variable name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <module name="LocalVariableName"> + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> + <property name="tokens" value="PARAMETER_DEF"/> + </module> + + <!-- Checks for member variable name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <module name="MemberName"> + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> + <property name="applyToPublic" value="true"/> + <property name="applyToProtected" value="true"/> + <property name="applyToPackage" value="true"/> + <property name="applyToPrivate" value="true"/> + </module> + + <!-- Checks for method name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <module name="MethodName"> + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> + </module> + + <!-- Checks for method type parameter name naming conventions. !--> + <!-- See http://checkstyle.sourceforge.net/config_naming.html#MethodTypeParameterName !--> + <module name="MethodTypeParameterName"> + <property name="format" value="^[A-Z]$"/> + </module> + + <!-- Checks for package name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <module name="PackageName"> + <property name="format" value="^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$"/> + </module> + + <!-- Checks for parameter name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <module name="ParameterName"> + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> + </module> + + <!-- Checks for static variable name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <module name="StaticVariableName"> + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> + <property name="applyToPublic" value="true"/> + <property name="applyToProtected" value="true"/> + <property name="applyToPackage" value="true"/> + <property name="applyToPrivate" value="true"/> + </module> + + <!-- Checks for type name naming conventions. !--> + <!-- See http://checkstyle.sf.net/config_naming.html !--> + <!-- KIEKER: modded --> + <module name="TypeName"> + <property name="format" value="^[A-Z][a-zA-Z0-9]*$"/> + <property name="tokens" value="CLASS_DEF"/> + <property name="applyToPublic" value="true"/> + <property name="applyToProtected" value="true"/> + <property name="applyToPackage" value="true"/> + <property name="applyToPrivate" value="true"/> + </module> + + <module name="TypeName"> + <property name="format" value="^I[A-Z][a-zA-Z0-9]*$"/> + <property name="tokens" value="INTERFACE_DEF"/> + <property name="applyToPublic" value="true"/> + <property name="applyToProtected" value="true"/> + <property name="applyToPackage" value="true"/> + <property name="applyToPrivate" value="true"/> + </module> + + + <!-- + !________________________________________________________________________________________ + ! + ! R E G E X P + !________________________________________________________________________________________ + !--> + <!-- A check that makes sure that a specified pattern exists, exists less than a set number of times, !--> + <!-- or does not exist in the file. !--> + <!-- See http://checkstyle.sourceforge.net/config_misc.html#Regexp !--> + <!-- Default: OFF + <module name="Regexp"> + <property name="format" value=""/> + <property name="message" value=""/> + <property name="illegalPattern" value="false"/> + <property name="duplicateLimit" value="-1"/> + <property name="errorLimit" value="100"/> + <property name="ignoreComments" value="false"/> + </module> + !--> + + <!-- This class is variation on RegexpSingleline for detecting single lines that match a !--> + <!-- supplied regular expression in Java files. It supports suppressing matches in Java comments. !--> + <!-- See http://checkstyle.sourceforge.net/config_regexp.html#RegexpSinglelineJava !--> + <!-- Default: OFF + <module name="RegexpSinglelineJava"> + <property name="format" value=""/> + <property name="message" value=""/> + <property name="ignoreCase" value="false"/> + <property name="minimum" value="0"/> + <property name="maximum" value="0"/> + <property name="ignoreComments" value="false"/> + </module> + !--> + + <!-- + !________________________________________________________________________________________ + ! + ! S I Z E V I O L A T I O N S + !________________________________________________________________________________________ + !--> + <!-- Checks for long anonymous inner classes. !--> + <!-- See http://checkstyle.sf.net/config_sizes.html !--> + <module name="AnonInnerLength"> + <property name="severity" value="info"/> + <property name="max" value="20"/> + </module> + + <!-- Restricts the number of executable statements to a specified limit. !--> + <!-- See http://checkstyle.sf.net/config_sizes.html !--> + <!-- KIEKER off + <module name="ExecutableStatementCount"> + <property name="severity" value="info"/> + <property name="max" value="30"/> + <property name="tokens" value="CTOR_DEF, METHOD_DEF, INSTANCE_INIT, STATIC_INIT"/> + </module> + !--> + + <!-- See http://checkstyle.sf.net/config_sizes.html !--> + <!-- Checks for long lines. !--> + <module name="LineLength"> + <property name="severity" value="info"/> + <property name="ignorePattern" value="^$"/> + <property name="max" value="165"/> + </module> + + <!-- Checks the number of methods declared in each type. This includes the number of each scope !--> + <!-- (private, package, protected and public) as well as an overall total. !--> + <!-- See http://checkstyle.sourceforge.net/config_sizes.html#MethodCount !--> + <module name="MethodCount"> + <property name="severity" value="info"/> + <property name="maxTotal" value="100"/> + <property name="maxPrivate" value="100"/> + <property name="maxPackage" value="100"/> + <property name="maxProtected" value="100"/> + <property name="maxPublic" value="100"/> + </module> + + <!-- Checks for long methods and constructors. !--> + <!-- See http://checkstyle.sf.net/config_sizes.html !--> + <module name="MethodLength"> + <property name="severity" value="info"/> + <property name="max" value="150"/> + <property name="countEmpty" value="true"/> + <property name="tokens" value="METHOD_DEF, CTOR_DEF"/> + </module> + + <!-- Checks for the number of types declared at the outer (or root) level in a file. !--> + <!-- See http://checkstyle.sourceforge.net/config_sizes.html#OuterTypeNumber !--> + <!-- KIEKER 2 !--> + <module name="OuterTypeNumber"> + <property name="max" value="2"/> + </module> + + <!-- Checks the number of parameters of a method or constructor. !--> + <!-- See http://checkstyle.sf.net/config_sizes.html !--> + <!-- KIEKER off + <module name="ParameterNumber"> + <property name="severity" value="info"/> + <property name="max" value="7"/> + <property name="tokens" value="METHOD_DEF, CTOR_DEF"/> + </module> + !--> + + <!-- + !________________________________________________________________________________________ + ! + ! W H I T E S P A C E + !________________________________________________________________________________________ + !--> + <!-- Checks the padding of an empty for initializer. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="EmptyForInitializerPad"> + <property name="option" value="nospace"/> + </module> + + <!-- Checks the padding of an empty for iterator. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="EmptyForIteratorPad"> + <property name="option" value="nospace"/> + </module> + + <!-- Checks that the whitespace around the Generic tokens < and > is correct to the typical convention. !--> + <!-- See http://checkstyle.sourceforge.net/config_whitespace.html#GenericWhitespace !--> + <module name="GenericWhitespace"/> + + <!-- Checks the padding between the identifier of a method definition, !--> + <!-- constructor definition, method call, or constructor invocation; and the left parenthesis of the parameter list. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="MethodParamPad"> + <property name="allowLineBreaks" value="false"/> + <property name="option" value="nospace"/> + <property name="tokens" value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, SUPER_CTOR_CALL "/> + </module> + + <!-- Checks that there is no whitespace after a token. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <!-- KIEKER removed ARRAY_INIT !--> + <module name="NoWhitespaceAfter"> + <property name="allowLineBreaks" value="true"/> + <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/> + </module> + + <!-- Checks that there is no whitespace before a token. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="NoWhitespaceBefore"> + <property name="allowLineBreaks" value="false"/> + <property name="tokens" value="SEMI, POST_DEC, POST_INC"/> + </module> + + <!-- Checks the policy on how to wrap lines on operators. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="OperatorWrap"> + <property name="option" value="nl"/> + <property name="tokens" value="ASSIGN, BAND, BOR, BSR, BXOR, COLON, DIV, + EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, + LOR, LT, MINUS, MOD, NOT_EQUAL, + PLUS, QUESTION, SL, SR, STAR"/> + </module> + + <!-- Checks the policy on the padding of parentheses. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="ParenPad"> + <property name="option" value="nospace"/> + <property name="tokens" value="CTOR_CALL, LPAREN, METHOD_CALL, RPAREN, SUPER_CTOR_CALL"/> + </module> + + <!-- Checks the policy on the padding of parentheses for typecasts. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="TypecastParenPad"> + <property name="option" value="nospace"/> + <property name="tokens" value="TYPECAST, RPAREN"/> + </module> + + <!-- Checks that a token is followed by whitespace. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="WhitespaceAfter"> + <property name="tokens" value="COMMA, SEMI, TYPECAST"/> + </module> + + <!-- Checks that a token is surrounded by whitespace. !--> + <!-- See http://checkstyle.sf.net/config_whitespace.html !--> + <module name="WhitespaceAround"> + <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, + BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, + LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, + LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, + LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, + MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, + QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN"/> + <property name="allowEmptyConstructors" value="true"/> + <property name="allowEmptyMethods" value="true"/> + </module> + + </module> + +</module> diff --git a/Kieker.WebGUI/quality-config/fb-filter.xml b/Kieker.WebGUI/quality-config/fb-filter.xml new file mode 100644 index 0000000000000000000000000000000000000000..d1e9e128665f894a10f974f61cec43080500654a --- /dev/null +++ b/Kieker.WebGUI/quality-config/fb-filter.xml @@ -0,0 +1,73 @@ +<FindBugsFilter> +<!-- Example: http://findbugs.sourceforge.net/manual/filter.html#d0e2103 --> + + <Match> + <Class name="kieker.analysis.reader.jmx.JMXReader" /> + <Method name="read2" params="" returns="boolean" /> + <Bug pattern="DE_MIGHT_IGNORE" /> + </Match> + + <Match> + <Class name="kieker.common.logging.LogFactory" /> + <Bug pattern="DE_MIGHT_IGNORE" /> + </Match> + + <Match> + <Class name="kieker.analysis.reader.filesystem.FSReader" /> + <Method name="read" params="" returns="boolean" /> + <Bug pattern="NN_NAKED_NOTIFY" /> + </Match> + + <Match> + <Class name="kieker.analysis.reader.filesystem.FSReader" /> + <Method name="newMonitoringRecord" params="kieker.common.record.IMonitoringRecord" returns="boolean" /> + <Bug pattern="WA_NOT_IN_LOOP" /> + </Match> + + <Match> + <Class name="kieker.analysis.reader.filesystem.FSReader" /> + <Method name="newMonitoringRecord" params="kieker.common.record.IMonitoringRecord" returns="boolean" /> + <Bug pattern="UW_UNCOND_WAIT" /> + </Match> + + <Match> + <Class name="kieker.monitoring.core.registry.Registry" /> + <Field name="eArrayCached" /> + <Bug pattern="VO_VOLATILE_REFERENCE_TO_ARRAY" /> + </Match> + + <Match> + <Class name="org.apache.commons.logging.impl.Jdk14LoggerPatched" /> + <Method name="getLog" params="java.lang.String" returns="org.apache.commons.logging.Log" /> + <Bug pattern="REC_CATCH_EXCEPTION" /> + </Match> + + <Match> + <Class name="kieker.analysis.reader.filesystem.FSDirectoryReader" /> + <Method name="processNormalInputFile" params="java.io.File" returns="void" /> + <Bug pattern="REC_CATCH_EXCEPTION" /> + </Match> + + <Match> + <Class name="kieker.analysis.reader.filesystem.FSDirectoryReader" /> + <Method name="processBinaryInputFile" params="java.io.File" returns="void" /> + <Bug pattern="REC_CATCH_EXCEPTION" /> + </Match> + + <Match> + <Class name="kieker.monitoring.core.controller.JMXController" /> + <Method name="<init>" params="kieker.common.configuration.Configuration" returns="void" /> + <Bug pattern="REC_CATCH_EXCEPTION" /> + </Match> + + <Match> + <Class name="kieker.tools.traceAnalysis.TraceAnalysisTool" /> + <Method name="dispatchTasks" params="" returns="boolean" /> + <Bug pattern="REC_CATCH_EXCEPTION" /> + </Match> + + <Match> + <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" /> + </Match> + +</FindBugsFilter> \ No newline at end of file diff --git a/Kieker.WebGUI/quality-config/pmdrules.xml b/Kieker.WebGUI/quality-config/pmdrules.xml new file mode 100644 index 0000000000000000000000000000000000000000..825a629c71333fa146651c7342e35f11f97f9984 --- /dev/null +++ b/Kieker.WebGUI/quality-config/pmdrules.xml @@ -0,0 +1,83 @@ +<?xml version="1.0"?> +<ruleset name="Kieker PMD ruleset" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" + xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> + <description> + This ruleset is checked for Kieker automatically. + </description> + + <!-- We'll use the following rulesets --> + <rule ref="rulesets/basic.xml"> + <exclude name="UnnecessaryFinalModifier"/> + </rule> + + <rule ref="rulesets/braces.xml"/> + + <rule ref="rulesets/clone.xml"/> + + <!--<rule ref="rulesets/codesize.xml">--> + + <rule ref="rulesets/controversial.xml"> + <exclude name="AvoidFinalLocalVariable"/> + <exclude name="AvoidLiteralsInIfCondition"/> + <exclude name="AvoidUsingVolatile"/> + <exclude name="CallSuperInConstructor"/> + <exclude name="DataflowAnomalyAnalysis"/> + <exclude name="OnlyOneReturn"/> + <exclude name="UnusedModifier"/> + <exclude name="UnnecessaryConstructor"/> + </rule> + + <!--<rule ref="rulesets/coupling.xml">--> + + <rule ref="rulesets/design.xml"> + <exclude name="ConfusingTernary"/> + </rule> + + <rule ref="rulesets/finalizers.xml"/> + + <rule ref="rulesets/imports.xml"/> + + <rule ref="rulesets/junit.xml"/> + + <rule ref="rulesets/logging-jakarta-commons.xml"/> + + <rule ref="rulesets/migrating_to_13.xml"/> + <rule ref="rulesets/migrating_to_14.xml"/> + <rule ref="rulesets/migrating_to_15.xml"/> + <rule ref="rulesets/migrating_to_junit4.xml"/> + + <rule ref="rulesets/naming.xml"> + <exclude name="LongVariable"/> + <exclude name="PackageCase"/> + <exclude name="ShortVariable"/> + </rule> + + <rule ref="rulesets/optimizations.xml"/> + + <rule ref="rulesets/strictexception.xml"> + <exclude name="AvoidCatchingNPE"/> + <exclude name="AvoidThrowingNullPointerException"/> + <exclude name="SignatureDeclareThrowsException"/> + </rule> + + <rule ref="rulesets/strings.xml"> + <exclude name="AvoidDuplicateLiterals"/> + </rule> + <rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"> + <properties> + <property name="skipAnnotations" value="true"/> + </properties> + </rule> + + <rule ref="rulesets/sunsecure.xml"/> + + <rule ref="rulesets/typeresolution.xml"> + <exclude name="SignatureDeclareThrowsException"/> + </rule> + + <rule ref="rulesets/unusedcode.xml"/> + +</ruleset> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableDependenciesBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableDependenciesBean.java index d2655e0a843d99181cc9f7ffedde94616eb3c5db..2132b64022376eaca1c9a2975d289e57e268b933 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableDependenciesBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableDependenciesBean.java @@ -1,41 +1,60 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.beans.application; -import java.util.ArrayList; import java.util.List; import javax.faces.bean.ApplicationScoped; import javax.faces.bean.ManagedBean; import kieker.analysis.model.analysisMetaModel.MIDependency; -import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; import kieker.webgui.common.FileManager; + import org.primefaces.model.UploadedFile; @ManagedBean @ApplicationScoped public class AvailableDependenciesBean { - private final List<MIDependency> dependencies; - private final MAnalysisMetaModelFactory factory; - - public AvailableDependenciesBean() { - this.dependencies = FileManager.getInstance().loadAllDependencies(); - factory = new MAnalysisMetaModelFactory(); - } - - public List<MIDependency> getDependencies() { - return dependencies; - } - - public void upload(final UploadedFile file) { - FileManager.getInstance().uploadDependency(file); - this.dependencies.clear(); - this.dependencies.addAll(FileManager.getInstance().loadAllDependencies()); - } - - public void delete(final MIDependency dependency) { - FileManager.getInstance().deleteDependency(dependency); - this.dependencies.clear(); - this.dependencies.addAll(FileManager.getInstance().loadAllDependencies()); - } + private final List<MIDependency> dependencies; + + public AvailableDependenciesBean() { + this.dependencies = FileManager.getInstance().loadAllDependencies(); + } + + public List<MIDependency> getDependencies() { + return dependencies; + } + + public void upload(final UploadedFile file) { + final MIDependency dependency = FileManager.getInstance().uploadDependency(file); + if (dependency != null) { + this.dependencies.add(dependency); + } + } + + public void delete(final MIDependency dependency) { + final boolean result = FileManager.getInstance().deleteDependency(dependency); + if (result) { + this.dependencies.remove(dependency); + } + } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java index bbd85e302ab43821045466fb846dfb6896dada30..fde98d72df320953406a89f1fe0207c9f22e262a 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java @@ -1,8 +1,24 @@ +/************************************************************************** + * Copyright 2012 by + Christian-Albrechts-University of Kiel + Department of + * Computer Science + Software Engineering Group and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + ************************************************************************** + */ package kieker.webgui.beans.application; import java.util.List; -import javax.faces.application.FacesMessage; import javax.faces.bean.ApplicationScoped; import javax.faces.bean.ManagedBean; import javax.faces.context.FacesContext; @@ -33,13 +49,20 @@ public class AvailableProjectsBean { } public synchronized void addProject(final String projectName) { - /* Create a new project. */ + /* + * Create a new project. + */ final MIProject project = factory.createProject(); project.setName(projectName); - /* Try to save the project. */ + /* + * Try to save the project. + */ if (FileManager.getInstance().saveNewProject(project)) { - /* Set the new project as the main project, if the current user doesn't have one. */ + /* + * Set the new project as the main project, if the current user + * doesn't have one. + */ FacesContext context = FacesContext.getCurrentInstance(); SelectedProjectBean bean = (SelectedProjectBean) context.getApplication().evaluateExpressionGet(context, "#{selectedProjectBean}", SelectedProjectBean.class); @@ -51,7 +74,7 @@ public class AvailableProjectsBean { } } - @SuppressWarnings(value = { "unused" }) + @SuppressWarnings("unused") public synchronized TreeNode getProjectsRoot() { TreeNode root = new DefaultTreeNode("Root", null); diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java index 8357c65164123c655233516d513ea0cf23819a01..7f0424a7b84ededb724683b969af0b5fc650c3e2 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.beans.application; import java.util.Map; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/SelectedDependenciesBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/SelectedDependenciesBean.java index 438655a50b52854eeaf6c84e6a6398d865d902f4..df6337a8634bf283f00874e6ad0c410bc1bb63e2 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/SelectedDependenciesBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/SelectedDependenciesBean.java @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.beans.request; import java.util.ArrayList; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java index bb5fda66779a4af5f6d555a89c93316525b01930..c61a58bdb1ec4feb3db15c635d48a4f76e439b9e 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.beans.request; import javax.faces.bean.ManagedBean; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/AvailablePluginsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/AvailablePluginsBean.java deleted file mode 100644 index 20c988072c15ee8408e1639a016d3ece10be705d..0000000000000000000000000000000000000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/AvailablePluginsBean.java +++ /dev/null @@ -1,32 +0,0 @@ -package kieker.webgui.beans.session; - -import javax.enterprise.context.SessionScoped; -import javax.faces.bean.ManagedBean; - -import org.primefaces.model.DefaultTreeNode; -import org.primefaces.model.TreeNode; - -/** - * This bean can be used to store and read the currently available plugins for the current main project. - * - * @author Nils Christian Ehmke - */ -@ManagedBean -@SessionScoped -public class AvailablePluginsBean { - - /** - * Delivers the available plugins. - * - * @return A tree with the available plugins. - */ - @SuppressWarnings(value = { "unused" }) - public TreeNode getAvailablePluginsRoot() { - TreeNode root = new DefaultTreeNode("Root", null); - - final TreeNode readerNode = new DefaultTreeNode("Reader", root); - final TreeNode analysisPluginsNode = new DefaultTreeNode("AnalysisPlugins", root); - - return root; - } -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentThemeBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentThemeBean.java index 65b67e3c01d76dd228bc0cf56ad08b1f021c4fb5..8f0aefcc9d6baad911e1633d390dafa2f3ce1018 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentThemeBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentThemeBean.java @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.beans.session; import java.util.Map; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/DependencyUploadController.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/DependencyUploadController.java index f73d1ae12c9793b5e43a24bafa7717dca19edec6..036c651e1527582df1e950f44e9bc0ac543612c4 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/DependencyUploadController.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/DependencyUploadController.java @@ -1,33 +1,51 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.beans.session; -import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; -import javax.faces.context.FacesContext; import kieker.webgui.common.FileManager; import org.primefaces.model.UploadedFile; /** - * + * * @author Nils Christian Ehmke */ @ManagedBean @SessionScoped public class DependencyUploadController { - private UploadedFile file; + private UploadedFile file; - public UploadedFile getFile() { - return file; - } + public UploadedFile getFile() { + return file; + } - public void setFile(UploadedFile file) { - this.file = file; - } + public void setFile(UploadedFile file) { + this.file = file; + } - public void upload() { - FileManager.getInstance().uploadDependency(file); - } + public void upload() { + FileManager.getInstance().uploadDependency(file); + } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/SelectedProjectBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/SelectedProjectBean.java index 85dcf55088b67211bab1ff391f1ca9fa818d6bca..0a6e68e389c23166039bab36b02bb6d750f98771 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/SelectedProjectBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/SelectedProjectBean.java @@ -1,16 +1,34 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ package kieker.webgui.beans.session; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import kieker.analysis.model.analysisMetaModel.MIProject; + +import org.primefaces.model.DefaultTreeNode; import org.primefaces.model.TreeNode; /** - * This bean can be used to store the currently selected project and the current main project for the user within a session. + * This bean can be used to store the currently selected project and the current + * main project for the user within a session. * * @author Nils Christian Ehmke */ @@ -22,19 +40,40 @@ public class SelectedProjectBean { private MIProject selectedProject; private MIProject mainProject; + /** + * Creates a new instance of this class. + */ + public SelectedProjectBean() {} + + /** + * Delivers the main project of the current user. It can be null. + * + * @return The user's main project. + */ public MIProject getMainProject() { return mainProject; } - public void setMainProject(MIProject mainProject) { + /** + * Sets the main project of the current user. + * + * @param mainProject + * The new main project of the current user. + */ + public void setMainProject(final MIProject mainProject) { this.mainProject = mainProject; } + /** + * Delivers the project currently selected by the user. It can be null. + * + * @return The user's currently selected project. + */ public MIProject getSelectedProject() { return selectedProject; } - public void setSelectedProject(MIProject selectedProject) { + public void setSelectedProject(final MIProject selectedProject) { this.selectedProject = selectedProject; } @@ -42,7 +81,7 @@ public class SelectedProjectBean { return selectedNode; } - public void setSelectedNode(TreeNode selectedNode) { + public void setSelectedNode(final TreeNode selectedNode) { this.selectedNode = selectedNode; if (selectedNode != null && selectedNode.getData() instanceof MIProject) { setSelectedProject((MIProject) selectedNode.getData()); @@ -51,7 +90,21 @@ public class SelectedProjectBean { } } - public String getFontWeight(MIProject project) { - return (project == mainProject) ? "bold" : "normal"; + public String getFontWeight(final MIProject project) { + return (project == this.mainProject) ? "bold" : "normal"; + } + + /** + * Delivers the available plugins. + * + * @return A tree with the available plugins. + */ + public TreeNode getAvailablePluginsRoot() { + TreeNode root = new DefaultTreeNode("Root", null); + + final TreeNode readerNode = new DefaultTreeNode("default", "Reader", root); + final TreeNode analysisPluginsNode = new DefaultTreeNode("default", "AnalysisPlugins", root); + + return root; } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/FileManager.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/FileManager.java index 26ba8ae5f72b647784b00ebe03bad267aebab994..56459e0b47ab4827fda28bf402ed6039967205e0 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/FileManager.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/FileManager.java @@ -1,3 +1,20 @@ +/************************************************************************* + * Copyright 2012 by + Christian-Albrechts-University of Kiel + Department of + * Computer Science + Software Engineering Group and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + ************************************************************************** + */ package kieker.webgui.common; import java.io.File; @@ -22,234 +39,242 @@ import kieker.common.logging.LogFactory; * This is a singleton class for the access to the file system. It makes sure * that the necessary directories for the execution of the application exist. * <b>Do not</b> remove directories created from this manager during runtime! - * Directories are created during first access to the class.<br> Currently + * Directories are created during first access to the class.<br> + * Currently * nearly all methods are synchronized. A fine grained synchronization should be * implemented in the future. - * + * * @author Nils Christian Ehmke */ public final class FileManager { - private static final Log LOG = LogFactory.getLog(FileManager.class); - private static final String ROOT_DIR = "data"; - private static final String PROJECT_DIR = ROOT_DIR + File.separator + "projects"; - private static final String LIB_DIR = ROOT_DIR + File.separator + "libraries"; - private static final String EXTENSION = ".kax"; - private static final String JAR_EXTENSION = ".jar"; - private static final int BUF_SIZE = 1024; - private static final FileManager instance = new FileManager(); - - private FileManager() { - checkAndCreateDirectories(); - } - - private synchronized void checkAndCreateDirectories() { - /* - * Make sure that the directories exist and create them if necessary. - */ - final File dirProj = new File(PROJECT_DIR); - final File dirLib = new File(LIB_DIR); - boolean couldCreated = true; - - if (!dirProj.exists()) { - couldCreated &= dirProj.mkdirs(); - } - if (!dirLib.exists()) { - couldCreated &= dirLib.mkdirs(); - } - - if (!couldCreated) { - FileManager.LOG.error("Could not create the necessary directories for the application"); - } - } - - /** - * This method saves a given project using the name of the project as the - * project-directory. The project-directory must already exist. - * - * @param project The project to be stored. - * @return true iff the project-directory does already exist and the storage - * was successful. - */ - public synchronized boolean saveProject(final MIProject project) { - final String projectName = project.getName(); - - final File dirProject = new File(PROJECT_DIR + File.separator + projectName); - - /* - * Make sure that the directory for the project exists. - */ - if (!dirProject.exists()) { - return false; - } else { - /* - * Try to save the project. - */ - final File fileProject = new File(dirProject, projectName + FileManager.EXTENSION); - try { - final AnalysisController controller = new AnalysisController(project); - return controller.saveToFile(fileProject, projectName); - } catch (final Exception ex) { - FileManager.LOG.error("Could not save project '" + projectName + "'."); - return false; - } - } - } - - /** - * This method saves a given project using the name of the project as the - * project-directory. THe project-directory must not already exist. - * - * @param project The project to be stored. - * @return true iff the project-directory does not already exist and the - * storage was successful. - */ - public synchronized boolean saveNewProject(final MIProject project) { - final String projectName = project.getName(); - - final File dirProject = new File(PROJECT_DIR + File.separator + projectName); - - /* - * Make sure that the project does not already exist and create the - * project directory. - */ - if (dirProject.exists() || !dirProject.mkdir()) { - return false; - } else { - /* - * The directory should exist now. Store the project. - */ - return saveProject(project); - } - } - - /** - * This method can be used to load all currently saved projects. - * - * @return A list containing the loaded projects. If something went wrong, - * an empty list will be returned, never null. - */ - public synchronized List<MIProject> loadAllProjects() { - List<MIProject> resultList = new ArrayList<MIProject>(); - - /* - * Try to get all directories within the project directory. - */ - final File directories[] = new File(PROJECT_DIR).listFiles(); - if (directories != null) { - for (File directory : directories) { - if (directory.isDirectory()) { - /* - * If there is a project file within the directory, we know - * the name of it. - */ - final File projectFile = new File(directory, directory.getName() + FileManager.EXTENSION); - if (projectFile.exists()) { - try { - /* - * Try to load the project. - */ - MIProject project = AnalysisController.loadFromFile(projectFile); - if (project != null) { - resultList.add(project); - } - } catch (Exception ex) { - FileManager.LOG.error("Could not load project '" + directory.getName() + "'."); - } - } - } - } - } - - return resultList; - } - - /** - * This method uploads a given file as a new dependency. The file is stored - * within the lib-directory of this application. If a file with the same - * name does already exist, it will be replaces. - * - * @param file The file to be uploaded. - * @return true iff the file has been uploaded successfully. - */ - public boolean uploadDependency(final UploadedFile file) { - final File depFile = new File(LIB_DIR, file.getFileName()); - - InputStream in = null; - OutputStream out = null; - try { - /* - * Get the streams. - */ - in = file.getInputstream(); - out = new FileOutputStream(depFile); - final byte buf[] = new byte[BUF_SIZE]; - int count; - - /* - * Transfer the file. - */ - while ((count = in.read(buf)) != -1) { - out.write(buf, 0, count); - } - - } catch (final IOException ex) { - FileManager.LOG.error("Could not transfer file '" + file.getFileName() + "'"); - return false; - } finally { - /* - * Try to make sure that the streams will be closed. - */ - try { - if (in != null) { - in.close(); - } - if (out != null) { - out.close(); - } - } catch (IOException ex) { - // Ignore - } - } - - return true; - } - - /** - * Delivers the only instance of this class. - * - * @return The singleton instance of this class. - */ - public static FileManager getInstance() { - return instance; - } - - public List<MIDependency> loadAllDependencies() { - final List<MIDependency> resultList = new ArrayList<MIDependency>(); - final MAnalysisMetaModelFactory factory = new MAnalysisMetaModelFactory(); - /* - * Try to get all files within the library directory. - */ - final File files[] = new File(LIB_DIR).listFiles(); - if (files != null) { - for (File file : files) { - if (file.isFile()) { - if (file.getName().endsWith(JAR_EXTENSION)) { - MIDependency dependency = factory.createDependency(); - dependency.setFilePath(file.getAbsolutePath()); - resultList.add(dependency); - } - } - } - } - - return resultList; - } - - public void deleteDependency(final MIDependency dependency) { - File file = new File(dependency.getFilePath()); - if (file.isFile()) { - file.delete(); - } - } + private static final Log LOG = LogFactory.getLog(FileManager.class); + private static final String ROOT_DIR = "data"; + private static final String PROJECT_DIR = ROOT_DIR + File.separator + "projects"; + private static final String LIB_DIR = ROOT_DIR + File.separator + "libraries"; + private static final String EXTENSION = ".kax"; + private static final String JAR_EXTENSION = ".jar"; + private static final int BUF_SIZE = 1024; + private static final FileManager instance = new FileManager(); + private final MAnalysisMetaModelFactory factory; + + private FileManager() { + checkAndCreateDirectories(); + this.factory = new MAnalysisMetaModelFactory(); + } + + private synchronized void checkAndCreateDirectories() { + /* + * Make sure that the directories exist and create them if necessary. + */ + final File dirProj = new File(PROJECT_DIR); + final File dirLib = new File(LIB_DIR); + boolean couldCreated = true; + + if (!dirProj.exists()) { + couldCreated &= dirProj.mkdirs(); + } + if (!dirLib.exists()) { + couldCreated &= dirLib.mkdirs(); + } + + if (!couldCreated) { + FileManager.LOG.error("Could not create the necessary directories for the application"); + } + } + + /** + * This method saves a given project using the name of the project as the + * project-directory. The project-directory must already exist. + * + * @param project + * The project to be stored. + * @return true iff the project-directory does already exist and the storage + * was successful. + */ + public synchronized boolean saveProject(final MIProject project) { + final String projectName = project.getName(); + + final File dirProject = new File(PROJECT_DIR + File.separator + projectName); + + /* + * Make sure that the directory for the project exists. + */ + if (!dirProject.exists()) { + return false; + } else { + /* + * Try to save the project. + */ + final File fileProject = new File(dirProject, projectName + FileManager.EXTENSION); + try { + final AnalysisController controller = new AnalysisController(project); + return controller.saveToFile(fileProject, projectName); + } catch (final Exception ex) { + FileManager.LOG.error("Could not save project '" + projectName + "'."); + return false; + } + } + } + + /** + * This method saves a given project using the name of the project as the + * project-directory. THe project-directory must not already exist. + * + * @param project + * The project to be stored. + * @return true iff the project-directory does not already exist and the + * storage was successful. + */ + public synchronized boolean saveNewProject(final MIProject project) { + final String projectName = project.getName(); + + final File dirProject = new File(PROJECT_DIR + File.separator + projectName); + + /* + * Make sure that the project does not already exist and create the + * project directory. + */ + if (dirProject.exists() || !dirProject.mkdir()) { + return false; + } else { + /* + * The directory should exist now. Store the project. + */ + return saveProject(project); + } + } + + /** + * This method can be used to load all currently saved projects. + * + * @return A list containing the loaded projects. If something went wrong, + * an empty list will be returned, never null. + */ + public synchronized List<MIProject> loadAllProjects() { + List<MIProject> resultList = new ArrayList<MIProject>(); + + /* + * Try to get all directories within the project directory. + */ + final File[] directories = new File(PROJECT_DIR).listFiles(); + if (directories != null) { + for (File directory : directories) { + if (directory.isDirectory()) { + /* + * If there is a project file within the directory, we know + * the name of it. + */ + final File projectFile = new File(directory, directory.getName() + FileManager.EXTENSION); + if (projectFile.exists()) { + try { + /* + * Try to load the project. + */ + MIProject project = AnalysisController.loadFromFile(projectFile); + if (project != null) { + resultList.add(project); + } + } catch (Exception ex) { + FileManager.LOG.error("Could not load project '" + directory.getName() + "'."); + } + } + } + } + } + + return resultList; + } + + /** + * This method uploads a given file as a new dependency. The file is stored + * within the lib-directory of this application. If a file with the same + * name does already exist, it will be replaces. + * + * @param file + * The file to be uploaded. + * @return The new dependency iff the uploading was sucesfull, null + * otherwise. + */ + public MIDependency uploadDependency(final UploadedFile file) { + final File depFile = new File(LIB_DIR, file.getFileName()); + + InputStream in = null; + OutputStream out = null; + try { + /* + * Get the streams. + */ + in = file.getInputstream(); + out = new FileOutputStream(depFile); + final byte[] buf = new byte[BUF_SIZE]; + int count; + + /* + * Transfer the file. + */ + while ((count = in.read(buf)) != -1) { + out.write(buf, 0, count); + } + + } catch (final IOException ex) { + FileManager.LOG.error("Could not transfer file '" + file.getFileName() + "'"); + return null; + } finally { + /* + * Try to make sure that the streams will be closed. + */ + try { + if (in != null) { + in.close(); + } + if (out != null) { + out.close(); + } + } catch (IOException ex) { + // Ignore + } + } + final MIDependency dependency = factory.createDependency(); + dependency.setFilePath(depFile.getAbsolutePath()); + return dependency; + } + + /** + * Delivers the only instance of this class. + * + * @return The singleton instance of this class. + */ + public static FileManager getInstance() { + return instance; + } + + public List<MIDependency> loadAllDependencies() { + final List<MIDependency> resultList = new ArrayList<MIDependency>(); + /* + * Try to get all files within the library directory. + */ + final File[] files = new File(LIB_DIR).listFiles(); + if (files != null) { + for (File file : files) { + if (file.isFile()) { + if (file.getName().endsWith(JAR_EXTENSION)) { + MIDependency dependency = factory.createDependency(); + dependency.setFilePath(file.getAbsolutePath()); + resultList.add(dependency); + } + } + } + } + + return resultList; + } + + public boolean deleteDependency(final MIDependency dependency) { + File file = new File(dependency.getFilePath()); + if (file.isFile()) { + return file.delete(); + } + return false; + } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/PluginFinder.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/PluginFinder.java index b5ac3306dee9059783673a49816adc03e76edb21..4970badcf686484fb246c71e86cfec721300a49a 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/PluginFinder.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/PluginFinder.java @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.common; import java.io.File; @@ -16,50 +36,51 @@ import kieker.analysis.plugin.port.Plugin; */ public class PluginFinder { - /** - * This method delivers all classes which are available in the given jar and - * has the Plugin-Annotation from the Kieker framework. - * - * @param url The url for the jar. - * @return A list containing all available plugin-classes or null, if an - * exception occured. - */ - public static List<Class<?>> getAllPluginsWithinJar(final URL url) { - try { - /* - * Get a classloader and make sure that it has the system class - * loader as parent and that it knows the url. - */ - final ClassLoader classLoader = new URLClassLoader(new URL[]{url}, ClassLoader.getSystemClassLoader()); - /* - * Open the jar file and run through all entries within this file. - */ - final JarFile jarFile = new JarFile(new File(url.getPath())); - final List<Class<?>> result = new ArrayList<Class<?>>(); - Enumeration<JarEntry> jarEntries = jarFile.entries(); - while (jarEntries.hasMoreElements()) { - JarEntry jarEntry = (JarEntry) jarEntries.nextElement(); - try { - String name = jarEntry.toString(); - name = name.replace('/', '.'); - name = name.replace(".class", ""); - /* - * Try to find a class with the same name. - */ - Class<?> c = classLoader.loadClass(name); - /* - * If it is a class and has the annotation - put it into our - * list. - */ - if (c.isAnnotationPresent(Plugin.class)) { - result.add(c); - } - } catch (Throwable ex) { - } - } - return result; - } catch (IOException ex) { - return null; - } - } + /** + * This method delivers all classes which are available in the given jar and + * has the Plugin-Annotation from the Kieker framework. + * + * @param url + * The url for the jar. + * @return A list containing all available plugin-classes or null, if an + * exception occured. + */ + public static List<Class<?>> getAllPluginsWithinJar(final URL url) { + try { + /* + * Get a classloader and make sure that it has the system class + * loader as parent and that it knows the url. + */ + final ClassLoader classLoader = new URLClassLoader(new URL[] { url }, ClassLoader.getSystemClassLoader()); + /* + * Open the jar file and run through all entries within this file. + */ + final JarFile jarFile = new JarFile(new File(url.getPath())); + final List<Class<?>> result = new ArrayList<Class<?>>(); + Enumeration<JarEntry> jarEntries = jarFile.entries(); + while (jarEntries.hasMoreElements()) { + JarEntry jarEntry = (JarEntry) jarEntries.nextElement(); + try { + String name = jarEntry.toString(); + name = name.replace('/', '.'); + name = name.replace(".class", ""); + /* + * Try to find a class with the same name. + */ + Class<?> c = classLoader.loadClass(name); + /* + * If it is a class and has the annotation - put it into our + * list. + */ + if (c.isAnnotationPresent(Plugin.class)) { + result.add(c); + } + } catch (Throwable ex) { + } + } + return result; + } catch (IOException ex) { + return null; + } + } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIDependencyToIntConverter.java b/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIDependencyToIntConverter.java index c4b3d1f05eaebe03e512b818b6b5399374ed0aa9..1103a930913e6005b74ec6ea0544d047c674e396 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIDependencyToIntConverter.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIDependencyToIntConverter.java @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.converter; import java.io.File; @@ -11,29 +31,29 @@ import kieker.analysis.model.analysisMetaModel.MIDependency; /** * This converter can be used to convert an instance of <i>MIDependency</i> to * the size (in MiBByte) of the dependency, but of course <b>not</b> vice versa. - * + * * @author Nils Christian Ehmke */ @FacesConverter(value = MIDependencyToIntConverter.NAME) public class MIDependencyToIntConverter implements Converter { - public static final String NAME = "kieker.webgui.converter.MIDependencyToIntConverter"; + public static final String NAME = "kieker.webgui.converter.MIDependencyToIntConverter"; - /** - * Delivers always null - */ - @Override - public Object getAsObject(FacesContext fc, UIComponent uic, String string) { - return null; - } + /** + * Delivers always null + */ + @Override + public Object getAsObject(FacesContext fc, UIComponent uic, String string) { + return null; + } - @Override - public String getAsString(FacesContext fc, UIComponent uic, Object o) { - if (o == null || !(o instanceof MIDependency)) { - return null; - } else { - long size = new File(((MIDependency) o).getFilePath()).length(); - return new DecimalFormat("#.##").format(size / 1024f / 1024).concat(" [MiByte]"); - } - } + @Override + public String getAsString(FacesContext fc, UIComponent uic, Object o) { + if (o == null || !(o instanceof MIDependency)) { + return null; + } else { + long size = new File(((MIDependency) o).getFilePath()).length(); + return new DecimalFormat("#.##").format(size / 1024f / 1024).concat(" [MiByte]"); + } + } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIDependencyToStringConverter.java b/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIDependencyToStringConverter.java index f84d6af57332da5e3812db4a64d2523a09d9d39e..b503c3424d0ad9b92320f72d6a02f6d7466b0e67 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIDependencyToStringConverter.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIDependencyToStringConverter.java @@ -1,3 +1,21 @@ +/** + * ************************************************************************* + * Copyright 2012 by + Christian-Albrechts-University of Kiel + Department of + * Computer Science + Software Engineering Group and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + * ************************************************************************* + */ package kieker.webgui.converter; import java.io.File; @@ -10,24 +28,45 @@ import kieker.analysis.model.analysisMetaModel.MIDependency; /** * This converter can be used to convert an instance of <i>MIDependency</i> to a * human readable string, but <b>not</b> vice versa. - * + * * @author Nils Christian Ehmke */ @FacesConverter(value = MIDependencyToStringConverter.NAME) public class MIDependencyToStringConverter implements Converter { - public static final String NAME = "kieker.webgui.converter.MIDependencyToStringConverter"; + public static final String NAME = "kieker.webgui.converter.MIDependencyToStringConverter"; - /** - * Delivers always null - */ - @Override - public Object getAsObject(FacesContext fc, UIComponent uic, String string) { - return null; - } + /** + * This method delivers always null and should not be used. + * + * @param fc + * The faces context. + * @param uic + * The component. + * @param string + * The string to be converted. + * @return null + */ + @Override + public Object getAsObject(final FacesContext fc, final UIComponent uic, final String string) { + return null; + } - @Override - public String getAsString(FacesContext fc, UIComponent uic, Object o) { - return (o == null || !(o instanceof MIDependency)) ? null : (new File(((MIDependency) o).getFilePath()).getName()); - } + /** + * This method converts the given object (on condition that it is an + * instance of the class <code>MIDependency</code>) to a human readable string. + * + * @param fc + * The faces context. + * @param uic + * The component. + * @param o + * The object to be converted. + * @return A human readable represantation of the given object or null, of + * the object is from the wrong class. + */ + @Override + public String getAsString(final FacesContext fc, final UIComponent uic, final Object o) { + return (o == null || !(o instanceof MIDependency)) ? null : (new File(((MIDependency) o).getFilePath()).getName()); + } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIProjectToStringConverter.java b/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIProjectToStringConverter.java index 34e1475fa280dde6958f7d2f9265f78a20e43ff8..104b8ecd817be719828593be35c12f9244424cdf 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIProjectToStringConverter.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/converter/MIProjectToStringConverter.java @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + package kieker.webgui.converter; import javax.faces.component.UIComponent; @@ -15,6 +35,7 @@ import kieker.analysis.model.analysisMetaModel.MIProject; public class MIProjectToStringConverter implements Converter { public static final String NAME = "kieker.webgui.converter.MIProjectToStringConverter"; + /** * Delivers always null */ diff --git a/Kieker.WebGUI/src/main/webapp/main.xhtml b/Kieker.WebGUI/src/main/webapp/main.xhtml index 3cef4dc5e4ad45a5989241797e1895119a2161ad..4f108d78025ceac5bc0976871abd7716633b089d 100644 --- a/Kieker.WebGUI/src/main/webapp/main.xhtml +++ b/Kieker.WebGUI/src/main/webapp/main.xhtml @@ -151,7 +151,7 @@ resizable="true" collapsible="true"> <h:form> <p:tree style="width: auto" - value="#{availablePluginsBean.availablePluginsRoot}" var="node"> + value="#{selectedProjectBean.availablePluginsRoot}" var="node"> <p:treeNode> <h:outputText value="#{node}" /> </p:treeNode> diff --git a/Kieker.WebGUI/src/main/webapp/projectDependencies.css b/Kieker.WebGUI/src/main/webapp/projectDependencies.css new file mode 100644 index 0000000000000000000000000000000000000000..22b55ec270aa35e7f644aaa5d8af966c02518965 --- /dev/null +++ b/Kieker.WebGUI/src/main/webapp/projectDependencies.css @@ -0,0 +1,22 @@ +@charset "UTF-8"; + +.ui-button { + font-size: 15px; +} + +.ui-layout-center { + font-size: 15px; +} + +.ui-layout-north { + font-size: 15px; +} + +.ui-panel { + font-size: 15px; +} + +.my-picklist .ui-picklist .ui-picklist-list { + height: 120px; + width: 520px; +} \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/projectDependencies.xhtml b/Kieker.WebGUI/src/main/webapp/projectDependencies.xhtml index a4813ae384fd4e6952a8cc6579b0d88bc101613c..6df8485c91d668d9956a6f1316ebdf516387345e 100644 --- a/Kieker.WebGUI/src/main/webapp/projectDependencies.xhtml +++ b/Kieker.WebGUI/src/main/webapp/projectDependencies.xhtml @@ -1,26 +1,41 @@ <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.org/ui"> + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:p="http://primefaces.org/ui"> -<f:view contentType="text/html"> - <h:head> - <title>Kieker.WebGUI - Project Dependencies</title> - <link rel="stylesheet" title="Standard-Stylesheet" type="text/css" - href="main.css" /> - </h:head> - <body> - <h:form> - <p:pickList id="pickList" value="#{selectedDependenciesBean.dependencies}" var="dependency" - itemLabel="#{dependency}" itemValue="#{dependency}" /> - <p:commandButton value="Ok" /> - <p:commandButton value="Accept" /> - <p:commandButton value="Cancel" /> - <p:commandButton value="Reset" /> - </h:form> - </body> -</f:view> + <f:view contentType="text/html"> + <h:head> + <title>Kieker.WebGUI - Project Dependencies</title> + <link rel="stylesheet" title="Standard-Stylesheet" type="text/css" + href="../projectDependencies.css" /> + </h:head> + <body> + <p:layout fullPage="true"> + <p:layoutUnit header="Navigation" position="north" collapsible="true" resizable="true"> + <!-- The control panel to get back. --> + <h:form> + Click + <p:commandLink ajax="false" action="/main"> + <h:outputText value="here" /> + </p:commandLink> + to get back to the main menu. + </h:form> + </p:layoutUnit> + + <p:layoutUnit header="Currently used Dependencies" position="center" > + <div align="center"> + <p:pickList id="pickList" value="#{selectedDependenciesBean.dependencies}" var="dependency" + itemLabel="#{dependency}" itemValue="#{dependency}" > + <f:facet name="sourceCaption">Available</f:facet> + <f:facet name="targetCaption">Project</f:facet> + </p:pickList> + </div> + </p:layoutUnit> + + </p:layout> + </body> + </f:view> </html> \ No newline at end of file