|
1 | 1 | /* |
2 | | - * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
34 | 34 |
|
35 | 35 | import java.io.BufferedReader; |
36 | 36 | import java.io.File; |
37 | | -import java.io.FilePermission; |
38 | 37 | import java.io.InputStreamReader; |
39 | 38 | import java.io.IOException; |
40 | 39 | import java.nio.file.Files; |
@@ -108,8 +107,8 @@ private static class Space { |
108 | 107 |
|
109 | 108 | Space(String total, String free, String name) { |
110 | 109 | try { |
111 | | - this.total = Long.valueOf(total) * KSIZE; |
112 | | - this.free = Long.valueOf(free) * KSIZE; |
| 110 | + this.total = Long.parseLong(total) * KSIZE; |
| 111 | + this.free = Long.parseLong(free) * KSIZE; |
113 | 112 | } catch (NumberFormatException x) { |
114 | 113 | throw new RuntimeException("the regex should have caught this", x); |
115 | 114 | } |
@@ -157,7 +156,7 @@ private static ArrayList<Space> space(String f) throws IOException { |
157 | 156 | } |
158 | 157 | al.add(new Space(m.group(2), m.group(3), name));; |
159 | 158 | } |
160 | | - j = m.end() + 1; |
| 159 | + j = m.end(); |
161 | 160 | } else { |
162 | 161 | throw new RuntimeException("unrecognized df output format: " |
163 | 162 | + "charAt(" + j + ") = '" |
@@ -227,7 +226,7 @@ private static void compare(Space s) { |
227 | 226 | // On Linux, ignore the NSFE if the path is one of the |
228 | 227 | // /run/user/$UID mounts created by pam_systemd(8) as it |
229 | 228 | // might be deleted during the test |
230 | | - if (!Platform.isLinux() || s.name().indexOf("/run/user") == -1) |
| 229 | + if (!Platform.isLinux() || !s.name().contains("/run/user")) |
231 | 230 | throw new RuntimeException(nsfe); |
232 | 231 | } catch (IOException e) { |
233 | 232 | throw new RuntimeException(e); |
|
0 commit comments