Commit Graph
38 Commits
Author SHA1 Message Date
Guice TeamandGuice Team dd873be400 Remove AOP build variant.
Changes include:

- skip tests that are testing bytecode generation enabled behaviors
- make line number and source file name information available even when bytecode generation is disabled since it does not use bytecode generation and makes testing easier (some tests rely on the information being available)
- update maven pom files to stop producing a no-aop version of Guice
- added test profile to execute tests with bytecode generation disabled

PiperOrigin-RevId: 336306344
2020-10-09 09:23:54 -07:00
Guice TeamandGuice Team 690e189a7d Use assumeTrue to skip tests that only need to run under certain conditions.
This requires migrating some tests from JUnit3 to JUnit4.

PiperOrigin-RevId: 335094691
2020-10-02 13:55:43 -07:00
xiaomingjiaandKurt Alfred Kluever 363c593aa7 Fix or suppress some unchecked/rawtypes javac warnings in Guice code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=324884430
2020-08-05 09:53:37 -04:00
xiaomingjiaandKurt Alfred Kluever db66b74249 Fix some unchecked and rawtypes warnings in Guice code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=324662892
2020-08-04 11:22:03 -04:00
xiaomingjiaandDavid P. Baker ee6abe38ae Run tests with different class loading options.
Changed to skip certain tests explicitly instead of excluding the test class, which makes the setup easier.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320982966
2020-07-14 11:53:43 -04:00
Stuart McCullochandkevinb9n 85e30beafe Import https://github.com/google/guice/pull/1298
Replace CGLIB with custom code to generate "enhancers" and "fast-classes".

Some user visible changes from using cglib:
- intercepted method that has a return type of int but returns null from the interceptor will no longer be automatically converted to 0, instead a NullPointerException will be thrown.
- Scope implementation can no longer check for circular proxy instance using CircularDependencyProxy marker class, instead should use Scopes.isCircularProxy
- Depending on which custom class loading option is used, Guice enhanced class may no longer be mockable/spyable
- Generated class name is slightly longer.

Closes #1298

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320433559
2020-07-10 08:43:31 -07:00
cpovirkandColin Decker 289073ec20 Update to Guava 25.1-android.
It's required by Truth 0.41, which we switched to in CL 200574789.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202732649
2018-07-02 16:36:45 -04:00
dpbandRon Shapiro cd875c4b91 Use ServiceLoader, not ServiceRegistry. In Java 9, ServiceRegistry is restricted to ImageIO SPI types.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170756352
2018-01-25 11:12:58 -05:00
dpbandRon Shapiro 13ca52bc3b Support Java 9.
Don't assume classloaders are URLClassLoaders. Parse the java.class.path property for URLs if not.
In Java 9, annotations with string values quote them. Make tests and implementations match that behavior.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170488154
2018-01-25 11:12:58 -05:00
gloriosoandSam Berlin e2fbca7c93 Adjust inappropriate suppression before turning on JavaxInjectOnAbstractMethod
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133760795
2016-10-20 12:43:22 -04:00
lukesandSam Berlin 751b555176 Run google-java-format on all Guice code.
configure a presubmit to ensure that it stays formatted.

Highlights include:
* simplified import order
* method annotations are now consistently defined on the preceding line
* javadoc reformatted to 100 chars column width

One test that contained line numbers in error messages had to be modified and
the formatter didn't like some of the more complicated preprocessor directives
(MOE and AOP).

To avoid formatting the copyright notices as javadoc i did a preprocessing step to rewrite the initial '/**' to '/*' using perl

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132692207
2016-09-13 11:47:18 -04:00
lukesandSam Berlin 24be2ea73c Run google-java-format on all Guice code.
configure a presubmit to ensure that it stays formatted.

Highlights include:
* simplified import order
* method annotations are now consistently defined on the preceding line
* javadoc reformatted to 100 chars column width

One test that contained line numbers in error messages had to be modified and
the formatter didn't like some of the more complicated preprocessor directives
(MOE and AOP).

To avoid formatting the copyright notices as javadoc i did a preprocessing step to rewrite the initial '/**' to '/*' using perl

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132691712
2016-09-13 11:47:18 -04:00
lukesandSam Berlin 713c06cce9 Fix issues reported by errorprone
99% of this is adding missing @Override annotations, in the long tail we also have

* insert missing calls to Assert.fail() in tests that are testing exception behavior
* rewrite a few cases of Foo.class.instanceof(c) to c instanceof Foo
* rewrite Class.newInstance - > Class.getConstructor().newInstance() which doesn't break checked exception checking.
* adding @javax.inject.Inject annotations to methods that override methods annotated with @javax.inject.Inject

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131839622
2016-09-07 17:45:54 -04:00
gloriosoandSam Berlin c045a316ae This CL resolves an issue found when a method in a subclass overrides a method from a superclass, where the superclass method is annotated with @javax.inject.Inject, while the subclass method is not. JSR-330 states that the injector should not trigger method injection when an instance of the subclass is injected.
This cleanup is necessary to enable OverridesJavaxInjectableMethod as an error.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130429749
2016-08-29 16:42:00 -04:00
ronshapiroandSam Berlin 859e6a18ff Update Guice to Guava 19
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125062577
2016-06-17 12:19:19 -04:00
lukesandSam Berlin 26ac828ed5 Add path normalization logic to ServletUtils and use it from FilterDefinition
and ServletDefinition to ensure that matching logic is only run against
normalized paths.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124844727
2016-06-17 12:19:11 -04:00
JC Carrillo 325061dbcf Inlined the WeakReference to ease following the test. 2016-01-17 02:54:20 -05:00
JC Carrillo 9b55062ddd Fixed - TODO(cgruber): Use com.google.common.testing.GcFinalization and a countdown latch to un-flake. 2016-01-16 19:06:40 -05:00
sameb 5698a14a55 Change AssertionError to not use the 2 arg cxtor JDK6 compilability. Maybe we'll ditch JDK6 compilability... but can decide that later.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111526748
2016-01-06 15:19:42 -05:00
lukesandSam Berlin 09fec22916 Use the bridge classloader if the member being accessed is public and all its
parameters are public additionally avoid using fastclass at all if the type is
detected to be in a classloader with a different version of cglib.

This fixes a regression introduced by the prior commit for injection points in OSGI
bundles with their own versions of guice.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109143939
2016-01-06 15:19:42 -05:00
kakandSam Berlin effca1d657 Update Guice's Guava jar from 16.0.1 to 18.0
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=106072948
2015-10-28 13:33:07 -04:00
cushonandSam Berlin ac3cf7c16f Remove usages of '_' as a one-character identifier
Use of '_' as a one-character identifier is deprecated in Java 9 [1]. In the
future it may be used as a keyword [2].

[1] https://bugs.openjdk.java.net/browse/JDK-8061549
[2] http://mail.openjdk.java.net/pipermail/lambda-dev/2013-July/010670.html

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82146488
2015-01-24 18:04:54 -05:00
Christian Edward Gruber 3236b100a9 Replace guava 11 with 16 and extract Guava as a separate dependency.
Also, tidy up a teensy bit of test infrastructure, make sure OSGI test is excluded since it's designed for ant-only, and make maven tests fork, as they run out of permgen consistently. Lastly, make the build system enforce a 1.6 minimum, not a 1.5 minimum.
2014-02-13 10:41:42 -08:00
Christian Edward Gruber 8743a0bb0f Convert from MapMaker to CacheBuilder. Change mostly from Stewart McCulloch mcculls@gmail.com modulo internal build issues, a few tweaks and dealing with some test flakage in a functional test.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=52590552
2013-09-20 17:30:27 -07:00
Christian Edward Gruber 0130391982 Doing a cleanup before we can make having @javax.inject.Inject on an abstract method a compile error. I am suppressing the error for the test case that intentionally tests this error.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=50571932
2013-08-09 11:31:59 -07:00
Christian Edward Gruber 4352fa034a Added suppression to @javax.inject.Inject on a final field test case so we can make it a compiler error
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=50571127
2013-08-09 11:31:55 -07:00
sberlin b7a02b02d8 * Remove unused imports
* Sort imports
* Convert tabs to spaces
* Fix the ant no_aop build


Revision created by MOE tool push_codebase.
MOE_MIGRATION=2532


git-svn-id: https://google-guice.googlecode.com/svn/trunk@1572 d779f126-a31b-0410-b53b-1d3aecad763e
2011-07-08 00:34:16 +00:00
sberlin ec76179f50 Restore usernames
Revision created by MOE tool push_codebase.
MOE_MIGRATION=2449


git-svn-id: https://google-guice.googlecode.com/svn/trunk@1569 d779f126-a31b-0410-b53b-1d3aecad763e
2011-06-29 22:04:31 +00:00
sberlin a23937e014 Minor whitespace & temporary username changes
Revision created by MOE tool push_codebase.
MOE_MIGRATION=2448


git-svn-id: https://google-guice.googlecode.com/svn/trunk@1568 d779f126-a31b-0410-b53b-1d3aecad763e
2011-06-29 22:02:50 +00:00
sberlin d9c913acca switch Guice from manually repackaging Guava to depending on Guava. it's still jarjar'd right now, which is causing a ~400k increase in guice-snapshot.jar. next step is to switch to ProGuard to remove the unnecessary code and cut it back down (even further?!). this will let people build from Guice source and depend directly on Guava code without having to worry about hiding internal/util.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1558 d779f126-a31b-0410-b53b-1d3aecad763e
2011-06-26 21:02:54 +00:00
sberlin 86142556d3 refactor removeSuppressedTests out of AllTests, to remove the circular dependency between it & StrictContainerTestSuite.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1557 d779f126-a31b-0410-b53b-1d3aecad763e
2011-06-25 05:05:23 +00:00
sberlin 16f8b0fdf6 fix issue 578, Providers.guicify loses injection points from the delegate.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1453 d779f126-a31b-0410-b53b-1d3aecad763e
2010-12-09 14:18:42 +00:00
sberlin a523ea5e25 rm jsr330, move the one method into Providers.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1437 d779f126-a31b-0410-b53b-1d3aecad763e
2010-12-09 03:00:02 +00:00
mcculls dfdf3e381a Fix strict container tests (avoid duplicate CGLIB classes)
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1375 d779f126-a31b-0410-b53b-1d3aecad763e
2010-11-18 14:14:52 +00:00
sberlin 1c6ff880b9 fix issue 508 -- consider method return type when deciding whether to bridge. patch contributed by stuart.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1374 d779f126-a31b-0410-b53b-1d3aecad763e
2010-11-18 03:59:56 +00:00
sberlin a102c17638 make sure $$EnhancerByGuice$$ & $$FastClassByGuice$$ stay named that way and don't become $$$EnhancerByGuice$$ & $$$FastClassByGuice$$ after jarjar renames the cglib classes.
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1368 d779f126-a31b-0410-b53b-1d3aecad763e
2010-11-09 05:35:13 +00:00
mcculls ac4cdbe137 Issue 561: fix no_aop build by munging away all aop-related references
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1304 d779f126-a31b-0410-b53b-1d3aecad763e
2010-10-21 22:05:58 +00:00
mcculls 74d714c1e7 Issue 552: (step 1) move core code to its own subdirectory
git-svn-id: https://google-guice.googlecode.com/svn/trunk@1300 d779f126-a31b-0410-b53b-1d3aecad763e
2010-10-21 19:10:16 +00:00