Java
156 строк · 5.8 Кб
1name: Feature Addition Request2description: I want to add a new feature3labels: ["type=addition"]4body:5- type: markdown6attributes:7value: >8Filing feature requests is one of the most popular ways to contribute to Guava.
9
10
11Be aware, though: most feature requests are not accepted, even if they're suggested by12a full-time Guava team member. [Feedback](https://stackoverflow.com/a/4543114) from our13users indicates that they really appreciate Guava's high power-to-weight ratio. It's14important to us to keep Guava as easy to use and understand as we can. That means boiling
15features down to compact but powerful abstractions, and controlling feature bloat carefully.16
17
18Guava's main yardstick for evaluating proposed features can be summed up as [utility times19ubiquity](https://github.com/google/guava/wiki/PhilosophyExplained#utility-times-ubiquity).20
21
22#### Utility: compare with alternatives23
24
25There is always *some* alternative to adding a new feature to Guava, even if it's just26forking Guava yourself.
27
28
29We want to see that new features have some significant advantage over the alternatives.
30These advantages can take
31[many forms](https://github.com/google/guava/wiki/PhilosophyExplained#utility), but taking32the time to discuss them in detail will make it much clearer why this feature should be
33added to Guava.
34
35
36Please fill out the following fields to give us a better understanding of your proposed
37feature and its potential value for other Guava users.
38
39- type: textarea40attributes:41label: 1. What are you trying to do?42validations:43required: true44
45- type: textarea46attributes:47label: 2. What's the best code you can write to accomplish that without the new feature?48validations:49required: true50
51- type: textarea52attributes:53label: 3. What would that same code look like if we added your feature?54validations:55required: true56
57- type: markdown58attributes:59value: >60Comparing two approaches to a use case side by side can make it easier to examine the
61differences between them.
62
63
64Additionally, it's very useful to us if you can provide a "straw API" — what the65method signatures would look like, for example, even if the method and class names are still66in flux. This can make the feature you're suggesting much clearer to us.
67
68- type: textarea69attributes:70label: (Optional) What would the method signatures for your feature look like?71placeholder: |72e.g.,
73public static <E> ImmutableList<E> of();
74public static <E> ImmutableList<E> of(E element);
75public static <E> ImmutableList<E> of(E e1, E e2);
76...
77render: java78validations:79required: false80
81- type: markdown82attributes:83value: >84#### Ubiquity: provide concrete use cases
85
86
87Did you *actually* encounter the need for this feature in a real-world scenario, or is it88just a feature that seems like a sensible addition to Guava?89
90
91Before new features get added to Guava, we really want to be sure that it's for a use case92that actually comes up in the real world. We want to hear the real-world use case so the93community can discuss and debate whether this feature is actually the *best* way to address94the real use case, or whether or not a different abstraction might be more appropriate.95
96
97It's okay if you can't provide complete context on a use case. We understand if you are not
98able to discuss the full details of what you're working on.
99
100
101But Guava aims to provide features that are useful across boundaries of projects, companies,102or even industries — utilities useful for a sizable proportion of all Java programmers103everywhere. If you can give enough detail such that any of us can imagine coming across
104a similar need in our own work, that's extremely helpful in studying how broadly useful the105feature will be.
106
107- type: textarea108attributes:109label: Concrete Use Cases110description: Please provide use cases that actually came up in the real world.111validations:112required: true113
114- type: dropdown115attributes:116label: Packages117description: Please select all of the packages that are relevant to this feature request.118multiple: true119options:120- com.google.common.annotations121- com.google.common.base122- com.google.common.cache123- com.google.common.collect124- com.google.common.escape125- com.google.common.eventbus126- com.google.common.graph127- com.google.common.hash128- com.google.common.io129- com.google.common.math130- com.google.common.net131- com.google.common.primitives132- com.google.common.reflect133- com.google.common.testing134- com.google.common.util.concurrent135
136- type: checkboxes137attributes:138label: Checklist139options:140- label: >141I agree to follow the
142[code of conduct](https://github.com/google/.github/blob/master/CODE_OF_CONDUCT.md).
143required: true144- label: >145I have read and understood the [contribution
146guidelines](https://github.com/google/guava/wiki/HowToContribute#feature-requests).
147required: true148- label: >149I have read and understood
150[Guava's philosophy](https://github.com/google/guava/wiki/PhilosophyExplained), and
151I strongly believe that this proposal aligns with it.
152required: true153- label: >154I have visited the [idea graveyard](https://github.com/google/guava/wiki/IdeaGraveyard),
155and did not see anything similar to this idea.
156required: true157