Paul Duffin | 0888a09 | 2015-01-23 14:38:46 +0000 | [diff] [blame] | 1 | Guava: Google Core Libraries for Java (JDK5 Backport) |
| 2 | ===================================================== |
Paul Duffin | 7dd2527 | 2015-01-22 16:04:43 +0000 | [diff] [blame] | 3 | |
Paul Duffin | 0888a09 | 2015-01-23 14:38:46 +0000 | [diff] [blame] | 4 | This is the JDK5 backport of Guava. Notable differences from the |
| 5 | JDK6 version of Guava include: |
Paul Duffin | 7dd2527 | 2015-01-22 16:04:43 +0000 | [diff] [blame] | 6 | |
Paul Duffin | 0888a09 | 2015-01-23 14:38:46 +0000 | [diff] [blame] | 7 | - A variety of code is removed, most notably code that uses |
| 8 | `Math.scalb`, `Deque` and its inheritors, `NavigableMap`, |
| 9 | `NavigableSet` and their inheritors, and lots of methods that don't |
| 10 | make sense without the above. |
| 11 | - `TimeUnit` only supports `SECONDS` as the highest granularity time |
| 12 | unit in 1.5, so all uses of `MINUTES`, `DAYS` and `HOURS` have been |
| 13 | re-cast in terms of `SECONDS`. |
| 14 | - `Charset`-accepting methods on `String` and elsewhere were added in |
| 15 | 1.6, so all charsets are passed in by using `Charsets.FOO.name()`, |
| 16 | and exceptions are trapped or thrown as appropriate. |
| 17 | - The guava-gwt module is disabled by not including it in the list |
| 18 | of modules in the parent pom.xml. |
Paul Duffin | 7dd2527 | 2015-01-22 16:04:43 +0000 | [diff] [blame] | 19 | |
Paul Duffin | 0888a09 | 2015-01-23 14:38:46 +0000 | [diff] [blame] | 20 | The JDK5 backport builds with Maven, but has a number of |
| 21 | ideosyncrasies. |
Paul Duffin | 7dd2527 | 2015-01-22 16:04:43 +0000 | [diff] [blame] | 22 | |
Paul Duffin | 0888a09 | 2015-01-23 14:38:46 +0000 | [diff] [blame] | 23 | - While it uses `-source 1.5` and `-target 1.5` and produces valid 1.5 |
| 24 | compatible class files, the backport does not build with JDK5. |
| 25 | @Override annotations on interface methods are retained. |
| 26 | - It requries a custom ExecutorService and AbstractExecutorService, |
| 27 | which we build in a boostrap project which is included in the build |
| 28 | of guava, guava-testlib and guava-tests. |
| 29 | - The Maven build will use a bootstrap rt.jar classpath based on a |
| 30 | standard sun JDK on unix. But this is overridable on a Mac by |
| 31 | passing in `-Dbootstrap.classes=/path/to/my/classes.jar`. Since |
| 32 | the backport will not build with JDK5, a JDK5 `rt.jar` should be used |
| 33 | to ensure that no JDK6+ APIs are used. If you have difficulties |
| 34 | building, please try setting the `bootstrap.classes` property to a |
| 35 | known `rt.jar` or `classes.jar`. |
| 36 | - Some tests will fail when run under JDK5 due to `guava-testlib` and |
| 37 | `guava-tests` having dependencies on other libraries that are compiled |
| 38 | with `-target 1.6`. |