| Summary: | Quickfix to unneccessary code / non-static class property | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Peter <p.rader> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | VERIFIED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | amj87.iitr, jarthana, manoj.palat, stephan.herrmann |
| Version: | 3.8 | ||
| Target Milestone: | 4.4 M7 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Can you please give a valid code snippet? The above snippet is invalid because of "public TeabagNEW{".
Also, please clearly mention what error are you asking a quick fix for.
No, sorry. Verified as invalid for Eclipse Luna 4.4 M7 Build id: I20140428-2000 |
Build Identifier: If an class contains nonstatic subclasses, the subclass can only instanticated from classinstances only (i.e. factory-creational-pattern GoF). Often those subclasses requires params from the class. Sometimes users pass those values to the subclass via constructor-parameter, instead of pass those values directly to the subclassfield. Reproducible: Always Steps to Reproduce: public class TeaFactory{ String factoryFlavour="Earl Grey"; public class Teabag{ public final String flavour; Teabag(String factoryFlavour){ this.flavour = factoryFlavour; } } public TeabagNEW{ public final String flavour = factoryFlavour; } public Teabag produceTeabag(){ return new Teabag(factoryFlavour); } }