Skip to content

Commit

Permalink
Fixing warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Aug 28, 2021
1 parent 55442a7 commit bd18be5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/luwrain/app/commander/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum Side {LEFT, RIGHT};

final String startFrom;

final List<Operation> operations = new ArrayList();
final List<Operation> operations = new ArrayList<>();
final OperationListener opListener = newOperationListener();
private Settings sett = null;
private Conversations conv = null;
Expand Down Expand Up @@ -67,7 +67,7 @@ void runOperation(Operation op)
{
NullCheck.notNull(op, "op");
this.operations.add(0, op);
getLuwrain().executeBkg(new FutureTask(op, null));
getLuwrain().executeBkg(new FutureTask<>(op, null));
}

boolean allOperationsFinished()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/luwrain/app/commander/Conversations.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class Conversations
{
private final Luwrain luwrain;
private final Strings strings;
private final Set<String> runHistory = new TreeSet();
private final Set<String> runHistory = new TreeSet<>();

Conversations(App app)
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/luwrain/app/commander/FileActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ boolean localMail(PanelArea panelArea)
app.message("Невозможно отправить по почте каталог", Luwrain.MessageType.ERROR);//FIXME:
return true;
}
final List<String> files = new ArrayList();
final List<String> files = new ArrayList<>();
for(Path p: toProcess)
files.add(p.toAbsolutePath().toString());
final Message message = new Message();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/luwrain/app/commander/MainLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class MainLayout extends LayoutBase
this.app = app;
this.fileActions = new FileActions(app);

final CommanderArea.Params params = PanelArea.createParams(getControlContext());
final CommanderArea.Params<FileObject> params = PanelArea.createParams(getControlContext());
params.clickHandler = this::onClick;

this.leftPanel = new PanelArea(params, getLuwrain()) {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/luwrain/app/commander/PanelArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ boolean runHookOnFilesToProcess(String hookPrefix, boolean background)
return true;
return new ChainOfResponsibilityHook(luwrain).runNoExcept(hookName, new Object[]{arg});
}
luwrain.executeBkg(new FutureTask(()->{
luwrain.executeBkg(new FutureTask<>(()->{
if (new ChainOfResponsibilityHook(luwrain).runNoExcept(hookName + ".custom", new Object[]{arg}))
return;
new ChainOfResponsibilityHook(luwrain).runNoExcept(hookName, new Object[]{arg});
Expand All @@ -135,7 +135,7 @@ boolean isLocalDir()

FileObject[] getToProcess()
{
final List<FileObject> res = new ArrayList();
final List<FileObject> res = new ArrayList<>();
for(Object o: getMarked())
res.add((FileObject)o);
if (!res.isEmpty())
Expand Down Expand Up @@ -223,7 +223,7 @@ URL asUrl(FileObject fileObject)
static Path[] asPath(FileObject[] fileObjects)
{
NullCheck.notNullItems(fileObjects, "fileObjects");
final List<Path> res = new ArrayList();
final List<Path> res = new ArrayList<>();
for(FileObject f: fileObjects)
{
final Path ff = asPath(f);
Expand All @@ -236,7 +236,7 @@ static Path[] asPath(FileObject[] fileObjects)
static File[] asFile(FileObject[] fileObjects)
{
NullCheck.notNullItems(fileObjects, "fileObjects");
final List<File> res = new ArrayList();
final List<File> res = new ArrayList<>();
for(FileObject f: fileObjects)
{
final File ff = asFile(f);
Expand All @@ -261,8 +261,8 @@ static Params<FileObject> createParams(ControlContext controlContext)
final int count = model.getItemCount();
if (fromIndex >= toIndex || fromIndex >= count || toIndex > count)
return false;
final List<String> names = new ArrayList();
final List<Serializable> res = new ArrayList();
final List<String> names = new ArrayList<>();
final List<Serializable> res = new ArrayList<>();
for(int i = fromIndex;i < toIndex;++i)
{
final CommanderArea.NativeItem<FileObject> nativeObj = (CommanderArea.NativeItem<FileObject>)model.getItem(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static protected boolean isDirectory(Path path, boolean followSymlinks) throws I

static protected Path[] getDirContent(final Path path) throws IOException
{
final List<Path> res = new ArrayList();
final List<Path> res = new ArrayList<>();
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path)) {
for (Path p : directoryStream)
res.add(p);
Expand Down

0 comments on commit bd18be5

Please sign in to comment.