8292140: (fs) Needless instanceof check in RegistryFileTypeDetector

Reviewed-by: alanb
This commit is contained in:
Andrey Turbanov 2022-08-11 06:24:04 +00:00
parent 2ddf72874f
commit ad5f628c58

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,7 @@
package sun.nio.fs; package sun.nio.fs;
import java.nio.file.*; import java.nio.file.Path;
import java.io.IOException; import java.io.IOException;
/** /**
@ -41,9 +41,6 @@ public class RegistryFileTypeDetector
@Override @Override
public String implProbeContentType(Path file) throws IOException { public String implProbeContentType(Path file) throws IOException {
if (!(file instanceof Path))
return null;
// get file extension // get file extension
Path name = file.getFileName(); Path name = file.getFileName();
if (name == null) if (name == null)