felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick_Hofst...@inventivedesigners.com
Subject Re: Fixed bug in class loading
Date Wed, 12 Apr 2006 09:20:58 GMT

> Peter Kriens wrote:
> > RSH> My desire is not to cause people using Felix any undue pain.
> I certainly
> > RSH> want Felix to work properly out of the box, but how will we ever
> > RSH> about these issues and improve the situation if we never try?
> > Maybe you can log any delegation to the bootclasspath as a warning?
> >
> Yes, that is a possibility. However, the Swing LAF example that was
> resolved without needing to import "com.sun.*" or "sun.*" is really
> telling. By exposing these hidden dependencies in a more strict way,
> then we can actually learn something from them. Making them too easy to
> ignore just creates more of the same issues.
> Still, I agree that we should try to make being more strict as painless
> as possible. Another possible approach is for us to try to improve
> Felix' error diagnostics when a class loading error occurs. For example,
> we could:
>     * Check to see if there are exporters of the package, but no import
>       and suggest adding it to the Import-Package declaration.
>     * Check to see if the class is available from the system class
>       loader and suggest adding the package to the system bundle's
>     * Check to see if the class is being loaded using
>       ClassLoader.loadClassInternal() by examing the stack trace and
>       suggest to add the package to the boot delegation property.
> Perhaps there are other possible diagnostics that could help developers
> when they encounter a class loading error.
> -> richard

Sounds like a very good idea to me.
I also think the suggested checks cover most cases, but I'll try to think
of other cases we might check for.
Still the danger of people adding things to the boot delegation property
while they could've/should've made it work without it, but that can't be
helped I'm afraid.


Inventive Designers' Email Disclaimer:


View raw message