Bug 436634 - Linking from the Javadoc a private enum's inner exception leads to an invalid import
Summary: Linking from the Javadoc a private enum's inner exception leads to an invalid...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   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: 2014-06-04 17:17 EDT by Palmer Eldritch CLA
Modified: 2022-07-19 12:45 EDT (History)
2 users (show)

See Also:


Attachments
File > Export > Preferences > All (306.42 KB, application/octet-stream)
2014-06-06 10:33 EDT, Palmer Eldritch CLA
no flags Details
The project contains additional case of the bug (5.94 KB, application/zip)
2015-03-12 06:36 EDT, Dmitry -- CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Palmer Eldritch CLA 2014-06-04 17:17:30 EDT
When Organize Imports is active (Save Actions) and I try to save this:

package eclipse.bug.test;

public final class Transaction {

	/**
	 * @throws IllegalTransitionException
	 */
	public void lock() {}

	private enum State {
		ACTIVE;

		final class IllegalTransitionException extends RuntimeException {}
	}
}


it keeps adding:

import eclipse.bug.test.Transaction.State.IllegalTransitionException;

which displays the error:

The type eclipse.bug.test.Transaction.State is not visible

Should add the identifiers to IllegalTransitionException (@throws eclipse.bug.test.Transaction.State.IllegalTransitionException) - or not do anything preferably

Eclipse Java EE IDE for Web Developers.

Version: Luna M7 Release (4.4.0M7)
Build id: 20140508-1440
Comment 1 shankha banerjee CLA 2014-06-05 02:23:13 EDT
Hi Palmer,
I took May 1 release and tried the following:

1) Created a test project and changed the settings 

Preferences->Java->Editor->Save Actions->Configure

and clicked on Organize imports. 

2) Copy pasted the above code and pressed Ctrl + S multiple times (with minor edits).

I don't see a error message. 

Could you please list down all your steps and also if possible attach the project. 


Thanks
Comment 2 Palmer Eldritch CLA 2014-06-06 10:33:18 EDT
Created attachment 244039 [details]
File > Export > Preferences > All

(In reply to comment #1)
> Hi Palmer,
> I took May 1 release and tried the following:

I am on M7 (20140508-1440)
Do you want any particular version numbers ?
> 
> 1) Created a test project and changed the settings
> 
> Preferences->Java->Editor->Save Actions->Configure
> 
> and clicked on Organize imports.
> 
> 2) Copy pasted the above code and pressed Ctrl + S multiple times (with minor
> edits).
> 
> I don't see a error message.
> 
> Could you please list down all your steps and also if possible attach the
> project.
> 
The OP is a complete compiling example - the steps are:
1) Copy the code
2) Paste it in Project Explorer with no package selected
3) the error line is added in the file created in the _pasted_code_ project

I attach my preferences
> 
> Thanks
Comment 3 Dmitry -- CLA 2015-03-12 06:36:12 EDT
Created attachment 251501 [details]
The project contains additional case of the bug

I have the similar issue in Eclipse Java EE IDE for Web Developers (Version: Luna Service Release 2 (4.4.2) Build id: 20150219-0600).

Steps to reproduce:
1. Download "Eclipse IDE for Java EE Developers" and unpack it into an empty folder (I use MS Windows, x64 version).
2. Start the unpacked eclipse.
3. Download and import attached project.
4. Open class EclipseJavadocNImportBug.
5. Press Ctrl-Shift-O.

Expected result:
1. No new imports are added.

Actual result:
1. Two new imports are added:
import test.bug.EclipseJavadocNImportBug.InnerClass1;
import test.bug.EclipseJavadocNImportBug.State.IllegalTransitionException;

The first import is a cause of the warning message: "The import test.bug.EclipseJavadocNImportBug.InnerClass1 is never used".
The second import is a cause of the error message: "The type test.bug.EclipseJavadocNImportBug.State is not visible".
Comment 4 Eclipse Genie CLA 2020-05-24 01:45:33 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 Eclipse Genie CLA 2022-07-19 12:45:19 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.