Revision: 9f8b438b370a
Author: Christian Edward Gruber <cgru...@google.com>
Date: Thu May 16 11:06:08 2013
Log: Use a single UniqueAnnotation instead of creating a new one each
time.
-----------------
Manually Synced.
COMMIT=45708839
http://code.google.com/p/google-guice/source/detail?r=9f8b438b370a
Modified:
/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java
=======================================
---
/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java
Thu May 16 11:00:54 2013
+++
/extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java
Thu May 16 11:06:08 2013
@@ -79,6 +79,9 @@
final class FactoryProvider2 <F> implements InvocationHandler,
ProviderWithExtensionVisitor<F>, HasDependencies,
AssistedInjectBinding<F> {
+ /** A constant annotation to denote the return value, instead of
creating a new one each time. */
+ static final Annotation RETURN_ANNOTATION = UniqueAnnotations.create();
+
/** if a factory method parameter isn't annotated, it gets this
annotation. */
static final Assisted DEFAULT_ANNOTATION = new Assisted() {
public String value() {
@@ -577,7 +580,7 @@
final Key<?> returnType = data.returnType;
// We ignore any pre-existing binding annotation.
- final Key<?> returnKey = Key.get(returnType.getTypeLiteral(),
UniqueAnnotations.create());
+ final Key<?> returnKey = Key.get(returnType.getTypeLiteral(),
RETURN_ANNOTATION);
Module assistedModule = new AbstractModule() {
@Override @SuppressWarnings("unchecked") // raw keys are necessary
for the args array and return value
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-guice-dev+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.