Toward Condensers

Paul Sandoz paul.sandoz at oracle.com
Mon Aug 14 17:46:09 UTC 2023



> On Aug 1, 2023, at 2:00 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> 
> 
> 
> On 8/1/2023 4:34 PM, Dan Heidinga wrote:
> 
>> * In the "Data model" section, how are duplicate classes on the classpath handled?  Are Containers representing JARs on the classpath explicitly ordered so as to linearize them to ensure the earliest definition of a class wins?  Does the model need to expose the classpath ordering?
> 
> The application model gives us a list of modules and a list of classpath entries.  Since multi-valued attributes preserve their order, this should be enough to preserve the existing story: that modules represent a partition of packages, and we resolve conflicts on the classpath with "first wins".  (We can also have condensers that assert properties like "no duplicates".)
> 
>> Is ContainerKind missing a "directory" type as well?  It might be possible to pretend a filesystem directory on the CP is a JAR for model purposes, but that doesn't feel quite right.  Did you consider directories when making the model? If they were deliberately excluded it might help to expand on why in the document.
> 
> I'll defer this one to Paul.
> 

The model deliberately did not try to model the tree structure of packages/resources. It’s not a file system and modeling it as such would I think be misleading. A tree structure could be produced, if needed, as a view of the model from the names of container elements (and potentially for other kinds of views). 

An exploded jar (bad name) or the equivalent (zipped) jar are indistinguishable in the model (same for exploded modular jar and modular jar).



>> Should the Data model include "classloader" as a member? With modules we can map which module will be loaded by which classloader and can guess for most classpath entries.  For more complicated classloading schemes (including self-first), it might be beneficial to model the classloader network in the model as well.  This may be something that a non-standard condenser could augment the model / analysis with.
> 
> Good question!  Not sure yet.
> 

Me neither. What do you envisage a condenser might do with such knowledge? 


>> * In "Example: Lambda forms" contains the following sentence
>> > After condensing we can update the java.base module on the file system from the updated application model.
>> 
>> which should probably delegate the updating of the file system to the Distiller.  Given the prohibition against filesystem access in the "The application model" section, talking about the filesystem here seems odd.
> 
> This seems like an error in the doc.  Will investigate.
> 
>> I'm looking forward to seeing the prototype and trying to port my pregenerate lambdas jlink plugin to be a condenser.  I think it should be a fairly smooth process.
> 
> Indeed, I think that will be a good validation test, and I expect it will go smoothly.
> 

Yes, it should slot right in.

Paul.


More information about the leyden-dev mailing list