Bug 562103

Summary: [14] Failure in QuickFixTest14.testGetNeedHigherComplianceProposalsAndEnablePreviewsProposal
Product: [Eclipse Project] JDT Reporter: Stephan Herrmann <stephan.herrmann>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: loskutov
Version: 4.16   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/160989
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=f63eedef918b66abbb80a3494ecd2dc50e6aa1e5
Whiteboard: stalebug
Bug Depends on: 562057    
Bug Blocks:    

Description Stephan Herrmann CLA 2020-04-14 07:31:55 EDT
Test QuickFixTest14.testGetNeedHigherComplianceProposalsAndEnablePreviewsProposal currently fails, saying:

java.lang.AssertionError: Wrong number of problems, is: 2, expected: 1
Pb(204) Syntax error on token "record", @ expected[21 ,26]
Pb(240) Syntax error, insert "enum Identifier" to complete EnumHeader[33 ,33]

I assume this to be caused by the intermediate fix for bug 562057.

Gerrit doesn't yet show the failure, but perhaps it doesn't yet see a version of jdt.core with that fix?
Comment 2 Stephan Herrmann CLA 2020-04-15 07:33:19 EDT
(In reply to Andrey Loskutov from comment #1)
> @Stephan: is this a test or code problem?

I believe JDT should do better in detecting that the illegal 'record' *could become* legal by applying the quick fix. Not sure, how much JDT/Core can do to help (while strictly avoiding to consider 'record' as a keyword below 14), or if JDT/UI must inspect the syntax error or source code to detect this situation.
Comment 3 Andrey Loskutov CLA 2020-04-15 08:06:30 EDT
(In reply to Stephan Herrmann from comment #2)
> (In reply to Andrey Loskutov from comment #1)
> > @Stephan: is this a test or code problem?
> 
> I believe JDT should do better in detecting that the illegal 'record' *could
> become* legal by applying the quick fix. Not sure, how much JDT/Core can do
> to help (while strictly avoiding to consider 'record' as a keyword below
> 14), or if JDT/UI must inspect the syntax error or source code to detect
> this situation.

So I read it that we would like to have some improvements in JDT core, but as long as they aren't implemented, test can be updated to not block Gerrits?
Comment 4 Andrey Loskutov CLA 2020-04-15 08:27:12 EDT
(In reply to Andrey Loskutov from comment #3)
> 
> So I read it that we would like to have some improvements in JDT core, but
> as long as they aren't implemented, test can be updated to not block Gerrits?

OK, tried to manually reproduce this in the IDE - no chance to fix the test, without proper JDT core support the test is meaningless.

I would "@Ignore" this test for now, otherwise we will block Gerrits.

The code reports following problems for this source (& project setting set to use Java 13 compliance level):

package test;

public record Rec1() {

}

Description	Resource	Path	Location	Type
Syntax error, insert "enum Identifier" to complete EnumHeader	Rec1.java	/Java14/src/test	line 3	Java Problem
Syntax error on token "record", @ expected	Rec1.java	/Java14/src/test	line 3	Java Problem
	/Java14/src/test	line 3	Java Problem
Syntax error on token "record", @ expected	Rec1.java	/Java14/src/test	line 3	Java Problem
Comment 5 Eclipse Genie CLA 2020-04-15 08:31:09 EDT
New Gerrit change created: https://git.eclipse.org/r/160989
Comment 6 Stephan Herrmann CLA 2020-04-15 11:00:49 EDT
(In reply to Andrey Loskutov from comment #3)
> (In reply to Stephan Herrmann from comment #2)
> > (In reply to Andrey Loskutov from comment #1)
> > > @Stephan: is this a test or code problem?
> > 
> > I believe JDT should do better in detecting that the illegal 'record' *could
> > become* legal by applying the quick fix. Not sure, how much JDT/Core can do
> > to help (while strictly avoiding to consider 'record' as a keyword below
> > 14), or if JDT/UI must inspect the syntax error or source code to detect
> > this situation.
> 
> So I read it that we would like to have some improvements in JDT core, 

I said "Not sure, how much JDT/Core can do to help"

> but
> as long as they aren't implemented, test can be updated to not block Gerrits?

agreed
Comment 8 Eclipse Genie CLA 2022-05-09 04:38:17 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 9 Eclipse Genie CLA 2024-04-29 11:08:57 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.