This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 267830 - [jshell] Eliminate implementation dependencies
Summary: [jshell] Eliminate implementation dependencies
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JShell (show other bugs)
Version: 8.2
Hardware: PC Linux
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2016-09-02 06:29 UTC by Jaroslav Tulach
Modified: 2016-12-14 12:42 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A naive attempt to remove implementation dependencies (16.54 KB, patch)
2016-09-02 06:35 UTC, Jaroslav Tulach
Details | Diff
Removing dependency on Hacks (4.05 KB, patch)
2016-09-02 06:49 UTC, Jaroslav Tulach
Details | Diff
Eliminating ClasspathInfoProvider (3.42 KB, patch)
2016-09-02 06:57 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2016-09-02 06:29:05 UTC
I tried to install NBMs for JShell in current development version and it failed:

Some plugins require plugin Editor Library 2 to be installed.          
The plugin Editor Library 2 is requested in implementation version 54.
The following plugin is affected:
      Java Shell Support     

Please eliminate implementation dependencies in Java Shell Support & co.
Comment 1 Jaroslav Tulach 2016-09-02 06:35:32 UTC
Created attachment 161872 [details]
A naive attempt to remove implementation dependencies
Comment 2 Jaroslav Tulach 2016-09-02 06:49:44 UTC
Created attachment 161873 [details]
Removing dependency on Hacks
Comment 3 Jaroslav Tulach 2016-09-02 06:57:21 UTC
Created attachment 161874 [details]
Eliminating ClasspathInfoProvider
Comment 4 Tomas Zezula 2016-09-02 08:20:58 UTC
The java.source patches (comment #2,  comment #3) seems good to me.
The patch from comment #1 should be review by someone who knows java.hints.
Comment 5 Jan Lahoda 2016-09-02 12:12:23 UTC
Sorry, but I don't think that opening the whole java.hints.legacy.spi for general public is a good idea. Many/most of the APIs have a better replacement in place, and I don't see a good reason for opening up the legacy.spi version of the APIs.
Comment 6 Svata Dedic 2016-09-02 12:22:03 UTC
The trouble is that the module already exports APIs and making jshell a friend (as is done in other cases) is not an option. Since JShell needs to implement an interace, refelection is also not an option. 

Some other idea ? Basically I need to suppress some messages in JShell and change others (I strip the location from messages (appear in error hint tooltips), since the user does not want to see the weird REPL.$JShel$xxx class names.
Comment 7 Jaroslav Tulach 2016-09-02 13:21:27 UTC
(In reply to Jan Lahoda from comment #5)
> Sorry, but I don't think that opening the whole java.hints.legacy.spi for
> general public is a good idea. Many/most of the APIs have a better
> replacement in place, and I don't see a good reason for opening up the
> legacy.spi version of the APIs.

Why jshell doesn't use the new APIs then? If jshell needs to use them, then they aren't as legacy as presented - thus I also changed the module display name. But I'll be of course completely fine with JShell using some other APIs.
Comment 8 Svata Dedic 2016-09-02 13:51:05 UTC
SourceUtils updated in jet-main#ac196d3963e7
Comment 9 Svata Dedic 2016-09-02 13:59:13 UTC
Classpathinfo.Provider patch fixed and applied as jet-main#6ee2ea2fd094
Comment 10 Svata Dedic 2016-09-02 15:24:39 UTC
OverrideErrorMessages made friend API of java.hints in jet-main#641e52c1be65
Comment 11 Quality Engineering 2016-09-04 01:57:07 UTC
Integrated into 'main-silver', will be available in build *201609040002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ac196d3963e7
User: Svata Dedic <sdedic@netbeans.org>
Log: #267830: exposed diagnostic parameters
Comment 12 Jaroslav Tulach 2016-09-16 06:43:26 UTC
Seems like it didn't happen in time for 8.2 RC1. JShell modules aren't listed as friends of javacimpl.
Comment 13 Quality Engineering 2016-09-20 02:37:24 UTC
Integrated into 'main-silver', will be available in build *201609200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5d86b515377d
User: Svata Dedic <sdedic@netbeans.org>
Log: #267830: added friend jshell
Comment 14 Svata Dedic 2016-10-07 08:47:37 UTC
Moving to an appropriate component
Comment 15 Svata Dedic 2016-11-23 08:58:06 UTC
Fixed as releases#e470eaf7831b
Comment 16 Jiri Prox 2016-12-14 12:42:30 UTC
verified