Skip to content

Fully qualified type name inserted in field declaration instead of import + simple name (disregarding workspace preference) #866

@mauromol

Description

@mauromol

Follow-up of #862 (see discussion there).

Steps to repro:

  • start Eclipse (tested with 2018-12) on a brand new empty workspace
  • create a Groovy project
  • create this Groovy class:
package test50

class Test50 {
	
	String foo
	
	TreeNode|
}
  • invoke code assist at "|" and choose javax.swing.tree.TreeNode
  • the editor inserts the import statement and leaves the simple class name TreeNode at the declaration point; so far so good
  • remove the import and save the file, restoring its original state
  • import this workspace preferences file: https://www.dropbox.com/s/uqmmlxfibob2wbj/Eclipse%20preferences%20-%20DARK.epf?dl=1
  • when requested, restart the Eclipse IDE
  • after restart, go to Test50 class
  • try to invoke the code assist at "|" as before
  • the editor may say that some kind of problem with code assist occurred: not sure why (any idea?)
  • click to "restore defaults"
  • at this point, invoking code assist again may not work any more (why?)
  • close the Test50 class and open it again
  • try to invoke code assist at "|" again
  • now, the fully qualified name javax.swing.tree.TreeNode is inserted at the declaration point, instead of the import statement, although "Add import instead of qualified name" workspace preference related to Content Assist is checked
  • at this point, this faulty behaviour will always occur

If you still can't reproduce in this way, please tell me: I may provide my whole Eclipse installation (for Windows x64).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions