From owner-freebsd-java Wed Feb 27 18:55: 3 2002 Delivered-To: freebsd-java@freebsd.org Received: from aiai.ed.ac.uk (eigg.aiai.ed.ac.uk [129.215.41.7]) by hub.freebsd.org (Postfix) with ESMTP id 693F837B400 for ; Wed, 27 Feb 2002 18:54:57 -0800 (PST) Received: from todday (todday.aiai.ed.ac.uk [129.215.105.40]) by aiai.ed.ac.uk (8.9.3/8.9.3) with SMTP id CAA07997; Thu, 28 Feb 2002 02:54:55 GMT Date: Thu, 28 Feb 2002 02:54:54 GMT Message-Id: <27666.200202280254@todday> From: Jeff Dalton Subject: Re: class dependencies (Re: What is ant good for?) To: "Remco van 't Veer" , Christopher Rued In-Reply-To: Remco van 't Veer's message of Wed, 27 Feb 2002 10:01:54 +0100 Cc: Christopher Elkins , Brad Cox , freebsd-java@FreeBSD.ORG Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > I don't know of any source level dependency checkers and I don't > expect there are any. Writing something like that is more > trouble than gain. Consider finding out all possible values of > String in a simple statement like: > > public void addClassByName (String name) > { > classes.add(Class.forName(name)); > } That means it can't be done perfectly, but doesn't on its own show that it's not worth doing an imperfect (but perhaps still useful) version. This sort of issue used to come up all the time in the Lisp world, for various sorts of static analysis people wanted to do, because someone could always do (eval (read)). Nonetheless, it could still be useful to perform an analysis, and I think people often talked themselves out of it when they shouldn't have. javac seems to do a certain amount of simple dependency-related stuff, because it doesn't compile only the files I list on the command line. And there used to be a -depend (later -Xdepend) argument that looked like it did something useful. (Anyone know exactly what it did do?) Anyway, if something derived dependencies from, say, the import statements (plus a set of files that could be assumed to contain all the relevant class definitions), that might be useful. It could even create a makefile (or equiv) that stated the dependencies it found, with the programmer able to provide an explicit list for cases the analyser wouldn't be able to handle; and then the cost of the anaysis would have to be paid every time you wanted to compile. (I'm thinking of how something like "make depend" is used.) -- Jeff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message