Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mantis runtime compile warn fix #468

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@

package io.mantisrx.runtime.command;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not use star imports.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

Expand Down Expand Up @@ -54,7 +49,9 @@ private void readBytesFromFile(File file, ZipOutputStream os) throws CommandExce
throw new CommandException(e);
} finally {
try {
Objects.requireNonNull(is).close();
if (is != null) {
is.close();
}
} catch (IOException e) {
throw new CommandException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@

import io.mantisrx.runtime.Job;
import java.io.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class LoadValidateCreateDir implements Command {

private static final Logger logger = LoggerFactory.getLogger(LoadValidateCreateDir.class);

private final String jarPath;

public LoadValidateCreateDir(String jarPath) {
Expand Down Expand Up @@ -88,7 +92,7 @@ public void execute() throws CommandException {
File jobDescriptor = new File(fileLoop.getParent() + "/" + jsonFile);
new CreateJobDescriptorFile(job, jobDescriptor, fileVersion, fileBase).execute();
} catch (Exception e) {
System.out.println("Got an error " + e.getMessage());
logger.error("Got an error " + e.getMessage());
System.exit(1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public Observable<Void> handle(HttpServerRequest<ByteBuf> request,

// decouple the observable on a separate thread and add backpressure handling
String decoupleSSE = "false";//ServiceRegistry.INSTANCE.getPropertiesService().getStringValue("sse.decouple", "false");
//Note: Below condition would be always false during if condition.
//Todo Note: Below condition would be always false during if condition.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the syntax for a TODO comment. https://www.jetbrains.com/help/idea/using-todo.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

if ("true".equals(decoupleSSE)) {
final BasicTag sockAddrTag = new BasicTag("sockAddr", Optional.ofNullable(socketAddrStr).orElse("none"));
requestObservable = requestObservable
Expand Down Expand Up @@ -214,7 +214,7 @@ public Observable<Void> handle(HttpServerRequest<ByteBuf> request,
if (queryParameters != null && queryParameters.containsKey(ENABLE_PINGS_PARAM)) {
// enablePings
String enablePings = queryParameters.get(ENABLE_PINGS_PARAM).get(0);
//Code logic can be improved here.
//Todo Note: Code logic can be improved here.
if ("true".equalsIgnoreCase(enablePings)) {
pingsEnabled = true;
} else {
Expand Down
Loading