From ad5f628c58c46438f2f542d5255e5fd1fa4d0c6b Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Thu, 11 Aug 2022 06:24:04 +0000 Subject: [PATCH] 8292140: (fs) Needless instanceof check in RegistryFileTypeDetector Reviewed-by: alanb --- .../classes/sun/nio/fs/RegistryFileTypeDetector.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/java.base/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java b/src/java.base/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java index 64f08aaa318..132db03c7e9 100644 --- a/src/java.base/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java +++ b/src/java.base/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java @@ -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. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ package sun.nio.fs; -import java.nio.file.*; +import java.nio.file.Path; import java.io.IOException; /** @@ -41,9 +41,6 @@ public class RegistryFileTypeDetector @Override public String implProbeContentType(Path file) throws IOException { - if (!(file instanceof Path)) - return null; - // get file extension Path name = file.getFileName(); if (name == null)