RFR: 8000975: (process) Merge UNIXProcess.java.bsd & UNIXProcess.java.linux (& .solaris & .aix)

David M. Lloyd david.lloyd at redhat.com
Tue Apr 1 17:23:16 UTC 2014

On 04/01/2014 12:04 PM, Peter Levart wrote:
> On 04/01/2014 05:43 PM, Peter Levart wrote:
>> On 04/01/2014 03:49 PM, roger riggs wrote:
>>> Hi Peter,
>>> The design using enum for the os dependencies does not make it possible
>>> to include only the support needed for a particular platform at build
>>> time.
>>> Every implementation will be carrying around the support for all the
>>> other platforms.
>>> A build time binding would be more efficient.
>>> Roger
>> That's true. A trade-off between maintainability and efficiency. The
>> efficiency has two categories here. One is the size of the
>> distributable and the other is run-time efficiency. I've been thinking
>> to improve both efficiencies (the run-time in particular) with a
>> little re-design. Since nearly each OS platform requires a sub-class
>> of UNIXProcess to implement the differences, I can move the
>> implementations of various methods now in Os enum to the UNIXProcess
>> subclasses and get rid of Os enum per-instance subclasses.
>> Let me try this and see what comes out.
> Hi Roger,
> Well, it turns out the methods would like to stay in Os (renamed to
> Platform), but there is no need for per-enum-instance subclasses. Using
> enum constructor parameters and switch statements makes code even more
> compact and easy to follow...

Is the concern source classes or compiled classes?  IIRC every 
switch-on-enum produces an additional .class file.


More information about the core-libs-dev mailing list