Polish ternary expressions
This commit is contained in:
@@ -304,7 +304,7 @@ public class PropertiesLauncher extends Launcher {
|
||||
for (String path : commaSeparatedPaths.split(",")) {
|
||||
path = cleanupPath(path);
|
||||
// "" means the user wants root of archive but not current directory
|
||||
path = ("".equals(path) ? "/" : path);
|
||||
path = "".equals(path) ? "/" : path;
|
||||
paths.add(path);
|
||||
}
|
||||
if (paths.isEmpty()) {
|
||||
|
||||
@@ -124,8 +124,8 @@ public class Handler extends URLStreamHandler {
|
||||
|
||||
private void log(boolean warning, String message, Exception cause) {
|
||||
try {
|
||||
Logger.getLogger(getClass().getName())
|
||||
.log((warning ? Level.WARNING : Level.FINEST), message, cause);
|
||||
Level level = warning ? Level.WARNING : Level.FINEST;
|
||||
Logger.getLogger(getClass().getName()).log(level, message, cause);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
if (warning) {
|
||||
|
||||
@@ -214,7 +214,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
|
||||
@Override
|
||||
public Object getContent() throws IOException {
|
||||
connect();
|
||||
return (this.jarEntryName.isEmpty() ? this.jarFile : super.getContent());
|
||||
return this.jarEntryName.isEmpty() ? this.jarFile : super.getContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -386,7 +386,7 @@ final class JarURLConnection extends java.net.JarURLConnection {
|
||||
|
||||
private String deduceContentType() {
|
||||
// Guess the content type, don't bother with streams as mark is not supported
|
||||
String type = (isEmpty() ? "x-java/jar" : null);
|
||||
String type = isEmpty() ? "x-java/jar" : null;
|
||||
type = (type != null) ? type : guessContentTypeFromName(toString());
|
||||
type = (type != null) ? type : "content/unknown";
|
||||
return type;
|
||||
|
||||
Reference in New Issue
Block a user