ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rolf F. Katzenberger <>
Subject Re: Code format validation
Date Tue, 15 Jan 2002 12:33:01 GMT
Hi Matthew,

On Mon, 14 Jan 2002 17:49:00 -0600, "Matthew Pullen"
<> wrote:

>unused import statments all over the place. I don't like the
>import blah.* format either.  I was curious if there is an automated way to
>check this in particular using ant, or an add in to ant?  I have tried using
>checkstyle, but it doesn't appear to work with 1.4.

I tried some systems (including importscrubber), but all required
manual intervention.

There is however one reliable solution: I do a pseudo-compile using
the KOPI compiler,

Calling it like this

	<java classname="at.dms.kjc.Main"

		<jvmarg value="-Xms256M" />
		<jvmarg value="-Xmx256M" />
		<arg value="--nowrite" />
		<arg value="-w999" />
		<arg value="@${}"	/>
		<arg value="-C${project.classpath}"	/>

			<pathelement location="kjc-1.5A-bin.jar" />

setting the warning level to 999 and logging all output to a file. The
log contains also warnings about replacing "import blah.*;" with
imports of "blah.mayclass1, blah.myclass2,...". I found these warnings
to be reliable at all times.

However, KOPI accepts the "*" if more than 4 (or 5?) classes from the
same package get imported. But since KOPI is open source, there might
be a way to tweak the sources to remove this limit.

Best regards,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message