Age | Commit message (Collapse) | Author |
|
Suppose you have the following types:
```
interface Foo<M extends Bar> {...}
interface FooFactory<M extends Bar> {
Foo<M> create();
}
@AutoFactory(implementing = FooFactory.class)
class FooImpl<M extends Bar> implements Foo<M> {...}
```
Then the generated `FooImplFactory` class should look like this:
```
class FooImplFactory<M extends Bar> implements FooFactory<M> {...}
```
But before this change that was only the case if there was a `@Provided M` constructor parameter. Now we examine whether the requested supertypes of the generated class have type parameters, and if so we copy those onto the generated class.
This may not be 100% accurate but it should work for at least the commonest cases.
RELNOTES=When a requested supertype of the generated factory class has a type parameter, the generated class now always has the same parameter.
PiperOrigin-RevId: 400259157
|
|
reformatting is excluded.
RELNOTES=n/a
PiperOrigin-RevId: 377145832
|
|
Treating them the same as other annotations leads to problems with nested types like `Map.Entry`. If a field or parameter is a `Map.Entry` that is `@Nullable`, and if `@Nullable` is a `TYPE_USE` annotation, then the declaration must use `Map.@Nullable Entry`. JavaPoet will do this correctly if the annotations are applied to the `TypeName` for the declaration.
Also ensure that type annotations are included in the `T` of `Provider<T>` when that appears in field or parameter declarations.
Fixes https://github.com/google/auto/issues/949.
RELNOTES=AutoFactory type annotations are now placed correctly even for nested types.
PiperOrigin-RevId: 350930373
|
|
The generated `create` method needs to declare the same exceptions.
Fixes https://github.com/google/auto/issues/90.
RELNOTES=`@AutoFactory` constructors can now declare checked exceptions. The same exceptions will be declared on the generated `create` method.
PiperOrigin-RevId: 347657308
|
|
In a couple of places I changed `.onLine(M).atColumn(N)` into just `onLineContaining(S)`. I don't think we care that much about the column number of the error.
Also move a test input file that was in the wrong place.
PiperOrigin-RevId: 347454890
|
|
PiperOrigin-RevId: 326930055
|
|
RELNOTES=Add support for generics to @AutoFactory
#AutoFactory
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=263154977
|
|
Fixes https://github.com/google/auto/issues/745
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=262160859
|
|
They don't override Object#equals and are not interned, so reference
equality is not useful. This was causing unnecessary duplication of
Provider fields in AutoFactories.
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=248752047
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244250754
|
|
715b8eb505649a4acaaa5889d4f4b51a91dd8a91, 0383c1cf7472d7444463353aa2ac956c9471130a
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184065172
|
|
@AutoFactory
RELNOTES=Add support for type-annotations and CheckerFramework nullable types to @AutoFactory
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183251433
|
|
RELNOTES=Use `@javax.annotation.processing.Generated` for Java 9.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179187028
|
|
class name has been explicitly specified.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160310315
|
|
runtime dependency for one method.
Fixes https://github.com/google/auto/issues/436
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154474844
|
|
value, which was not correctly implemented by javac.
This bug has been patched and will be in the next version of javac.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146784756
|
|
Github: Fixes google/auto#326
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130784801
|
|
name of the class
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129673209
|
|
the new simplified import rules.
One test, AutoFactoryProcessorTest, had to be updated with modified line numbers because unused imports in bad/MixedFinals.java were deleted.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129643318
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129441115
|
|
Also check nullness of Provider<>s passed to @Inject constructors of an @AutoFactory
Github: Fixes #296
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128983250
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128519974
|
|
FYI This is a rollforward of []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126078797
|
|
*** Reason for rollback ***
Breaks [].
The bug is present in [] but not in able or baker, so I assume this didn't make it into a [] cut and I don't have to ship this if I get it in by Monday morning.
*** Original change description ***
Support @Nullable parameters for @AutoFactory
FYI This is a rollforward of []
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125289392
|
|
FYI This is a rollforward of []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125191485
|
|
for duplicates, remove the ImplementationMethodDescriptor and set the FactoryMethodDescriptor to be overriding and have the same visibility.
- The test case, which has been modified to make the concrete class package-private, would not have worked before, because the create methods were given package-private visibility instead of public visibility.
- This also makes it so that these duplicate methods have the @Override annotation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117186640
|
|
types to decide equality.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=116304582
|
|
*** Reason for rollback ***
Broke some builds
*** Original change description ***
Support @Nullable parameters for @AutoFactory
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=115677120
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=115670868
|
|
This is a rollforward a previous commit which broke due to JavaPoet's TypeName.get() not supporting TypeMirrors that aren't generated yet.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=115590956
|
|
*** Reason for rollback ***
Some clients were broken by TypeName.get(ErrorType)
*** Original change description ***
Convert @AutoFactory to use JavaPoet.
In the process, convert all value types to @AutoValue to allow for an easier transition for later implementing the passing of annotations to generated factories.
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=114468479
|
|
In the process, convert all value types to @AutoValue to allow for an easier transition for later implementing the passing of annotations to generated factories.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=114460941
|
|
generated when inherited from an interface.
Caveats:
parameter names have to match perfectly. If an interface declares the exact same method with differently named params we will choke as before.
everything needs to be public. Interface methods are inherently public, so if we have a collision on a create method, we can't downgrade its visibility to package-private. I think we can automatically upgrade it though if you'd like.
I'm not emitting @Override or anything fancy like that
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113658842
|
|
the annotated class name. For example, the factory for Foo.Bar is named Foo_BarFactory instead of just BarFactory.
Includes a small refactoring of AutoFactoryDeclaration.getFactoryName(). The factory class name is always based on the target type name, which is known when AutoFactoryDeclaration is instantiated. So getFactoryName() doesn't need any parameters.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=97771117
|
|
"@Provides int foo" used to generate a field of type Provider<int>, which doesn't compile. Now it generates a field of type Provider<Integer>.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=96435444
|
|
then the generated factory should just pass its Provider<T> rather than trying to inject a Provider<Provider<T>.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=95226468
|
|
This is the same as a previous change which got rolled back in error.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=94704806
|
|
*** Reason for rollback ***
Breaks several projects using the feature of qualified bindings, because it fails to re-name the params properly, and so you end up with two parameters with the same name.
*** Original change description ***
This CL fixes @AutoFactory to support qualifiers with parameters.
***
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=94702981
|
|
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=94700822
|
|
AutoFactories implementing same interface.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=92862023
|
|
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=84575988
|
|
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=72549415
|
|
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=72339462
|
|
|
|
extension of a generic interface.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=57662999
|
|
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=54908566
|
|
|
|
|
|
|
|
|