Skip to content

Commit

Permalink
8251466: test/java/io/File/GetXSpace.java fails on Windows with mappe…
Browse files Browse the repository at this point in the history
…d network drives.

Backport-of: 178ac7465360729628521a0d555253b9fb2ad7bf
  • Loading branch information
MBaesken committed Oct 13, 2022
1 parent 96a5e40 commit 58b4363
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/jdk/java/io/File/GetXSpace.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -34,7 +34,6 @@

import java.io.BufferedReader;
import java.io.File;
import java.io.FilePermission;
import java.io.InputStreamReader;
import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -108,8 +107,8 @@ private static class Space {

Space(String total, String free, String name) {
try {
this.total = Long.valueOf(total) * KSIZE;
this.free = Long.valueOf(free) * KSIZE;
this.total = Long.parseLong(total) * KSIZE;
this.free = Long.parseLong(free) * KSIZE;
} catch (NumberFormatException x) {
throw new RuntimeException("the regex should have caught this", x);
}
Expand Down Expand Up @@ -157,7 +156,7 @@ private static ArrayList<Space> space(String f) throws IOException {
}
al.add(new Space(m.group(2), m.group(3), name));;
}
j = m.end() + 1;
j = m.end();
} else {
throw new RuntimeException("unrecognized df output format: "
+ "charAt(" + j + ") = '"
Expand Down Expand Up @@ -227,7 +226,7 @@ private static void compare(Space s) {
// On Linux, ignore the NSFE if the path is one of the
// /run/user/$UID mounts created by pam_systemd(8) as it
// might be deleted during the test
if (!Platform.isLinux() || s.name().indexOf("/run/user") == -1)
if (!Platform.isLinux() || !s.name().contains("/run/user"))
throw new RuntimeException(nsfe);
} catch (IOException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit 58b4363

Please sign in to comment.