Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 549306 - [13][quick fix] Add quick fix to change project compliance and JRE to 13
Summary: [13][quick fix] Add quick fix to change project compliance and JRE to 13
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.12   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: BETA J13   Edit
Assignee: Kalyan Prasad Tatavarthi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 548096
  Show dependency tree
 
Reported: 2019-07-16 06:59 EDT by Kalyan Prasad Tatavarthi CLA
Modified: 2019-07-31 07:04 EDT (History)
1 user (show)

See Also:


Attachments
New combined QuickFix (18.82 KB, image/png)
2019-07-17 03:08 EDT, Kalyan Prasad Tatavarthi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kalyan Prasad Tatavarthi CLA 2019-07-16 06:59:47 EDT
Add quick fix to change project compliance and JRE to 13 for IProblem.PreviewEnablingNotAllowed.
Comment 1 Eclipse Genie CLA 2019-07-16 07:05:15 EDT
New Gerrit change created: https://git.eclipse.org/r/146162
Comment 2 Kalyan Prasad Tatavarthi CLA 2019-07-17 03:08:53 EDT
Created attachment 279298 [details]
New combined QuickFix

The change https://git.eclipse.org/r/146162 includes code to combine changing the project compliance to 13 as well as to enable the previews in a single QuickFix. This attachment shows the way UI will look for the quick assist. Please provide your feedback.
Comment 4 Eclipse Genie CLA 2019-07-18 05:44:06 EDT
New Gerrit change created: https://git.eclipse.org/r/146301
Comment 6 Eclipse Genie CLA 2019-07-18 05:50:42 EDT
New Gerrit change created: https://git.eclipse.org/r/146303
Comment 8 Noopur Gupta CLA 2019-07-23 05:55:11 EDT
Y20190722-0900

1. WARNING in /ui/org/eclipse/jdt/internal/ui/text/correction/ReorgCorrectionsSubProcessor.java
 (at line 391)
public ChangeToRequiredCompilerCompliance(String name, IJavaProject project, boolean changeOnWorkspace, String requiredVersion, int relevance) {
The constructor ReorgCorrectionsSubProcessor.ChangeToRequiredCompilerCompliance(String, IJavaProject, boolean, String, int) is never used locally

Let's keep the bug open until this is resolved (either remove the unused constructor or reorganize the code to prevent the warning).
Comment 9 Noopur Gupta CLA 2019-07-25 02:53:33 EDT
It also seems to be causing the following test failures in the Y-build:
QuickFixTest12.testAddDefaultCaseSwitchExpression1() 
QuickFixTest12.testAddDefaultCaseSwitchExpression2() 

Kalyan, can you please check?
Comment 10 Noopur Gupta CLA 2019-07-25 02:54:14 EDT
(In reply to Noopur Gupta from comment #9)
> It also seems to be causing the following test failures in the Y-build:
> QuickFixTest12.testAddDefaultCaseSwitchExpression1() 
> QuickFixTest12.testAddDefaultCaseSwitchExpression2() 
> 
> Kalyan, can you please check?
Here's the stack trace:

java.lang.ClassCastException: org.eclipse.jdt.internal.ui.text.correction.ReorgCorrectionsSubProcessor$ChangeToRequiredCompilerCompliance cannot be cast to org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal
	at org.eclipse.jdt.ui.tests.quickfix.QuickFixTest12.testAddDefaultCaseSwitchExpression1(QuickFixTest12.java:456)
...
Comment 11 Eclipse Genie CLA 2019-07-31 06:23:42 EDT
New Gerrit change created: https://git.eclipse.org/r/146851
Comment 13 Kalyan Prasad Tatavarthi CLA 2019-07-31 07:04:55 EDT
(In reply to Noopur Gupta from comment #10)
> (In reply to Noopur Gupta from comment #9)
> > It also seems to be causing the following test failures in the Y-build:
> > QuickFixTest12.testAddDefaultCaseSwitchExpression1() 
> > QuickFixTest12.testAddDefaultCaseSwitchExpression2() 
> > 
> > Kalyan, can you please check?
> Here's the stack trace:
> 
> java.lang.ClassCastException:
> org.eclipse.jdt.internal.ui.text.correction.
> ReorgCorrectionsSubProcessor$ChangeToRequiredCompilerCompliance cannot be
> cast to org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal
> 	at
> org.eclipse.jdt.ui.tests.quickfix.QuickFixTest12.
> testAddDefaultCaseSwitchExpression1(QuickFixTest12.java:456)
> ...

 The patch https://git.eclipse.org/r/146851

1) Handled the case of warning in ReorgCorrectionsSubProcessor.
2) Disabled the two failing tests. Need to enable them once RTStubs13 is
ready.