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

Fixed some Checkstyle issues

parent d454e8c8
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
*/
public final class LazyOperationCallTreeItem extends AbstractLazyOperationCallTreeItem<OperationCall> {
private static final String BLANK = "-";
private static final String METHOD_CALLS_AGGREGATED;
private static final String UNMONITORED_TIME;
......@@ -69,7 +70,7 @@ public final class LazyOperationCallTreeItem extends AbstractLazyOperationCallTr
duration -= child.getDuration( );
}
final OperationCall call = new OperationCall( "-", "-", UNMONITORED_TIME, getValue( ).getTraceID( ), getValue( ).getTimestamp( ) );
final OperationCall call = new OperationCall( BLANK, BLANK, UNMONITORED_TIME, getValue( ).getTraceID( ), getValue( ).getTimestamp( ) );
call.setPercent( (float) percent );
call.setDuration( duration );
result.add( new LazyOperationCallTreeItem( call ) );
......@@ -90,8 +91,8 @@ public final class LazyOperationCallTreeItem extends AbstractLazyOperationCallTr
final long duration = underThreshold.stream( ).map( OperationCall::getDuration ).collect( Collectors.summingLong( Long::longValue ) );
final int traceDepth = underThreshold.stream( ).map( OperationCall::getStackDepth ).max( Comparator.naturalOrder( ) ).get( );
final int traceSize = underThreshold.stream( ).map( OperationCall::getStackSize ).collect( Collectors.summingInt( Integer::intValue ) );
final OperationCall call = new OperationCall( "-", "-", underThreshold.size( ) + " " + LazyOperationCallTreeItem.METHOD_CALLS_AGGREGATED,
getValue( ).getTraceID( ), -1 );
final OperationCall call = new OperationCall( BLANK, BLANK, underThreshold.size( ) + " " + METHOD_CALLS_AGGREGATED, getValue( ).getTraceID( ),
-1 );
call.setPercent( (float) percent );
call.setDuration( duration );
call.setStackDepth( traceDepth );
......
......@@ -41,6 +41,7 @@ import java.io.File;
import java.util.List;
import java.util.Optional;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.control.Button;
......@@ -211,15 +212,12 @@ public class MainController extends AbstractController<MainView> {
final Button removeButton = new Button( "-" );
removeButton.setPrefWidth( 20 );
removeButton.setOnAction( event -> {
getView( ).getLeftButtonBox( ).getChildren( ).remove( hbox );
final ObservableList<Node> children = getView( ).getLeftButtonBox( ).getChildren( );
children.remove( hbox );
ivFavoritesAvailable--;
if ( ivFavoritesAvailable == 0 ) {
final Optional<Node> first = getView( ).getLeftButtonBox( ).getChildren( ).stream( ).filter( node -> node instanceof Separator )
.findFirst( );
if ( first.isPresent( ) ) {
getView( ).getLeftButtonBox( ).getChildren( ).remove( first.get( ) );
}
children.stream( ).filter( node -> node instanceof Separator ).findFirst( ).ifPresent( children::remove );
}
} );
hbox.getChildren( ).add( removeButton );
......
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