Bug 544424 - Patching module shows errors in editor and sometimes does not compile the patched classes
Summary: Patching module shows errors in editor and sometimes does not compile the pat...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.11   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-13 14:59 EST by haasip satang CLA
Modified: 2023-05-08 12:11 EDT (History)
1 user (show)

See Also:


Attachments
Error markers in editor and package explorer (98.06 KB, image/jpeg)
2019-02-13 14:59 EST, haasip satang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description haasip satang CLA 2019-02-13 14:59:39 EST
Created attachment 277566 [details]
Error markers in editor and package explorer

I'm trying to create a patch for some classes in java.base. In pre Java9 releases this was as easy as compiling the class and prepending to the bootstrap classpath. Also worked in Eclipse with no issues. 

With JEP261 (http://openjdk.java.net/jeps/261) the -Xbootclasspath:/p option was removed and the --patch-module option has to be used instead to achieve a similar behaviour. 

This leads to various problems in Eclipse though: 

1. It's not possible to access members (fields or methods) which are newly defined in one patched class (e.g. java.lang.Number) from another patched class (e.g. java.lang.Integer). Eclipse *always* shows errors in the editor, but *sometimes* seems to even compile the class (e.g. after a clean on the project). With the next change and save on the class the compile error returns though (see attached image).  

2. Code completion does not work for the cases above either (which kinda makes sense, since Eclipse does not seem to know / accept the changes) 

So either I am missing some configuration or it really is not possible yet to create such patches with Eclipse. I am aware that javac is not the spec but just wanted to point out that everything works compiling with javac and also at runtime there is no problem as the jvm allows patching the java.base module with no limitations.
Comment 1 Eclipse Genie CLA 2021-05-17 05:01:27 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Eclipse Genie CLA 2023-05-08 12:11:24 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.