commit cc699dec37eacb7afd00e841322c3ee504510ccc Author: John Sirois Date: Wed Sep 23 16:32:16 2015 -0600 Fixup javadoc errors and add doc gen to CI. .../pantsbuild/jarjar/misplaced/MisplacedClassProcessorFactory.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 646f7f8d4b4fef7466e1a4f1246c60d90e013250 Author: Garrett Malmquist Date: Mon Sep 21 12:01:55 2015 -0400 Make JarJar handle jars with misplaced classes more reasonably. A "misplaced class" here refers to a class whose jar entry path (eg, "org/pantsbuild/Foobar.class") does not match the path implied by its fully-qualified classname. Previously, if you had a (corrupt) jar with a directory containing misplaced classes, jarjar would move all the classes in the so that their directory properly matched their package names. This was simply an undocumented (and probably unconsidered) side-effect of how jar entries are transformed by the JarTransformer. This would cause problems when there already were classes at those locations, and JarJar would explode due to a duplicate jar entries problem that it had constructed itself. With this change, JarJar allows the specification of a "misnamedClassStrategy" variable, which can be "fatal" (for fail-fast exit behavior), "move" (for the previously existing behavior), "skip" (for leaving the class where it is), or "omit" (removing the class from the output jar). This defaults to "omit". A warning is also printed to stderr if the verbose flag is turned on. src/main/org/pantsbuild/jarjar/Main.java | 3 +- src/main/org/pantsbuild/jarjar/MainProcessor.java | 27 ++++++++- .../misplaced/FatalMisplacedClassProcessor.java | 28 +++++++++ .../jarjar/misplaced/MisplacedClassProcessor.java | 64 ++++++++++++++++++++ .../misplaced/MisplacedClassProcessorFactory.java | 68 ++++++++++++++++++++++ .../misplaced/MoveMisplacedClassProcessor.java | 22 +++++++ .../misplaced/OmitMisplacedClassProcessor.java | 21 +++++++ .../misplaced/SkipMisplacedClassProcessor.java | 22 +++++++ .../org/pantsbuild/jarjar/util/EntryStruct.java | 7 +-- .../org/pantsbuild/jarjar/util/JarProcessor.java | 11 ++-- .../pantsbuild/jarjar/util/JarProcessorChain.java | 9 +-- .../org/pantsbuild/jarjar/util/JarTransformer.java | 11 ++-- .../jarjar/util/JarTransformerChain.java | 2 +- 13 files changed, 271 insertions(+), 24 deletions(-)