Manju Anand wrote:
>
> I get this error for a few packages saying:
>
> Unable to identify class name in source file:
> "path name/abc.java"
>
> I tried the latest version of JDepend and it still gives me
> the error. I use JDepend on source files directly. I did read
> the message where it says use class files instead. But is there
> a workaround other than using class files as it is not easy for
> me to get class files.
>
Well, the _latest_ version of JDepend doesn't support source file
parsing. :-)
The error you're observing is due to JDepend not being able to parse the
class name from the source file. I suspect the class declaration is
formatted in a way that JDepend doesn't quite comprende. For example,
it has trouble parsing multi-line class declarations.
You might try comparing those classes that don't parse correctly with
those that do, then reconciling the formatting. Or you can privately
send me a copy of the class header and I'll suggest reformatting.
This is a prime example of why source-file parsing was deprecated. So
you have source files, but can't generate class files?
>
> This is another error I get in the output of JDepend:
>
> --------------------------------------------------
> - Package: "package name"
> --------------------------------------------------
> No stats available: package referenced, but not analyzed.
>
> Why does this error occur? Is there any workaround it?
>
This message isn't necessarily an error. It generally means that a
class references (e.g. imports) a package and that referenced package
wasn't analyzed. That is, the package wasn't found in the analyzed
directory (or sub-directory), and therefore JDepend couldn't report on
the package's metrics.
The solution is to specify all directories that contain classes you want
JDepend to analyze, as in:
java jdepend.textui.JDepend directory1 directory2 ...
Hope that helps.
Mike
--
Mike Clark
http://clarkware.com
(303) 589-3812