elharo commented on code in PR #1208:
URL: https://github.com/apache/maven/pull/1208#discussion_r1316362150


##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,383 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
+/*
+ * This class is copied from maven-shared-utils.
+ *
+ * This class was copied over from Apache ANT.
+ * Even the version from plexus-utils was
+ * only an ANT fork!
+ * The last time it got copied was on 2011-08-12</p>
+ * When merging changes please take care of the special
+ * OS_FAMILY handling in this version of Os.java!
+ */
+
+/**
+ * <p>Condition that tests the OS type.</p>
+ *
+ * @author Stefan Bodewig
+ * @author Magesh Umasankar
+ * @author Brian Fox
+ * @author Mark Struberg
+ */
+public class Os {
+    /**
+     * The OS Name.
+     */
+    public static final String OS_NAME = 
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OA architecture.
+     */
+    public static final String OS_ARCH = 
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OS version.
+     */
+    public static final String OS_VERSION = 
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The path separator.
+     */
+    public static final String PATH_SEP = System.getProperty("path.separator");
+
+    /**
+     * system line separator , e.g. &quot;\n&quot; on unixoid systems and 
&quot;\r\n&quot; on Windows
+     */
+    public static final String LINE_SEP = System.getProperty("line.separator");
+
+    /**
+     * OS Family
+     */
+    public static final String OS_FAMILY = getOsFamily();
+
+    // store the valid families
+    private static final Set<String> VALID_FAMILIES = getValidFamilies();
+
+    /**
+     * OS family to look for
+     */
+    private String family;
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WINDOWS = "windows";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WIN9X = "win9x";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NT = "winnt";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS2 = "os/2";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NETWARE = "netware";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_DOS = "dos";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_MAC = "mac";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_TANDEM = "tandem";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_UNIX = "unix";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OPENVMS = "openvms";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_ZOS = "z/os";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS400 = "os/400";
+
+    /**
+     * OpenJDK is reported to call MacOS X "Darwin"
+     *
+     * @see <a 
href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44889";>bugzilla 
issue</a>
+     * @see <a 
href="https://issues.apache.org/jira/browse/HADOOP-3318";>HADOOP-3318</a>
+     */
+    private static final String DARWIN = "darwin";
+
+    /**
+     * The set of valid families. This methods initializes the set until
+     * VALID_FAMILIES constant is set.
+     * @return The set of families.
+     */
+    public static Set<String> getValidFamilies() {
+        if (VALID_FAMILIES != null) {
+            return VALID_FAMILIES;
+        }
+
+        Set<String> valid = new HashSet<>();
+        valid.add(FAMILY_DOS);
+        valid.add(FAMILY_MAC);
+        valid.add(FAMILY_NETWARE);
+        valid.add(FAMILY_NT);
+        valid.add(FAMILY_OPENVMS);
+        valid.add(FAMILY_OS2);
+        valid.add(FAMILY_OS400);
+        valid.add(FAMILY_TANDEM);
+        valid.add(FAMILY_UNIX);
+        valid.add(FAMILY_WIN9X);
+        valid.add(FAMILY_WINDOWS);
+        valid.add(FAMILY_ZOS);
+
+        return Collections.unmodifiableSet(valid);
+    }
+
+    /**
+     * Default constructor
+     */
+    public Os() {
+        // default
+    }
+
+    /**
+     * Constructor that sets the family attribute
+     *
+     * @param family a String value
+     */
+    public Os(String family) {
+        setFamily(family);
+    }
+
+    /**
+     * Sets the desired OS family type
+     *
+     * @param f The OS family type desired<br />
+     *          Possible values:<br />
+     *          <ul>
+     *          <li>dos</li>
+     *          <li>mac</li>
+     *          <li>netware</li>
+     *          <li>os/2</li>
+     *          <li>tandem</li>
+     *          <li>unix</li>
+     *          <li>windows</li>
+     *          <li>win9x</li>
+     *          <li>z/os</li>
+     *          <li>os/400</li>
+     *          </ul>
+     */
+    private void setFamily(String f) {

Review Comment:
   Noticing a bug now. Any family can be set, valid or not. This class really 
isn't OK. Move to a separate PR where the changes that involve this can get 
more attention. 



##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,383 @@
+/*

Review Comment:
   It's public, not just an implementation detail, so I think more care is 
warranted. If it can be made non-public it can be cleaned up later, but we 
should be cautious about locking in APIs we don't need and don't want to 
support long term. 



##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,383 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
+/*
+ * This class is copied from maven-shared-utils.
+ *
+ * This class was copied over from Apache ANT.
+ * Even the version from plexus-utils was
+ * only an ANT fork!
+ * The last time it got copied was on 2011-08-12</p>
+ * When merging changes please take care of the special
+ * OS_FAMILY handling in this version of Os.java!
+ */
+
+/**
+ * <p>Condition that tests the OS type.</p>
+ *
+ * @author Stefan Bodewig
+ * @author Magesh Umasankar
+ * @author Brian Fox
+ * @author Mark Struberg
+ */
+public class Os {
+    /**
+     * The OS Name.
+     */
+    public static final String OS_NAME = 
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OA architecture.
+     */
+    public static final String OS_ARCH = 
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OS version.
+     */
+    public static final String OS_VERSION = 
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The path separator.
+     */
+    public static final String PATH_SEP = System.getProperty("path.separator");
+
+    /**
+     * system line separator , e.g. &quot;\n&quot; on unixoid systems and 
&quot;\r\n&quot; on Windows
+     */
+    public static final String LINE_SEP = System.getProperty("line.separator");
+
+    /**
+     * OS Family
+     */
+    public static final String OS_FAMILY = getOsFamily();
+
+    // store the valid families
+    private static final Set<String> VALID_FAMILIES = getValidFamilies();
+
+    /**
+     * OS family to look for
+     */
+    private String family;
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WINDOWS = "windows";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WIN9X = "win9x";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NT = "winnt";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS2 = "os/2";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NETWARE = "netware";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_DOS = "dos";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_MAC = "mac";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_TANDEM = "tandem";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_UNIX = "unix";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OPENVMS = "openvms";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_ZOS = "z/os";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS400 = "os/400";
+
+    /**
+     * OpenJDK is reported to call MacOS X "Darwin"
+     *
+     * @see <a 
href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44889";>bugzilla 
issue</a>
+     * @see <a 
href="https://issues.apache.org/jira/browse/HADOOP-3318";>HADOOP-3318</a>
+     */
+    private static final String DARWIN = "darwin";
+
+    /**
+     * The set of valid families. This methods initializes the set until
+     * VALID_FAMILIES constant is set.
+     * @return The set of families.
+     */
+    public static Set<String> getValidFamilies() {
+        if (VALID_FAMILIES != null) {
+            return VALID_FAMILIES;
+        }
+
+        Set<String> valid = new HashSet<>();
+        valid.add(FAMILY_DOS);
+        valid.add(FAMILY_MAC);
+        valid.add(FAMILY_NETWARE);
+        valid.add(FAMILY_NT);
+        valid.add(FAMILY_OPENVMS);
+        valid.add(FAMILY_OS2);
+        valid.add(FAMILY_OS400);
+        valid.add(FAMILY_TANDEM);
+        valid.add(FAMILY_UNIX);
+        valid.add(FAMILY_WIN9X);
+        valid.add(FAMILY_WINDOWS);
+        valid.add(FAMILY_ZOS);
+
+        return Collections.unmodifiableSet(valid);
+    }
+
+    /**
+     * Default constructor
+     */
+    public Os() {
+        // default
+    }
+
+    /**
+     * Constructor that sets the family attribute
+     *
+     * @param family a String value
+     */
+    public Os(String family) {
+        setFamily(family);
+    }
+
+    /**
+     * Sets the desired OS family type
+     *
+     * @param f The OS family type desired<br />
+     *          Possible values:<br />
+     *          <ul>
+     *          <li>dos</li>
+     *          <li>mac</li>
+     *          <li>netware</li>
+     *          <li>os/2</li>
+     *          <li>tandem</li>
+     *          <li>unix</li>
+     *          <li>windows</li>
+     *          <li>win9x</li>
+     *          <li>z/os</li>
+     *          <li>os/400</li>
+     *          </ul>
+     */
+    private void setFamily(String f) {
+        family = f.toLowerCase(Locale.ENGLISH);
+    }
+
+    /**
+     * Determines if the OS on which Ant is executing matches the type of

Review Comment:
   Comment is wrong



##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,383 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
+/*
+ * This class is copied from maven-shared-utils.
+ *
+ * This class was copied over from Apache ANT.
+ * Even the version from plexus-utils was
+ * only an ANT fork!
+ * The last time it got copied was on 2011-08-12</p>
+ * When merging changes please take care of the special
+ * OS_FAMILY handling in this version of Os.java!
+ */
+
+/**
+ * <p>Condition that tests the OS type.</p>
+ *
+ * @author Stefan Bodewig
+ * @author Magesh Umasankar
+ * @author Brian Fox
+ * @author Mark Struberg
+ */
+public class Os {
+    /**
+     * The OS Name.
+     */
+    public static final String OS_NAME = 
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OA architecture.
+     */
+    public static final String OS_ARCH = 
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OS version.
+     */
+    public static final String OS_VERSION = 
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The path separator.
+     */
+    public static final String PATH_SEP = System.getProperty("path.separator");
+
+    /**
+     * system line separator , e.g. &quot;\n&quot; on unixoid systems and 
&quot;\r\n&quot; on Windows
+     */
+    public static final String LINE_SEP = System.getProperty("line.separator");
+
+    /**
+     * OS Family
+     */
+    public static final String OS_FAMILY = getOsFamily();
+
+    // store the valid families
+    private static final Set<String> VALID_FAMILIES = getValidFamilies();
+
+    /**
+     * OS family to look for
+     */
+    private String family;
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WINDOWS = "windows";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WIN9X = "win9x";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NT = "winnt";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS2 = "os/2";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NETWARE = "netware";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_DOS = "dos";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_MAC = "mac";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_TANDEM = "tandem";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_UNIX = "unix";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OPENVMS = "openvms";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_ZOS = "z/os";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS400 = "os/400";
+
+    /**
+     * OpenJDK is reported to call MacOS X "Darwin"
+     *
+     * @see <a 
href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44889";>bugzilla 
issue</a>
+     * @see <a 
href="https://issues.apache.org/jira/browse/HADOOP-3318";>HADOOP-3318</a>
+     */
+    private static final String DARWIN = "darwin";
+
+    /**
+     * The set of valid families. This methods initializes the set until
+     * VALID_FAMILIES constant is set.
+     * @return The set of families.
+     */
+    public static Set<String> getValidFamilies() {
+        if (VALID_FAMILIES != null) {
+            return VALID_FAMILIES;
+        }
+
+        Set<String> valid = new HashSet<>();
+        valid.add(FAMILY_DOS);
+        valid.add(FAMILY_MAC);
+        valid.add(FAMILY_NETWARE);
+        valid.add(FAMILY_NT);
+        valid.add(FAMILY_OPENVMS);
+        valid.add(FAMILY_OS2);
+        valid.add(FAMILY_OS400);
+        valid.add(FAMILY_TANDEM);
+        valid.add(FAMILY_UNIX);
+        valid.add(FAMILY_WIN9X);
+        valid.add(FAMILY_WINDOWS);
+        valid.add(FAMILY_ZOS);
+
+        return Collections.unmodifiableSet(valid);
+    }
+
+    /**
+     * Default constructor
+     */
+    public Os() {
+        // default
+    }
+
+    /**
+     * Constructor that sets the family attribute
+     *
+     * @param family a String value
+     */
+    public Os(String family) {
+        setFamily(family);
+    }
+
+    /**
+     * Sets the desired OS family type
+     *
+     * @param f The OS family type desired<br />
+     *          Possible values:<br />
+     *          <ul>
+     *          <li>dos</li>
+     *          <li>mac</li>
+     *          <li>netware</li>
+     *          <li>os/2</li>
+     *          <li>tandem</li>
+     *          <li>unix</li>
+     *          <li>windows</li>
+     *          <li>win9x</li>
+     *          <li>z/os</li>
+     *          <li>os/400</li>
+     *          </ul>
+     */
+    private void setFamily(String f) {
+        family = f.toLowerCase(Locale.ENGLISH);
+    }
+
+    /**
+     * Determines if the OS on which Ant is executing matches the type of
+     * that set in setFamily.
+     *
+     * @return true if the os matches.
+     * @see Os#setFamily(String)
+     */
+    boolean eval() {
+        return isOs(family, null, null, null);
+    }
+
+    /**
+     * Determines if the OS on which Ant is executing matches the
+     * given OS family.
+     *
+     * @param family the family to check for
+     * @return true if the OS matches
+     *
+     */
+    public static boolean isFamily(String family) {
+        return isOs(family, null, null, null);
+    }
+
+    /**
+     * Determines if the OS on which Ant is executing matches the
+     * given OS name.
+     *
+     * @param name the OS name to check for
+     * @return true if the OS matches
+     *
+     */
+    public static boolean isName(String name) {
+        return isOs(null, name, null, null);
+    }
+
+    /**
+     * Determines if the OS on which Ant is executing matches the

Review Comment:
   and yet again



##########
maven-model-builder/src/main/java/org/apache/maven/utils/Os.java:
##########
@@ -0,0 +1,383 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.utils;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
+/*
+ * This class is copied from maven-shared-utils.
+ *
+ * This class was copied over from Apache ANT.
+ * Even the version from plexus-utils was
+ * only an ANT fork!
+ * The last time it got copied was on 2011-08-12</p>
+ * When merging changes please take care of the special
+ * OS_FAMILY handling in this version of Os.java!
+ */
+
+/**
+ * <p>Condition that tests the OS type.</p>
+ *
+ * @author Stefan Bodewig
+ * @author Magesh Umasankar
+ * @author Brian Fox
+ * @author Mark Struberg
+ */
+public class Os {
+    /**
+     * The OS Name.
+     */
+    public static final String OS_NAME = 
System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OA architecture.
+     */
+    public static final String OS_ARCH = 
System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The OS version.
+     */
+    public static final String OS_VERSION = 
System.getProperty("os.version").toLowerCase(Locale.ENGLISH);
+
+    /**
+     * The path separator.
+     */
+    public static final String PATH_SEP = System.getProperty("path.separator");
+
+    /**
+     * system line separator , e.g. &quot;\n&quot; on unixoid systems and 
&quot;\r\n&quot; on Windows
+     */
+    public static final String LINE_SEP = System.getProperty("line.separator");
+
+    /**
+     * OS Family
+     */
+    public static final String OS_FAMILY = getOsFamily();
+
+    // store the valid families
+    private static final Set<String> VALID_FAMILIES = getValidFamilies();
+
+    /**
+     * OS family to look for
+     */
+    private String family;
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WINDOWS = "windows";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_WIN9X = "win9x";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NT = "winnt";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS2 = "os/2";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_NETWARE = "netware";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_DOS = "dos";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_MAC = "mac";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_TANDEM = "tandem";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_UNIX = "unix";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OPENVMS = "openvms";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_ZOS = "z/os";
+
+    /**
+     * OS family that can be tested for. {@value}
+     */
+    public static final String FAMILY_OS400 = "os/400";
+
+    /**
+     * OpenJDK is reported to call MacOS X "Darwin"
+     *
+     * @see <a 
href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44889";>bugzilla 
issue</a>
+     * @see <a 
href="https://issues.apache.org/jira/browse/HADOOP-3318";>HADOOP-3318</a>
+     */
+    private static final String DARWIN = "darwin";
+
+    /**
+     * The set of valid families. This methods initializes the set until
+     * VALID_FAMILIES constant is set.
+     * @return The set of families.
+     */
+    public static Set<String> getValidFamilies() {
+        if (VALID_FAMILIES != null) {
+            return VALID_FAMILIES;
+        }
+
+        Set<String> valid = new HashSet<>();
+        valid.add(FAMILY_DOS);
+        valid.add(FAMILY_MAC);
+        valid.add(FAMILY_NETWARE);
+        valid.add(FAMILY_NT);
+        valid.add(FAMILY_OPENVMS);
+        valid.add(FAMILY_OS2);
+        valid.add(FAMILY_OS400);
+        valid.add(FAMILY_TANDEM);
+        valid.add(FAMILY_UNIX);
+        valid.add(FAMILY_WIN9X);
+        valid.add(FAMILY_WINDOWS);
+        valid.add(FAMILY_ZOS);
+
+        return Collections.unmodifiableSet(valid);
+    }
+
+    /**
+     * Default constructor
+     */
+    public Os() {
+        // default
+    }
+
+    /**
+     * Constructor that sets the family attribute
+     *
+     * @param family a String value
+     */
+    public Os(String family) {
+        setFamily(family);
+    }
+
+    /**
+     * Sets the desired OS family type
+     *
+     * @param f The OS family type desired<br />
+     *          Possible values:<br />
+     *          <ul>
+     *          <li>dos</li>
+     *          <li>mac</li>
+     *          <li>netware</li>
+     *          <li>os/2</li>
+     *          <li>tandem</li>
+     *          <li>unix</li>
+     *          <li>windows</li>
+     *          <li>win9x</li>
+     *          <li>z/os</li>
+     *          <li>os/400</li>
+     *          </ul>
+     */
+    private void setFamily(String f) {
+        family = f.toLowerCase(Locale.ENGLISH);
+    }
+
+    /**
+     * Determines if the OS on which Ant is executing matches the type of
+     * that set in setFamily.
+     *
+     * @return true if the os matches.
+     * @see Os#setFamily(String)
+     */
+    boolean eval() {
+        return isOs(family, null, null, null);
+    }
+
+    /**
+     * Determines if the OS on which Ant is executing matches the

Review Comment:
   Ant, again



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to