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

PMD and Checkstyle issues

parent ddeb7e47
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ subprojects {
ruleSets = []
ruleSetFiles = files('../kieker-trace-diagnosis-release-engineering/config/pmd/ruleset.xml')
toolVersion = '5.3.3'
toolVersion = '5.5.4'
}
apply plugin: 'checkstyle'
......
......@@ -95,4 +95,4 @@ class FilterContent {
ivFilterException = aFilterException;
}
}
\ No newline at end of file
}
......@@ -133,4 +133,4 @@ class FilterContent {
ivShowJustSuccessful = aShowJustSuccessful;
}
}
\ No newline at end of file
}
......@@ -142,4 +142,4 @@ class FilterContent {
ivShowJustFailureContainingButton = aShowJustFailureContainingButton;
}
}
\ No newline at end of file
}
......@@ -91,6 +91,18 @@ final class TraceReconstructor extends AbstractTransformation<IFlowRecord, Trace
}
}
protected boolean isActivateAdditionalLogChecks( ) {
return ivActivateAdditionalLogChecks;
}
protected Map<Long, TraceBuffer> getTraceBuffers( ) {
return ivTraceBuffers;
}
protected List<TraceBuffer> getFaultyTraceBuffers( ) {
return ivFaultyTraceBuffers;
}
/**
* @author Nils Christian Ehmke
*/
......@@ -139,9 +151,9 @@ final class TraceReconstructor extends AbstractTransformation<IFlowRecord, Trace
ivHeader = ivHeader.getParent( );
if ( ivActivateAdditionalLogChecks && !beforeEvent.getOperationSignature( ).equals( aRecord.getOperationSignature( ) ) ) {
ivFaultyTraceBuffers.add( this );
ivTraceBuffers.remove( ivTraceID );
if ( isActivateAdditionalLogChecks( ) && !beforeEvent.getOperationSignature( ).equals( aRecord.getOperationSignature( ) ) ) {
getFaultyTraceBuffers( ).add( this );
getTraceBuffers( ).remove( ivTraceID );
}
}
......
......@@ -65,7 +65,7 @@ public final class FilterService implements ServiceIfc {
if ( caseSensitivityActive ) {
return x -> aFunction.apply( x ).contains( text );
} else {
return x -> aFunction.apply( x ).toLowerCase( ).contains( text.toLowerCase( Locale.getDefault( ) ) );
return x -> aFunction.apply( x ).toLowerCase( Locale.getDefault( ) ).contains( text.toLowerCase( Locale.getDefault( ) ) );
}
}
}
......@@ -111,7 +111,8 @@ public final class FilterService implements ServiceIfc {
if ( value == null ) {
return x -> true;
}
final Predicate<T> result = x -> {
return x -> {
final long timestamp = aFunction.apply( x );
final long timestampInMS = TimeUnit.MILLISECONDS.convert( timestamp, ivPropertiesService.loadProperty( TimeUnitProperty.class ) );
final Instant instant = Instant.ofEpochMilli( timestampInMS );
......@@ -123,8 +124,6 @@ public final class FilterService implements ServiceIfc {
return value.isAfter( localDate ) || value.isEqual( localDate );
}
};
return result;
}
public <T extends AbstractOperationCall<T>> Predicate<T> useFilter( final DatePicker aDatePicker, final Function<T, Long> aFunction,
......@@ -158,7 +157,7 @@ public final class FilterService implements ServiceIfc {
if ( value == null ) {
return x -> true;
}
final Predicate<T> result = x -> {
return x -> {
final long timestamp = aFunction.apply( x );
final long timestampInMS = TimeUnit.MILLISECONDS.convert( timestamp, ivPropertiesService.loadProperty( TimeUnitProperty.class ) );
final Instant instant = Instant.ofEpochMilli( timestampInMS );
......@@ -200,8 +199,6 @@ public final class FilterService implements ServiceIfc {
return true;
}
};
return result;
}
public <T> Predicate<T> useFilter( final RadioButton aShowAllButton, final RadioButton aShowJustSuccessfulButton, final RadioButton aShowJustFailedButton,
......
......@@ -70,6 +70,10 @@ public final class Mapper<I, O> extends HashMap<I, O> {
return entrySet( ).parallelStream( ).filter( entry -> aValue.equals( entry.getValue( ) ) ).map( Map.Entry::getKey ).findFirst( ).orElse( null );
}
protected void setDefaultValue( final O aDefaultValue ) {
ivDefaultValue = aDefaultValue;
}
/**
* This is an internal helper class for the fluent API.
*
......@@ -94,7 +98,7 @@ public final class Mapper<I, O> extends HashMap<I, O> {
if ( ivKeyAvailable ) {
put( ivKey, aValue );
} else {
ivDefaultValue = aValue;
setDefaultValue( aValue );
}
}
......
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