aboutsummaryrefslogtreecommitdiff
path: root/core/src/com/google
diff options
context:
space:
mode:
authorSam Berlin <sameb@google.com>2012-01-13 18:22:35 -0500
committerSam Berlin <sameb@google.com>2012-01-13 18:22:35 -0500
commit45ef01760942b9575a6094effeb4eb034db9a113 (patch)
tree0fd922be07e1a722085a6685957ff31a2ce0a87f /core/src/com/google
parentd9b62c213e28f42cba6c1c4bf625fc0dc6d0d8e2 (diff)
downloadguice-45ef01760942b9575a6094effeb4eb034db9a113.tar.gz
Cleanup a few things:
1) Remove invalid annotation. 2) Update to Guava 11.0.1, from r9. 3) Remove some unused files. 4) Forcibly keep Throwables, since servlet uses it but core doesn't (so jarjar was wiping it). 5) Disable failing Multibinder test. R=jessewilson DELTA=193 (10 added, 174 deleted, 9 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=4087
Diffstat (limited to 'core/src/com/google')
-rw-r--r--core/src/com/google/inject/internal/util/ExpirationTimer.java26
-rw-r--r--core/src/com/google/inject/internal/util/NullOutputException.java30
-rw-r--r--core/src/com/google/inject/util/Node.java115
3 files changed, 0 insertions, 171 deletions
diff --git a/core/src/com/google/inject/internal/util/ExpirationTimer.java b/core/src/com/google/inject/internal/util/ExpirationTimer.java
deleted file mode 100644
index 0d545a8c..00000000
--- a/core/src/com/google/inject/internal/util/ExpirationTimer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-import java.util.Timer;
-
-/**
- * Timer used for entry expiration in MapMaker.
- */
-class ExpirationTimer {
- static Timer instance = new Timer(true);
-}
diff --git a/core/src/com/google/inject/internal/util/NullOutputException.java b/core/src/com/google/inject/internal/util/NullOutputException.java
deleted file mode 100644
index 0a559b57..00000000
--- a/core/src/com/google/inject/internal/util/NullOutputException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.internal.util;
-
-/**
- * Thrown when a computer function returns null. This subclass exists so
- * that our ReferenceCache adapter can differentiate null output from null
- * keys, but we don't want to make this public otherwise.
- *
- * @author Bob Lee
- */
-class NullOutputException extends NullPointerException {
- public NullOutputException(String s) {
- super(s);
- }
-}
diff --git a/core/src/com/google/inject/util/Node.java b/core/src/com/google/inject/util/Node.java
deleted file mode 100644
index ed0d4dd3..00000000
--- a/core/src/com/google/inject/util/Node.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Copyright (C) 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.util;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-import com.google.inject.Key;
-import com.google.inject.internal.Errors;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-/**
- * A node in the scoped dependency graph. Each node has two scopes. The <i>applied scope</i> is the
- * scope directly assigned to the binding by the user, such as in an {@code in()} clause. The
- * <i>effective scope</i> is the narrowest scope in which this object is used. It is derived from
- * the narrowest scope of the node's transitive dependencies. Each scope is modelled as a rank;
- * higher numbers represent narrower scopes.
- */
-class Node {
- private final Key<?> key;
-
- private int appliedScope = Integer.MAX_VALUE;
- private Node effectiveScopeDependency;
-
- private int effectiveScope = Integer.MIN_VALUE;
- private Class<? extends Annotation> appliedScopeAnnotation;
-
- /** Places that this node is injected. */
- private Set<Node> users = ImmutableSet.of();
-
- Node(Key<?> key) {
- this.key = key;
- }
-
- /**
- * Initialize the scope ranks for this node. Called at most once per node.
- */
- void setScopeRank(int rank, Class<? extends Annotation> annotation) {
- this.appliedScope = rank;
- this.effectiveScope = rank;
- this.appliedScopeAnnotation = annotation;
- }
-
- /**
- * Sets this node's effective scope unless it's already better.
- */
- private void setEffectiveScope(int effectiveScope, Node effectiveScopeDependency) {
- if (this.effectiveScope >= effectiveScope) {
- return;
- }
-
- this.effectiveScope = effectiveScope;
- this.effectiveScopeDependency = effectiveScopeDependency;
- pushScopeToUsers();
- }
-
- /**
- * Pushes the narrowness of this node's effective scope to everyone that depends on this node.
- */
- void pushScopeToUsers() {
- for (Node user : users) {
- user.setEffectiveScope(effectiveScope, this);
- }
- }
-
- /**
- * Returns true if this node has no dependency whose scope is narrower than itself.
- */
- boolean isScopedCorrectly() {
- return appliedScope >= effectiveScope;
- }
-
- boolean isEffectiveScopeAppliedScope() {
- return appliedScope == effectiveScope;
- }
-
- /**
- * Returns the most narrowly scoped dependency. If multiple such dependencies exist, the selection
- * of which is returned is arbitrary.
- */
- Node effectiveScopeDependency() {
- return effectiveScopeDependency;
- }
-
- /**
- * Mark this as a dependency of {@code node}.
- */
- public void addUser(Node node) {
- if (users.isEmpty()) {
- users = Sets.newHashSet();
- }
- users.add(node);
- }
-
- @Override public String toString() {
- return appliedScopeAnnotation != null
- ? Errors.convert(key) + " in @" + appliedScopeAnnotation.getSimpleName()
- : Errors.convert(key).toString();
- }
-}