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

Fixed some issues for the quality tools

parent b24a399e
No related branches found
No related tags found
No related merge requests found
Showing
with 65 additions and 27 deletions
......@@ -16,6 +16,7 @@
package kieker.diagnosis.common.model.importer.stages;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
......@@ -74,13 +75,7 @@ final class LegacyTraceReconstructor extends AbstractStage<OperationExecutionRec
}
public Trace reconstructTrace() {
Collections.sort(this.records, new Comparator<OperationExecutionRecord>() {
@Override
public int compare(final OperationExecutionRecord o1, final OperationExecutionRecord o2) {
return Long.compare(o1.getEoi(), o2.getEoi());
}
});
Collections.sort(this.records, new EOIComparator());
OperationCall root = null;
OperationCall header = null;
......@@ -114,6 +109,17 @@ final class LegacyTraceReconstructor extends AbstractStage<OperationExecutionRec
return this.traceComplete;
}
private static final class EOIComparator implements Comparator<OperationExecutionRecord>, Serializable {
private static final long serialVersionUID = 1L;
@Override
public int compare(final OperationExecutionRecord o1, final OperationExecutionRecord o2) {
return Long.compare(o1.getEoi(), o2.getEoi());
}
}
}
}
/***************************************************************************
* Copyright 2014 Kieker Project (http://kieker-monitoring.net)
*
* 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.diagnosis.common.model.importer.stages;
import java.util.ArrayList;
......
/***************************************************************************
* Copyright 2014 Kieker Project (http://kieker-monitoring.net)
*
* 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.diagnosis.common.util;
import java.util.HashMap;
......@@ -5,18 +21,18 @@ import java.util.Map;
public final class Mapper<I, O> {
private final Map<I, O> map = new HashMap<>();
private final Map<I, O> internalMap = new HashMap<>();
public To map(final I key) {
return new To(key);
}
public O resolve(final I key) {
return this.map.get(key);
return this.internalMap.get(key);
}
public I invertedResolve(final O value) {
for (final Map.Entry<I, O> entry : this.map.entrySet()) {
for (final Map.Entry<I, O> entry : this.internalMap.entrySet()) {
if (value.equals(entry.getValue())) {
return entry.getKey();
}
......@@ -28,12 +44,12 @@ public final class Mapper<I, O> {
private final I key;
private To(final I key) {
To(final I key) {
this.key = key;
}
public void to(final O value) {
Mapper.this.map.put(this.key, value);
Mapper.this.internalMap.put(this.key, value);
}
}
......
......@@ -5,7 +5,7 @@
* 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
* 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,
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class AverageDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class AverageDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class CallsSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class CallsSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class ComponentSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class ComponentSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class ContainerSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class ContainerSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class MaximalDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class MaximalDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class MedianDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class MedianDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class MinimalDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class MinimalDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class OperationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class OperationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.aggregatedcalls.util;
import kieker.diagnosis.common.domain.AggregatedOperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class TotalDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
public final class TotalDurationSortListener extends AbstractCallTableColumnSortListener<AggregatedOperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.calls.util;
import kieker.diagnosis.common.domain.OperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class ComponentSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
public final class ComponentSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.calls.util;
import kieker.diagnosis.common.domain.OperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class ContainerSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
public final class ContainerSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.calls.util;
import kieker.diagnosis.common.domain.OperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class DurationSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
public final class DurationSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.calls.util;
import kieker.diagnosis.common.domain.OperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class OperationSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
public final class OperationSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ package kieker.diagnosis.subview.calls.util;
import kieker.diagnosis.common.domain.OperationCall;
import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
public class TraceIDSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
public final class TraceIDSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
private static final long serialVersionUID = 1L;
......
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