Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 573980 - [17][quick fix] Provide quick fix to declare sealed interface as super interface of permitted types
Summary: [17][quick fix] Provide quick fix to declare sealed interface as super interf...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.20   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.21 M1   Edit
Assignee: Noopur Gupta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 572061 574703 574820
  Show dependency tree
 
Reported: 2021-06-03 08:30 EDT by Noopur Gupta CLA
Modified: 2021-07-13 07:24 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2021-06-03 08:30:10 EDT
package p1;

public sealed interface IShape permits Circle, IRectangle { // [1]

}


public interface IRectangle {

}

public class Circle {

}

At [1], we get these two errors:

- Permitted type Circle does not declare p1.IShape as direct super interface 
- Permitted type IRectangle does not declare p1.IShape as direct super interface 

We should have a quick fix to declare the sealed interface as the super interface of permitted types.
Comment 1 Noopur Gupta CLA 2021-06-03 08:36:17 EDT
We can release it in master branch first with preview feature checks and it can be merged to the beta 17 branch after that.
Comment 2 Sarika Sinha CLA 2021-06-04 03:04:53 EDT
I think the intention was to set to 4.21 M1.
Comment 3 Noopur Gupta CLA 2021-06-04 03:39:56 EDT
(In reply to Sarika Sinha from comment #2)
> I think the intention was to set to 4.21 M1.
Yes, thanks for fixing the TM.
Comment 4 Eclipse Genie CLA 2021-06-17 07:18:59 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/182108
Comment 6 Eclipse Genie CLA 2021-06-23 08:55:27 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/182390
Comment 7 Noopur Gupta CLA 2021-06-23 08:56:48 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created:
> https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/182390

We should not provide the quick fix if the permitted type is not
present in a compilation unit (e.g. is binary / non-editable).
Comment 9 Eclipse Genie CLA 2021-07-05 03:40:52 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/182746
Comment 10 Eclipse Genie CLA 2021-07-05 03:43:03 EDT
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/182747
Comment 13 Noopur Gupta CLA 2021-07-07 03:01:15 EDT
Verified in I20210704-1800.
Comment 14 Noopur Gupta CLA 2021-07-07 04:23:09 EDT
(In reply to Noopur Gupta from comment #7)
> (In reply to Eclipse Genie from comment #6)
> > New Gerrit change created:
> > https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/182390
> 
> We should not provide the quick fix if the permitted type is not
> present in a compilation unit (e.g. is binary / non-editable).

This got reverted by bug 574526. To be fixed again via bug 574703.