package oslib.osx;

import java.io.Serializable;

import oslib.Arch;
import oslib.OperatingSystem;
import oslib.UnixOperatingSystem;

public class OSXOperatingSystem extends UnixOperatingSystem implements Serializable {

	private static final long serialVersionUID = 1929142018487788734L;
	
	private OSXVersion version;
	
	public OSXOperatingSystem() {
		this(OSXVersion.getFromString());
	}
	
	public OSXOperatingSystem(OSXVersion version, Arch arch) {
		super(OperatingSystem.OSX, arch);
		this.version = version;
	}
	
	public OSXOperatingSystem(OSXVersion version) {
		this(version, Arch.getArch());
	}
	
	public void setVersion(OSXVersion version) {
		this.version = version;
	}

	public OSXVersion getVersion() {
		return this.version;
	}

	@Override
	public String getDisplayString() {
		String s = "Mac OS X";

		if (version != null) {
			if (version.getDisplay() != null) {
				s += " " + version.getDisplay();
			}

			if (version.getVersion() != null) {
				s += " " + version.getVersion();
			}
		}

		return s;
	}

	@Override
	public String getDetailedString() {
		return this.getDisplayString();
	}

}

@@ -798,23 +798,104 @@
 ing 
-s = %22Mac OS X%22;
+display;%0A%0A%09%09if (version.isOSX()) %7B%0A%09%09%09display = %22Mac OS X%22;%0A%09%09%7D else %7B%0A%09%09%09display = %22macOS%22;%0A%09%09%7D
 %0A%0A%09%09
@@ -952,33 +952,39 @@
  != null) %7B%0A%09%09%09%09
-s
+display
  += %22 %22 + versio
@@ -1048,17 +1048,23 @@
 ) %7B%0A%09%09%09%09
-s
+display
  += %22 %22 
@@ -1106,17 +1106,23 @@
 %09return 
-s
+display
 ;%0A%09%7D%0A%0A%09@

Fix getDisplayString() with macOS