Community
Participate
Working Groups
When adding inner static class public static BuilderExampleBuilder builder() { return new BuilderExampleBuilder(); } public static class BuilderExampleBuilder { BuilderExampleBuilder() {} } And using auto suggest on builder methods by MyClass.BuilderExampleBuilder.build(). Eclipse suggest `new` as part of the methods (with wait(),...) I think Eclipse shouldn't suggest new, because it's irrelevant
First asked in https://stackoverflow.com/questions/59443171/eclipse-lombok-builder-add-new-suggestion
S.t. seems to be missing in your example. Given: MyClass.builder() Required: MyClass.BuilderExampleBuilder.build() I am guessing the following: //--- public class MyClass { public static BuilderExampleBuilder builder() { return new BuilderExampleBuilder(); } public static class BuilderExampleBuilder { BuilderExampleBuilder() { } } void test() { MyClass.builder().| } } //--- Completing at '|' In this case the keyword 'new' is proposed, because the LHS could be the receiver of a qualified allocation. Assume we have a non-static inner class InnerBuilder inside BuilderExampleBuilder, then the following would be legal: MyClass.builder().new InnerBuilder(); Am I missing anything?
It is indeed wrong to propose 'new' even if no inner class of the LHS type exists.
From your comments, you agree it's a bug so suggest new because there's no non-static inner class exists, right?
(In reply to Ori Marko from comment #4) > From your comments, you agree it's a bug so suggest new because there's no > non-static inner class exists, right? *If* there is no non-static inner class, yes. But from comment 0 I could not see what exactly is your case, because your code wouldn't compile anyway.
Yes, I can't edit comment, but there's no inner class, full class example: public class MyClass { public static BuilderExampleBuilder builder() { return new BuilderExampleBuilder(); } public static class BuilderExampleBuilder { BuilderExampleBuilder() {} } public static void main(String[] args) { MyClass.builder(); } } MyClass.builder(). shouldn't propose new as an option
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.
problem still occurs on latest Eclipse, I still want the feature