Skip to content

Commit

Permalink
Add missing @SInCE methods
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 359326331
  • Loading branch information
java-team-github-bot authored and Guice Team committed Feb 24, 2021
1 parent 96e835f commit 6fa83e4
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 4 deletions.
9 changes: 8 additions & 1 deletion core/src/com/google/inject/RestrictedBindingSource.java
Expand Up @@ -62,6 +62,7 @@
* }</pre>
*
* @author vzm@google.com (Vladimir Makaric)
* @since 5.0
*/
@Inherited
@Retention(RUNTIME)
Expand All @@ -78,6 +79,8 @@
* Meta-annotation indicating that the target annotation is a permit for binding restricted
* bindings. Annotating a binding source (defined in top-level javadoc) with a permit gives it
* permission to bind the restricted bindings guarded by the permit (see {@link #permits}).
*
* @since 5.0
*/
@Documented
@Retention(RUNTIME)
Expand All @@ -103,7 +106,11 @@
*/
String exemptModules() default "";

/** Level of restriction. Determines how violations are handled. */
/**
* Level of restriction. Determines how violations are handled.
*
* @since 5.0
*/
public static enum RestrictionLevel {
WARNING,
ERROR;
Expand Down
3 changes: 2 additions & 1 deletion core/src/com/google/inject/spi/BindingSourceRestriction.java
Expand Up @@ -13,6 +13,7 @@
import com.google.inject.RestrictedBindingSource.RestrictionLevel;
import com.google.inject.internal.Errors;
import com.google.inject.internal.GuiceInternal;
import java.util.regex.Pattern;
import java.lang.annotation.Annotation;
import java.util.ArrayDeque;
import java.util.Arrays;
Expand All @@ -22,7 +23,6 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.regex.Pattern;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Stream;
Expand All @@ -45,6 +45,7 @@
* which happens on a single thread.
*
* @author vzm@google.com (Vladimir Makaric)
* @since 5.0
*/
public final class BindingSourceRestriction {
private BindingSourceRestriction() {}
Expand Down
2 changes: 2 additions & 0 deletions core/src/com/google/inject/spi/Elements.java
Expand Up @@ -125,6 +125,8 @@ public static List<Element> getElements(Stage stage, Iterable<? extends Module>
*
* <p>Using Binder.withSource is not trustworthy because it's a public API that external users can
* use to spoof the original ElementSource of a binding by calling withSource(bogusElementSource).
*
* @since 5.0
*/
public static Binder withTrustedSource(
GuiceInternal guiceInternal, Binder binder, Object source) {
Expand Down
2 changes: 2 additions & 0 deletions core/src/com/google/inject/spi/ErrorDetail.java
Expand Up @@ -13,6 +13,8 @@
* errors.
*
* <p>WARNING: The class and its APIs are still experimental and subject to change.
*
* @since 5.0
*/
public abstract class ErrorDetail<SelfT extends ErrorDetail<SelfT>> implements Serializable {
private final String message;
Expand Down
3 changes: 3 additions & 0 deletions core/src/com/google/inject/spi/InjectionPoint.java
Expand Up @@ -282,6 +282,7 @@ public static InjectionPoint forConstructorOf(TypeLiteral<?> type) {
* @throws ConfigurationException if there is no injectable constructor, more than one injectable
* constructor, or if parameters of the injectable constructor are malformed, such as a
* parameter with multiple binding annotations.
* @since 5.0
*/
public static InjectionPoint forConstructorOf(TypeLiteral<?> type, boolean atInjectRequired) {
Class<?> rawType = getRawType(type.getType());
Expand Down Expand Up @@ -873,6 +874,8 @@ private static boolean overrides(Method a, Method b) {
/**
* Returns all the annotations on a field. If Kotlin-support is enabled, the annotations will
* include annotations on the related Kotlin-property.
*
* @since 5.0
*/
public static Annotation[] getAnnotations(Field field) {
Annotation[] javaAnnotations = field.getAnnotations();
Expand Down
6 changes: 5 additions & 1 deletion core/src/com/google/inject/spi/Message.java
Expand Up @@ -152,7 +152,11 @@ public void applyTo(Binder binder) {
binder.withSource(getSource()).addError(this);
}

/** Returns a copy of this {@link Message} with its sources replaced. */
/**
* Returns a copy of this {@link Message} with its sources replaced.
*
* @since 5.0
*/
public Message withSource(List<Object> newSources) {
return new Message(errorId, errorDetail.withSources(newSources));
}
Expand Down
Expand Up @@ -311,6 +311,8 @@ public <T> FactoryModuleBuilder implement(Key<T> source, TypeLiteral<? extends T
* <p>Guice will try to work properly even if this method is not called (or called with a lookups
* that doesn't have access to the factory), but doing so requires reflection into the JDK, which
* may break at any time (and trigger unsafe access warnings).
*
* @since 5.0
*/
public <T> FactoryModuleBuilder withLookups(MethodHandles.Lookup lookups) {
this.lookups = lookups;
Expand Down
Expand Up @@ -87,7 +87,11 @@ public static Builder builder() {
return new Builder();
}

/** Builder for setting configuration options on DaggerAdapter. */
/**
* Builder for setting configuration options on DaggerAdapter.
*
* @since 5.0
*/
public static class Builder {
private final ImmutableList.Builder<Object> modules = ImmutableList.builder();
private Predicate<Method> predicate = Predicates.alwaysTrue();
Expand Down
Expand Up @@ -135,6 +135,8 @@ public static BoundFieldModule of(Object instance) {
* bindings), create an instance of an anonymous class extending this one and annotate it with
* those permits. For example: {@code new @Permit1 @Permit2 BoundFieldModule.WithPermits(instance)
* {}}.
*
* @since 5.0
*/
public static class WithPermits extends AbstractModule {
private final Object instance;
Expand Down

0 comments on commit 6fa83e4

Please sign in to comment.