Commit Graph
6 Commits
Author SHA1 Message Date
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
lukesandRon Shapiro dcf7bdacc2 remove unnecessary explicit type parameters now that we are on java7
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145716288
2017-03-21 15:28:23 -04:00
lukesandRon Shapiro 3d096c6aa3 Make sure to hold the lock when inspecting jitBindings in loadEagerSingletons.
loadEagerSingletons needs to copy all the jit bindings into a list in order to safely iterate them, however it still needs to hold the lock while performing the copy. Without this you can get ConcurrentModificationExceptions, or things like "constructor not ready" errors because partially constructed bindings can be shared across threads.

I added a test that can trigger this failure mode, prior to the fix the test is ~30% flaky, after it passes consistently.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145686956
2017-03-21 15:28:20 -04:00
lukesandSam Berlin 34e7c5d715 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=132718493
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
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