Bug 366546 - [assist] Indirect nested classes/enums not proposed
Summary: [assist] Indirect nested classes/enums not proposed
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7.1   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT Core Triaged CLA
QA Contact: Ayushman Jain CLA
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 09:36 EST by Mauro Molinari CLA
Modified: 2024-05-01 17:41 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 Mauro Molinari CLA 2011-12-13 09:36:01 EST
Suppose you have:

package a;

public class A
{
	public static enum MyEnum
	{
		E1, E2;
	}

	public static int CONSTANT = 1;

	public static class MyNestedClass
	{
	}
}

and:

package b;

import a.A;

public class B extends A
{

}

and:

package c;

import a.A;

public class C
{
	public static void main(String[] args)
	{
		B.| <= invoke code assist here
	}

}

If you invoke code assist at | you'll find that:
- CONSTANT is proposed
- MyEnum and MyNestedClass are not proposed

I know that this kind of indirect access should be avoided, however B.MyEnum and B.MyNestedClass are valid Java code, just like B.CONSTANT. So, I would let the user decide whether he/she wants to write dangerous code and leave the "Indirect access to static member" Code Style option in "Errors/Warnings" preferences page do its job in case.
Comment 1 Ayushman Jain CLA 2011-12-13 11:18:31 EST
Will investigate, time permitting.
Comment 2 Eclipse Genie CLA 2020-05-10 00:13:05 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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 3 Mauro Molinari CLA 2020-05-20 05:48:09 EDT
Still applies to Eclipse 2019-12.
Comment 4 Eclipse Genie CLA 2022-05-11 07:56:03 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 5 Mauro Molinari CLA 2022-05-11 09:56:37 EDT
Still applies to Eclipse 2021-12.
Comment 6 Eclipse Genie CLA 2024-05-01 17:41:22 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.