Bug 269972 - Hide-Classpath-Packages does not mask Package versions
Hide-Classpath-Packages does not mask Package versions
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Module System
Dev
PC Linux
: P1 (vote)
: Dev
Assigned To: Tomas Hurka
issues@platform
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-03 09:48 UTC by Svata Dedic
Modified: 2017-03-10 02:55 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
Proposed fix (913 bytes, patch)
2017-03-03 09:48 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svata Dedic 2017-03-03 09:48:46 UTC
Created attachment 163752 [details]
Proposed fix

OpenIDE-Module-Hide-Classpath-Packages hides resources from the enumerated (sub)packages from the app classloader. But when searching for Package version, the exclusion does not work. Resources from JDK are filtered out, but Package objects, incl. their 'sealed' property are not.

In JDK9, modules have sealed packages, and if javac implementation from JDK loads before NB javac' implementation for some reason (e.g. jshell :)), NetBeans classloader will throw SecurityException when it attempts to lead nb-javac code.

The attached patch should make the check for package objects evaluate the same way as for resources within that package. Please review.
Comment 1 Tomas Hurka 2017-03-07 09:09:26 UTC
The patch looks fine and it can be integrated.
Comment 2 Svata Dedic 2017-03-07 12:09:05 UTC
Fixed in jet-main#fd0ef30f1b1b
Comment 3 Quality Engineering 2017-03-10 02:55:02 UTC
Integrated into 'main-silver', will be available in build *201703100002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/fd0ef30f1b1b
User: Svata Dedic <sdedic@netbeans.org>
Log: #269972: Package declarations filtered accordin to Hide-Classpath-Packages


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo