8245623: Remove unused code in sun/nio/fs after Solaris removal

Reviewed-by: alanb
This commit is contained in:
Claes Redestad 2020-05-22 14:21:30 +02:00
parent de37507b8e
commit b2269be8db
4 changed files with 3 additions and 23 deletions

View file

@ -103,16 +103,6 @@ class UnixChannelFactory {
}
}
/**
* Constructs a file channel from an existing (open) file descriptor
*/
static FileChannel newFileChannel(int fd, String path, boolean reading, boolean writing) {
FileDescriptor fdObj = new FileDescriptor();
fdAccess.set(fdObj, fd);
return FileChannelImpl.open(fdObj, path, reading, writing, false, null);
}
/**
* Constructs a file channel by opening a file using a dfd/path pair
*/

View file

@ -100,11 +100,6 @@ class UnixException extends Exception {
return new FileSystemException(file, other, errorString());
}
void rethrowAsIOException(String file) throws IOException {
IOException x = translateToIOException(file, null);
throw x;
}
void rethrowAsIOException(UnixPath file, UnixPath other) throws IOException {
String a = (file == null) ? null : file.getPathForExceptionMessage();
String b = (other == null) ? null : other.getPathForExceptionMessage();

View file

@ -34,7 +34,6 @@ import java.util.concurrent.ExecutorService;
import java.io.IOException;
import java.io.FilePermission;
import java.util.*;
import java.security.AccessController;
import sun.nio.ch.ThreadPool;
import sun.security.util.SecurityConstants;

View file

@ -67,10 +67,6 @@ class UnixUserPrincipals {
throw new AssertionError();
}
boolean isSpecial() {
return id == -1;
}
@Override
public String getName() {
return name;
@ -113,7 +109,7 @@ class UnixUserPrincipals {
// return UserPrincipal representing given uid
static User fromUid(int uid) {
String name = null;
String name;
try {
name = Util.toString(getpwuid(uid));
} catch (UnixException x) {
@ -124,7 +120,7 @@ class UnixUserPrincipals {
// return GroupPrincipal representing given gid
static Group fromGid(int gid) {
String name = null;
String name;
try {
name = Util.toString(getgrgid(gid));
} catch (UnixException x) {
@ -141,7 +137,7 @@ class UnixUserPrincipals {
if (sm != null) {
sm.checkPermission(new RuntimePermission("lookupUserInformation"));
}
int id = -1;
int id;
try {
id = (isGroup) ? getgrnam(name) : getpwnam(name);
} catch (UnixException x) {