summaryrefslogtreecommitdiff
path: root/jurt/com/sun/star/lib
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-15 14:43:35 +0200
committerNoel Grandin <noel@peralex.com>2014-10-16 08:15:48 +0200
commit973eb2f6db60c0939299a968a3121e3310e6d1f5 (patch)
tree9eece355c20bc4d930e7e58943fc2d33bedfcfd0 /jurt/com/sun/star/lib
parentfa652cdd2314f485359119a8ff081a7afd1c01b0 (diff)
java: reduce the depth of some deeply nested if blocks
Change-Id: I3c0c7f08d4d8ea594e72fc0d9b93d085d4ab4bf5
Diffstat (limited to 'jurt/com/sun/star/lib')
-rw-r--r--jurt/com/sun/star/lib/util/NativeLibraryLoader.java39
1 files changed, 20 insertions, 19 deletions
diff --git a/jurt/com/sun/star/lib/util/NativeLibraryLoader.java b/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
index 099cf69d1881..d9486550855e 100644
--- a/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -89,33 +89,34 @@ public final class NativeLibraryLoader {
// (scheme://auth/dir1/name). The second step is important in a typical
// OOo installation, where the JAR files are in the program/classes
// directory while the shared libraries are in the program directory.
- if (loader instanceof URLClassLoader) {
- URL[] urls = ((URLClassLoader) loader).getURLs();
- for (int i = 0; i < urls.length; ++i) {
- File path = UrlToFileMapper.mapUrlToFile(urls[i]);
- if (path != null) {
- File dir = path.isDirectory() ? path : path.getParentFile();
+ if (!(loader instanceof URLClassLoader)) {
+ return null;
+ }
+ URL[] urls = ((URLClassLoader) loader).getURLs();
+ for (int i = 0; i < urls.length; ++i) {
+ File path = UrlToFileMapper.mapUrlToFile(urls[i]);
+ if (path != null) {
+ File dir = path.isDirectory() ? path : path.getParentFile();
+ if (dir != null) {
+ path = new File(dir, name);
+ if (path.exists()) {
+ return path;
+ }
+ dir = dir.getParentFile();
if (dir != null) {
path = new File(dir, name);
if (path.exists()) {
return path;
}
- dir = dir.getParentFile();
- if (dir != null) {
- path = new File(dir, name);
+ // On OS X, dir is now the Resources dir,
+ // we want to look in Frameworks
+ if (System.getProperty("os.name").startsWith("Mac")
+ && dir.getName().equals("Resources")) {
+ dir = dir.getParentFile();
+ path = new File(dir, "Frameworks/" + name);
if (path.exists()) {
return path;
}
- // On OS X, dir is now the Resources dir,
- // we want to look in Frameworks
- if (System.getProperty("os.name").startsWith("Mac")
- && dir.getName().equals("Resources")) {
- dir = dir.getParentFile();
- path = new File(dir, "Frameworks/" + name);
- if (path.exists()) {
- return path;
- }
- }
}
}
}