Package: checkstyle
Version: 5.7-1

With the release of commons-beanutils 1.9.1 (possibly from commons-beanutils 
1.9.0 itself), the org.apache.commons.collections package was removed from this 
source package, since it was already present in the 
libcommons-collections3-java source package. Because the wrapper script doesn't 
include the latter package in the list of jars to add to the runtime path, 
checkstyle crashes with the following stack trace:

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/commons/collections/FastHashMap
        at 
org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:959)
        at 
org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:388)
        at 
com.puppycrawl.tools.checkstyle.api.AutomaticBean.contextualize(AutomaticBean.java:206)
        at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:156)
        at 
com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
        at com.puppycrawl.tools.checkstyle.Main.createChecker(Main.java:143)
        at com.puppycrawl.tools.checkstyle.Main.main(Main.java:120)
Caused by: java.lang.ClassNotFoundException: 
org.apache.commons.collections.FastHashMap
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 7 more

To fix this, two things need to be done:

1. Edit the wrapper to load the commons-collections3 jar file.
2. Add a dependency on libcommons-collections3-java

In addition, it may be possible to remove the libcommons-beanutils-java 
dependency. A basic test seems to show checkstyle working without the jar file 
loaded at runtime.

I've attached a patch that does the two things above.

See also https://bugs.launchpad.net/ubuntu/+source/checkstyle/+bug/1308794[1]


--
Saikrishna Arcot

--------
[1] https://bugs.launchpad.net/ubuntu/+source/checkstyle/+bug/1308794
=== modified file 'debian/control'
--- debian/control	2013-08-28 18:26:59 +0000
+++ debian/control	2014-04-22 12:05:07 +0000
@@ -9,6 +9,7 @@
                      junit4 (>= 4.8),
                      libantlr-maven-plugin-java,
                      libcommons-beanutils-java (>= 1.5),
+                     libcommons-collections3-java,
                      libcommons-cli-java,
                      libguava-java,
                      libmaven-antrun-plugin-java (>= 1.6),

=== modified file 'debian/wrappers/checkstyle'
--- debian/wrappers/checkstyle	2013-06-17 11:29:36 +0000
+++ debian/wrappers/checkstyle	2014-04-22 12:05:07 +0000
@@ -5,6 +5,6 @@

 find_java_runtime default sunmin5

-find_jars antlr commons-beanutils guava commons-cli commons-logging checkstyle
+find_jars antlr commons-beanutils commons-collections3 guava commons-cli commons-logging checkstyle

 run_java com.puppycrawl.tools.checkstyle.Main "$@"

Attachment: signature.asc
Description: This is a digitally signed message part.

__
This is the maintainer address of Debian's Java team
<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers>. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Reply via email to