From 4cd87f1bdab759ab7792afdcf644a6c3d21d51df Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Wed, 11 Jan 2023 15:14:41 +0000 Subject: [PATCH] 8299835: (jrtfs) Unnecessary null check in JrtPath.getAttributes Reviewed-by: alanb, lancea --- .../share/classes/jdk/internal/jrtfs/JrtPath.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java b/src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java index 663e30cb0c5..5010b653ee6 100644 --- a/src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java +++ b/src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, 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 @@ -649,11 +649,7 @@ final class JrtPath implements Path { } final JrtFileAttributes getAttributes(LinkOption... options) throws IOException { - JrtFileAttributes zfas = jrtfs.getFileAttributes(this, options); - if (zfas == null) { - throw new NoSuchFileException(toString()); - } - return zfas; + return jrtfs.getFileAttributes(this, options); } final void setAttribute(String attribute, Object value, LinkOption... options)