Move Static factory methods off the class they construct.
- Vorherrschende Sprache
- Java
- Sterne
- 12.1k
- Forks
- 4k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 37
Beschreibung
The `ManagedChannelBuilder` and `ServerBuilder` classes both expose static factory methods as a means to construct instances of themselves. These classes can be extended, which means that all subclasses inherit the static methods.
However, when these static methods are call on the subclasses, they often return a different type than expected (InProcessChannelBuilder returns based on the service loader, for instance. See #3438). This leads to confusion, and forces every subclass to add static methods that match the signatures)
Beitragsleitfaden
Rechercherichtung
Review ManagedChannelBuilder and ServerBuilder first, then inspect InProcessChannelBuilder and issue #3438 for the reported factory-method behavior. Determine the intended destination and compatibility impact of moving the static factories; done means subclass calls no longer produce confusing or unexpected types and the public construction API is consistent.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100