Skip to content
Snippets Groups Projects
Commit e9b6764b authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Findbugs issues

parent c2cb00d0
No related branches found
No related tags found
No related merge requests found
Showing
with 95 additions and 31 deletions
......@@ -48,9 +48,6 @@ eclipse.classpath.plusConfigurations += [configurations.providedCompile]
apply plugin: 'pmd'
pmd {
ignoreFailures = true
// Clear the rule set first. Otherwise we would have a lot of additional rules in our rule set.
// ruleSets = []
}
apply plugin: 'checkstyle'
......@@ -64,6 +61,8 @@ findbugs {
ignoreFailures = true
effort = "max"
reportLevel = "low"
excludeFilter = file('config/findbugs/excludeFilter.xml')
}
def commonStartScriptConfiguration = {
......
<FindBugsFilter>
<Match>
<Class name="org.eclipse.wb.swt.SWTResourceManager" />
<Bug pattern="REC_CATCH_EXCEPTION" />
</Match>
</FindBugsFilter>
\ No newline at end of file
......@@ -67,7 +67,7 @@ public final class DataModel extends Observable {
final KiekerMetadataRecord metadataRecord = metadataRecords.get(0);
this.shortTimeUnit = this.convertToShortTimeUnit(TimeUnit.valueOf(metadataRecord.getTimeUnit()));
} else {
this.shortTimeUnit = this.convertToShortTimeUnit(null);
this.shortTimeUnit = "";
}
this.setChanged();
......
......@@ -23,14 +23,19 @@ import org.eclipse.swt.SWT;
public class AggregatedExecutionAvgDurationComparator extends AbstractDirectedComparator<AggregatedExecution> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) {
int result = Long.compare(arg0.getAvgDuration(), arg1.getAvgDuration());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = Long.compare(arg1.getAvgDuration(), arg0.getAvgDuration());
} else {
result = Long.compare(arg0.getAvgDuration(), arg1.getAvgDuration());
}
return result;
return result;
}
}
......@@ -23,14 +23,19 @@ import org.eclipse.swt.SWT;
public class AggregatedExecutionCallComparator extends AbstractDirectedComparator<AggregatedExecution> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) {
int result = Long.compare(arg0.getCalls(), arg1.getCalls());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = Long.compare(arg1.getCalls(), arg0.getCalls());
} else {
result = Long.compare(arg0.getCalls(), arg1.getCalls());
}
return result;
return result;
}
}
......@@ -23,14 +23,19 @@ import org.eclipse.swt.SWT;
public class AggregatedExecutionMaxDurationComparator extends AbstractDirectedComparator<AggregatedExecution> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) {
int result = Long.compare(arg0.getMaxDuration(), arg1.getMaxDuration());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = Long.compare(arg1.getMaxDuration(), arg0.getMaxDuration());
} else {
result = Long.compare(arg0.getMaxDuration(), arg1.getMaxDuration());
}
return result;
return result;
}
}
......@@ -23,14 +23,19 @@ import org.eclipse.swt.SWT;
public class AggregatedExecutionMinDurationComparator extends AbstractDirectedComparator<AggregatedExecution> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) {
int result = Long.compare(arg0.getMinDuration(), arg1.getMinDuration());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = Long.compare(arg1.getMinDuration(), arg0.getMinDuration());
} else {
result = Long.compare(arg0.getMinDuration(), arg1.getMinDuration());
}
return result;
return result;
}
}
......@@ -7,14 +7,19 @@ import org.eclipse.swt.SWT;
public class AggregatedExecutionTotalDurationComparator extends AbstractDirectedComparator<AggregatedExecution> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) {
int result = Long.compare(arg0.getTotalDuration(), arg1.getTotalDuration());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = Long.compare(arg1.getTotalDuration(), arg0.getTotalDuration());
} else {
result = Long.compare(arg0.getTotalDuration(), arg1.getTotalDuration());
}
return result;
return result;
}
}
......@@ -23,12 +23,18 @@ import org.eclipse.swt.SWT;
public class ExecutionDurationComparator extends AbstractDirectedComparator<Execution> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final Execution arg0, final Execution arg1) {
int result = Long.compare(arg0.getDuration(), arg1.getDuration());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = Long.compare(arg1.getTraceID(), arg0.getTraceID());
} else {
result = Long.compare(arg0.getTraceID(), arg1.getTraceID());
}
return result;
}
......
......@@ -23,14 +23,19 @@ import org.eclipse.swt.SWT;
public class ExecutionTraceIDComparator extends AbstractDirectedComparator<Execution> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final Execution arg0, final Execution arg1) {
int result = Long.compare(arg0.getTraceID(), arg1.getTraceID());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = Long.compare(arg1.getTraceID(), arg0.getTraceID());
} else {
result = Long.compare(arg0.getTraceID(), arg1.getTraceID());
}
return result;
return result;
}
}
......@@ -16,9 +16,12 @@
package kieker.gui.subview.util;
import java.io.Serializable;
import java.util.Comparator;
public abstract class AbstractDirectedComparator<T> implements Comparator<T> {
public abstract class AbstractDirectedComparator<T> implements Comparator<T>, Serializable {
private static final long serialVersionUID = 1L;
private int direction;
......
......@@ -22,12 +22,18 @@ import org.eclipse.swt.SWT;
public class ExecutionComponentComparator extends AbstractDirectedComparator<AbstractExecution<?>> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final AbstractExecution<?> fst, final AbstractExecution<?> snd) {
int result = fst.getComponent().compareTo(snd.getComponent());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = snd.getComponent().compareTo(fst.getComponent());
} else {
result = fst.getComponent().compareTo(snd.getComponent());
}
return result;
}
......
......@@ -22,12 +22,18 @@ import org.eclipse.swt.SWT;
public class ExecutionContainerComparator extends AbstractDirectedComparator<AbstractExecution<?>> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final AbstractExecution<?> fst, final AbstractExecution<?> snd) {
int result = fst.getContainer().compareTo(snd.getContainer());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = snd.getComponent().compareTo(fst.getComponent());
} else {
result = fst.getComponent().compareTo(snd.getComponent());
}
return result;
}
......
......@@ -22,12 +22,18 @@ import org.eclipse.swt.SWT;
public class ExecutionOperationComparator extends AbstractDirectedComparator<AbstractExecution<?>> {
private static final long serialVersionUID = 1L;
@Override
public int compare(final AbstractExecution<?> fst, final AbstractExecution<?> snd) {
int result = fst.getOperation().compareTo(snd.getOperation());
int result;
if (this.getDirection() == SWT.UP) {
result = -result;
result = snd.getComponent().compareTo(fst.getComponent());
} else {
result = fst.getComponent().compareTo(snd.getComponent());
}
return result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment