RFR: 8000975: Merge UNIXProcess.java.bsd & UNIXProcess.java.linux

Martin Buchholz martinrb at google.com
Sun Oct 21 19:02:22 UTC 2012


On Tue, Oct 16, 2012 at 9:15 AM, Rob McKenna <rob.mckenna at oracle.com> wrote:

> It has been suggested to me (at least twice at this stage) that these
> files should be merged since they're identical. This requires an adjustment
> in perspective from "every platform should have its own implementation"


I've always been strongly opposed to  "every platform should have its own
implementation", since it tends to violate DRY for insufficient
justification.  I would (heretically!) like Java more if there were more
facilities for writing a single source file targeting slightly different
platforms.

 ifeq ($(OPENJDK_TARGET_OS_API),posix)
-    UPSUFFIX:=$(OPENJDK_TARGET_OS)
-    ifeq ($(OPENJDK_TARGET_OS),macosx)
-        UPSUFFIX:=bsd
+    UPSUFFIX:=posix
+    ifeq ($(OPENJDK_TARGET_OS),solaris)
+        UPSUFFIX:=solaris
     endif


I'm inclined to structure things as in the other makefile

if solaris

  solaris code here...

else

  general unix code here ...

endif



More information about the core-libs-dev mailing list