Skip to content

Commit

Permalink
8304367: jlink --include-locales=* attempts to parse non .class resou…
Browse files Browse the repository at this point in the history
…rce files with classfile reader

Reviewed-by: mchung, lancea, jpai
  • Loading branch information
naotoj committed Mar 17, 2023
1 parent 8d2ebf2 commit 4486f1b
Showing 1 changed file with 3 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
Expand Down Expand Up @@ -156,7 +156,8 @@ public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out) {
String path = resource.path();
resource = predicate.test(path) ? resource: null;
if (resource != null &&
resource.type().equals(ResourcePoolEntry.Type.CLASS_OR_RESOURCE)) {
resource.type().equals(ResourcePoolEntry.Type.CLASS_OR_RESOURCE) &&
path.endsWith(".class")) {
byte[] bytes = resource.contentBytes();
ClassReader cr = newClassReader(path, bytes);
if (Arrays.stream(cr.getInterfaces())
Expand Down

1 comment on commit 4486f1b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.