Community
Participate
Working Groups
Since 4.21, the type filter java.awt.* has been added and is enabled by default (see bug 571758). Unfortunately, the AWT API is exposed/used in Swing, for example by javax.swing.JFrame extending java.awt.Frame, by javax.swing.JComponent extending java.awt.Component which provides the method getBounds() that returns a java.awt.Rectangle, etc. There is also java.awt.Robot contained in AWT without there being an alternative for that in Swing or somewhere else. Samples: class Sample extends javax.swing.JFrame { void init() { | // <- here no proposal for "setSize(...)" } void foo(javax.swing.JFrame jFrame) { jFrame.| // <- here no proposal for "setSize(...)" } void bounds() { this.getBounds().| // <- here no proposal for "x" } void robot() { new Rob| // <- here no proposal for "Robot" } } A couple of questions were asked on Stack Overflow because of this (most are closed as duplicate of the first; some might already be deleted): - https://stackoverflow.com/q/69357171/6505250 (JFrame) - https://stackoverflow.com/q/69515233/6505250 (Rectangle) - https://stackoverflow.com/q/69511421/6505250 (Graphics) - https://stackoverflow.com/q/69509896/6505250 (BorderLayout) - https://stackoverflow.com/q/69393367/6505250 (JFrame) - https://stackoverflow.com/q/69415574/6505250 (JFrame) - https://stackoverflow.com/q/69399195/6505250 (BorderLayout) - ... I suggest removing the type filter "java.awt.*" or at least disabling it by default. Instead, I would like to have "java.awt.List" filtered by default.
There continues to be a steady stream of questions caused by this on Stack Overflow. It is really confusing beginners
+1 Please don't filter *standard* Java APIs by default. Let the user decide.
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/186646
*** Bug 576708 has been marked as a duplicate of this bug. ***
(In reply to Eclipse Genie from comment #3) > New Gerrit change created: > https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/186646 That re-adds awt except List and graal thingy reported by bug 576708.
*** Bug 576727 has been marked as a duplicate of this bug. ***
(In reply to Andrey Loskutov from comment #5) > (In reply to Eclipse Genie from comment #3) > > New Gerrit change created: > > https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/186646 > > That re-adds awt except List and graal thingy reported by bug 576708. Thanks for the patch, Andrey. Updating these type filters makes sense based on the bug reports.
(In reply to Noopur Gupta from comment #7) > (In reply to Andrey Loskutov from comment #5) > > (In reply to Eclipse Genie from comment #3) > > > New Gerrit change created: > > > https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/186646 > > > > That re-adds awt except List and graal thingy reported by bug 576708. > > Thanks for the patch, Andrey. Updating these type filters makes sense based > on the bug reports. OK to merge now for M2?
Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/186646 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=ccb2e7bd426fc8a8566fb743212bd80c157dd1cd
(In reply to Andrey Loskutov from comment #8) > OK to merge now for M2? Done. Thanks!
*** Bug 576862 has been marked as a duplicate of this bug. ***
*** Bug 576863 has been marked as a duplicate of this bug. ***
*** Bug 576982 has been marked as a duplicate of this bug. ***
*** Bug 577030 has been marked as a duplicate of this bug. ***