Bug 542847 - Infer generic shouldn't be suggested with Java's array
Summary: Infer generic shouldn't be suggested with Java's array
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.11   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-17 06:17 EST by Ori Marko CLA
Modified: 2023-02-01 13:06 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ori Marko CLA 2018-12-17 06:17:09 EST
You cannot create arrays of parameterized types, so below code can't be parameterized

ArrayList<Integer>[] list = new ArrayList[1];

But Eclipse shows a warning

Type safety: The expression of type ArrayList[] needs unchecked conversion to conform to ArrayList<Integer>[]

And also shows suggestion Infer Generic Type Arguments which does nothing when submitted.

I suggest Infer Generic Type shouldn't be suggested in this case

Asked in https://stackoverflow.com/questions/53756616/eclipse-why-infer-generic-suggested-for-javas-array
Comment 1 Eclipse Genie CLA 2020-12-07 02:40:22 EST
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 Ori Marko CLA 2020-12-07 03:57:37 EST
Problem still occurs, and I still want the feature (not suggesting if nothing can be changed)
Comment 3 Eclipse Genie CLA 2023-02-01 13:06:21 EST
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.