From 5aa088866c46050f496798c46509755d2762c7b2 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 24 Mar 2017 20:13:15 +0100 Subject: [PATCH] Cleanup (formatting) --- .../org/jetbrains/jps/util/JpsPathUtil.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/jps/model-api/src/org/jetbrains/jps/util/JpsPathUtil.java b/jps/model-api/src/org/jetbrains/jps/util/JpsPathUtil.java index bd57584d8e1d..8cd9a88219a9 100644 --- a/jps/model-api/src/org/jetbrains/jps/util/JpsPathUtil.java +++ b/jps/model-api/src/org/jetbrains/jps/util/JpsPathUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,16 +71,17 @@ public class JpsPathUtil { //todo[nik] copied from VfsUtil @NotNull - public static String fixURLforIDEA(@NotNull String url ) { + public static String fixURLforIDEA(@NotNull String url) { int idx = url.indexOf(":/"); - if( idx >= 0 && idx+2 < url.length() && url.charAt(idx+2) != '/' ) { + if (idx >= 0 && idx + 2 < url.length() && url.charAt(idx + 2) != '/') { String prefix = url.substring(0, idx); - String suffix = url.substring(idx+2); + String suffix = url.substring(idx + 2); if (SystemInfoRt.isWindows) { - url = prefix+"://"+suffix; - } else { - url = prefix+":///"+suffix; + url = prefix + "://" + suffix; + } + else { + url = prefix + ":///" + suffix; } } return url; @@ -92,9 +93,6 @@ public class JpsPathUtil { public static String getLibraryRootUrl(File file) { String path = FileUtilRt.toSystemIndependentName(file.getAbsolutePath()); - if (file.isDirectory()) { - return "file://" + path; - } - return "jar://" + path + "!/"; + return file.isDirectory() ? "file://" + path : "jar://" + path + "!/"; } -} +} \ No newline at end of file