Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Fix minor warnings courtesy of IDE

AuthorDaveJarvis <email>
Date2021-12-05 23:23:04 GMT-0800
Commite0f954ccbe60e1aab442f1952bd24162dc2a59db
Parenta8d62f2
Delta6 lines added, 5 lines removed, 1-line increase
src/main/java/com/keenwrite/ui/explorer/FilesView.java
package com.keenwrite.ui.explorer;
+import com.keenwrite.events.FileOpenEvent;
import com.keenwrite.ui.controls.BrowseButton;
import javafx.beans.property.*;
import java.util.List;
import java.util.Locale;
+import java.util.Objects;
import java.util.Optional;
import static com.keenwrite.constants.Constants.UI_CONTROL_SPACING;
-import static com.keenwrite.events.FileOpenEvent.fire;
import static com.keenwrite.events.StatusEvent.clue;
import static com.keenwrite.ui.fonts.IconFactory.createFileIcon;
}
- for( final var f : directory.list() ) {
+ for( final var f : Objects.requireNonNull( directory.list() ) ) {
if( !f.startsWith( "." ) ) {
mItems.add( pathEntry( Paths.get( directory.toString(), f ) ) );
mDirectory.addListener( ( c, o, n ) -> {
- if( n != null ) { field.setText( n.getAbsolutePath() ); }
+ if( n != null ) {field.setText( n.getAbsolutePath() );}
} );
if( file.isFile() ) {
- fire( path.toUri() );
+ FileOpenEvent.fire( path.toUri() );
}
else if( file.isDirectory() ) {
private final StringProperty mTime;
- protected PathEntry( final Path path ) throws IOException {
+ private PathEntry( final Path path ) throws IOException {
this(
path,