Re: Strange exception when running checkstyle

Mark Wielaard <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.xml
Message-ID <[email protected]>
Hi,

On Tue, 2004-12-28 at 00:30 +0100, Michael Koch wrote:
> I tried to run checkstyle with jamvm-1.2.3/classpath-cvs. I get the 
> following exception:
> 
> Error loading configuration file
> com.puppycrawl.tools.checkstyle.api.CheckstyleException: unable to 
> parse scripts/checkstyle-config.xml - No base URI; hope URI is 
> absolute: 
> http://members.iinet.net.au/~oburn/dtds/configuration_1_2.dtd:4:64

On irc we debugged this a little more. The main problem is that
checkstyle has a ErrorHandler that just throws the exception when it
gets a warnings. So on the one hand it does get what it asks for. On the
other hand the warnings are a bit pedantic since in this case the URI is
absolute it seems.

Removing these two warnings made Checkstyle work just fine:

In SAXDriver.java (648)
            if (baseURI == null) {
                warn ("No base URI; hope this SYSTEM id is absolute: "
                        + systemId);
                return new URL (systemId).toString ();

In XmlParser.java (2811)
            if (ids [2] == null)
                handler.warn ("No base URI; hope URI is absolute: "
                        + ids [1]);

It seems to make sense to actually test whether the System id or base
URI is actually a absolute URI and then not emit the warning.

Cheers,

Mark

_______________________________________________
Classpathx-xml mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpathx-xml
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBB0RZ5xVhZCJWr9QwRAnSTAJ9ZfZzApJ5tCUHYjMJGeCfJCbTCHQCfUv29
seHUelLAruARxR58Klu5hfY=
=nK2b
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.