Commit 2620f001 authored by Christian Wulf's avatar Christian Wulf

reactivated checkstyle with minimum of checks

parent 0f2ae622
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
<local-check-config name="TeeTime" location="conf/quality-config/cs-conf.xml" type="project" description="">
<additional-data name="protect-config-file" value="false"/>
</local-check-config>
......@@ -8,8 +8,15 @@
<property name="checkstyle.cache.file" value="${project_loc}/target/checkstyle-cachefile"/>
<property name="checkstyle.header.file" value="C:\Users\chw\Repositories\teetime\target\checkstyle-header-default.txt"/>
</local-check-config>
<fileset name="all" enabled="true" check-config-name="TeeTime" local="true">
<file-match-pattern match-pattern="." include-pattern="true"/>
<local-check-config name="maven-checkstyle-plugin validate" location="file:/C:/Users/chw/git/teetime/conf/quality-config/cs-conf.xml" type="remote" description="maven-checkstyle-plugin configuration validate">
<property name="checkstyle.cache.file" value="${project_loc}/target/checkstyle-cachefile"/>
<property name="checkstyle.header.file" value="C:\Users\chw\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\teetime\com.basistech.m2e.code.quality.checkstyleConfigurator\checkstyle-header-validate.txt"/>
</local-check-config>
<fileset name="java-sources-validate" enabled="true" check-config-name="maven-checkstyle-plugin validate" local="true">
<file-match-pattern match-pattern="src/test/java/.*\.java" include-pattern="true"/>
<file-match-pattern match-pattern="src/main/java/.*\.java" include-pattern="true"/>
<file-match-pattern match-pattern="src/main/resources/.*\.properties" include-pattern="true"/>
<file-match-pattern match-pattern="src/test/resources/.*\.properties" include-pattern="true"/>
</fileset>
<filter name="WriteProtectedFiles" enabled="true"/>
<filter name="DerivedFiles" enabled="true"/>
......
......@@ -20,6 +20,11 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
......@@ -31,5 +36,6 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
<nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
</natures>
</projectDescription>
This diff is collapsed.
......@@ -284,28 +284,46 @@
</plugin>
<!-- Checkstyle -->
<!-- <plugin> -->
<!-- <groupId>org.apache.maven.plugins</groupId> -->
<!-- <artifactId>maven-checkstyle-plugin</artifactId> -->
<!-- <version>${checkstyle.version}</version> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <phase>test</phase> -->
<!-- <goals> -->
<!-- <goal>check</goal> -->
<!-- </goals> -->
<!-- <configuration> -->
<!-- <configLocation>${project.basedir}/conf/quality-config/cs-conf.xml</configLocation> -->
<!-- <includeTestSourceDirectory>true</includeTestSourceDirectory> -->
<!-- <encoding>UTF-8</encoding> -->
<!-- <consoleOutput>true</consoleOutput> -->
<!-- <failsOnError>false</failsOnError> -->
<!-- <failOnViolation>false</failOnViolation> -->
<!-- <linkXRef>false</linkXRef> -->
<!-- </configuration> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<!-- <executions> -->
<!-- <execution> -->
<!-- <phase>test</phase> -->
<!-- <goals> -->
<!-- <goal>check</goal> -->
<!-- </goals> -->
<!-- <configuration> -->
<!-- <configLocation>${project.basedir}/conf/quality-config/cs-conf.xml</configLocation> -->
<!-- <includeTestSourceDirectory>true</includeTestSourceDirectory> -->
<!-- <encoding>UTF-8</encoding> -->
<!-- <consoleOutput>true</consoleOutput> -->
<!-- <failsOnError>false</failsOnError> -->
<!-- <failOnViolation>false</failOnViolation> -->
<!-- <linkXRef>false</linkXRef> -->
<!-- </configuration> -->
<!-- </execution> -->
<!-- </executions> -->
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<configLocation>${project.basedir}/conf/quality-config/cs-conf.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>false</failsOnError>
<failOnViolation>false</failOnViolation>
<linkXRef>false</linkXRef>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Findbugs -->
<plugin>
......
......@@ -56,6 +56,13 @@ class A3PipeInstantiation implements ITraverserVisitor {
return VisitorBehavior.CONTINUE;
}
@Override
public void visit(final DummyPipe pipe, final AbstractPort<?> port) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Unconnected port " + port + " in stage " + port.getOwningStage().getId());
}
}
private <T> void instantiatePipe(final IPipe<T> pipe) {
if (!(pipe instanceof InstantiationPipe)) { // if manually connected
return;
......@@ -80,11 +87,4 @@ class A3PipeInstantiation implements ITraverserVisitor {
}
}
@Override
public void visit(final DummyPipe pipe, final AbstractPort<?> port) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Unconnected port " + port + " in stage " + port.getOwningStage().getId());
}
}
}
......@@ -481,14 +481,14 @@ public abstract class AbstractStage {
outputPorts.remove(outputPort); // TODO update setIndex IF it is still used
}
protected final void addOutputPortRemovedListener(final PortRemovedListener<OutputPort<?>> outputPortRemovedListener) {
outputPorts.addPortRemovedListener(outputPortRemovedListener);
}
protected void removeDynamicPort(final InputPort<?> inputPort) {
inputPorts.remove(inputPort); // TODO update setIndex IF it is still used
}
protected final void addOutputPortRemovedListener(final PortRemovedListener<OutputPort<?>> outputPortRemovedListener) {
outputPorts.addPortRemovedListener(outputPortRemovedListener);
}
protected final void addInputPortRemovedListener(final PortRemovedListener<InputPort<?>> inputPortRemovedListener) {
inputPorts.addPortRemovedListener(inputPortRemovedListener);
}
......
......@@ -31,6 +31,11 @@ public class SignalingCounter {
conditionalNotifyAll(counter);
}
public synchronized void inc(final SignalingCounter otherCounter) {
counter += otherCounter.counter;
conditionalNotifyAll(counter);
}
public synchronized void dec() {
counter--;
conditionalNotifyAll(counter);
......@@ -61,11 +66,6 @@ public class SignalingCounter {
}
}
public synchronized void inc(final SignalingCounter otherCounter) {
counter += otherCounter.counter;
conditionalNotifyAll(counter);
}
@Override
public String toString() {
return "counter: " + counter + ", " + super.toString();
......
......@@ -56,6 +56,11 @@ public final class PCBlockingQueue<E> implements BlockingQueue<E> {
return offered;
}
@Override
public boolean offer(final E e, final long timeout, final TimeUnit unit) throws InterruptedException {
throw new UnsupportedOperationException();
}
@Override
public E poll() {
E e = q.poll();
......@@ -65,11 +70,6 @@ public final class PCBlockingQueue<E> implements BlockingQueue<E> {
return e;
}
@Override
public boolean offer(final E e, final long timeout, final TimeUnit unit) throws InterruptedException {
throw new UnsupportedOperationException();
}
@Override
public E poll(final long timeout, final TimeUnit unit) throws InterruptedException {
throw new UnsupportedOperationException();
......@@ -127,11 +127,21 @@ public final class PCBlockingQueue<E> implements BlockingQueue<E> {
return q.iterator();
}
@Override
public boolean remove(final Object o) {
return q.remove(o);
}
@Override
public E remove() {
return q.remove();
}
@Override
public <T> T[] toArray(final T[] a) {
return q.toArray(a);
}
@Override
public Object[] toArray() {
return q.toArray();
......@@ -147,16 +157,6 @@ public final class PCBlockingQueue<E> implements BlockingQueue<E> {
return q.peek();
}
@Override
public <T> T[] toArray(final T[] a) {
return q.toArray(a);
}
@Override
public boolean remove(final Object o) {
return q.remove(o);
}
@Override
public boolean containsAll(final Collection<?> c) {
return q.containsAll(c);
......
......@@ -42,15 +42,13 @@ public abstract class AbstractTcpReader implements Runnable {
@Override
public final void run() {
ServerSocketChannel serversocket = null;
ServerSocketChannel serverSocketChannel = null;
try {
serversocket = ServerSocketChannel.open();
serversocket.socket().bind(new InetSocketAddress(this.port));
if (logger.isDebugEnabled()) {
logger.debug("Listening on port " + this.port);
}
serverSocketChannel = ServerSocketChannel.open();
serverSocketChannel.socket().bind(new InetSocketAddress(this.port));
logger.debug("Listening on port {}", this.port);
final SocketChannel socketChannel = serversocket.accept();
final SocketChannel socketChannel = serverSocketChannel.accept();
try {
final ByteBuffer buffer = ByteBuffer.allocateDirect(bufferCapacity);
while (socketChannel.read(buffer) != -1 && !terminated) {
......@@ -62,9 +60,9 @@ public abstract class AbstractTcpReader implements Runnable {
} catch (final IOException ex) {
logger.error("Error while reading.", ex);
} finally {
if (null != serversocket) {
if (null != serverSocketChannel) {
try {
serversocket.close();
serverSocketChannel.close();
} catch (final IOException e) {
logger.debug("Failed to close TCP connection.", e);
}
......@@ -95,7 +93,8 @@ public abstract class AbstractTcpReader implements Runnable {
/**
* @param buffer
* to be read from
* @return <ul>
* @return
* <ul>
* <li><code>true</code> when there were enough bytes to perform the read operation
* <li><code>false</code> otherwise. In this case, the buffer is reset, compacted, and filled with new content.
* </ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment