(keitai-l) Re: Maybe OT: Java Link & Load Q

From: Curt Sampson <cjs_at_cynic.net>
Date: 09/17/01
Message-ID: <Pine.LNX.4.33.0109171624150.6558-100000@denkigama.nat.shibuya.blink.co.jp>
On Mon, 17 Sep 2001, Gary James wrote:

> > 3.  If my classes (A & B) make use of only one class from package C, is all of
> > package C be included anyway?  What if my classes use only one method of one
> > class?  Would something like Java Blender trim unused stuff (classes & methods)
> > from my i-appli jar?
>
> When I tried using Java Blender it crashed on me.  I'd very very
> interested if there is software that could remove unused
> methods/classes.  Anyone else know any good software for this?

Removing unused methods shouldn't be too difficult for an automated tool
to do, assuming you're not using reflection. Removing unused classes
is rather tougher, because it's really quite hard to tell if a class
is unused. Just because you never explicitly instantiate a class does
not mean that it doesn't get instantiated though something you do,
or because of the settings of various system properties and whatnot.

(For example, anybody who can set the system properties for a VM can
make the JDBC code instantiate arbitrary JDBC drivers, and perhaps other
things too, if you're malicious.)

cjs
-- 
Curt Sampson  <cjs_at_cynic.net>   +81 3 5778 0123   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC


[ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
Received on Mon Sep 17 10:20:28 2001