| 1 | /* | |
| 2 | * Copyright (c) 2014 Maxim Yunusov | |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | * you may not use this file except in compliance with the License. | |
| 5 | * You may obtain a copy of the License at | |
| 6 | * | |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | * | |
| 9 | * Unless required by applicable law or agreed to in writing, software | |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | * See the License for the specific language governing permissions and | |
| 13 | * limitations under the License. | |
| 14 | */ | |
| 15 | ||
| 16 | package org.maxur.perfmodel.backend.utils; | |
| 17 | ||
| 18 | /** | |
| 19 | * @author Maxim | |
| 20 | * @version 1.0 | |
| 21 | * @since <pre>08.11.2014</pre> | |
| 22 | */ | |
| 23 | public final class OsUtils { | |
| 24 | ||
| 25 | /** | |
| 26 | * Util's class. | |
| 27 | */ | |
| 28 | private OsUtils() { | |
| 29 | } | |
| 30 | ||
| 31 | private static String getOsName() { | |
| 32 |
1
1. getOsName : mutated return of Object value for org/maxur/perfmodel/backend/utils/OsUtils::getOsName to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return System.getProperty("os.name").toLowerCase(); |
| 33 | } | |
| 34 | ||
| 35 | public static boolean isWindows() { | |
| 36 |
3
1. isWindows : changed conditional boundary → KILLED 2. isWindows : negated conditional → KILLED 3. isWindows : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return getOsName().indexOf("win") >= 0; |
| 37 | } | |
| 38 | ||
| 39 | public static boolean isMac() { | |
| 40 |
3
1. isMac : changed conditional boundary → KILLED 2. isMac : negated conditional → KILLED 3. isMac : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return getOsName().indexOf("mac") >= 0; |
| 41 | } | |
| 42 | ||
| 43 | public static boolean isUnix() { | |
| 44 |
7
1. isUnix : changed conditional boundary → KILLED 2. isUnix : changed conditional boundary → KILLED 3. isUnix : changed conditional boundary → KILLED 4. isUnix : negated conditional → KILLED 5. isUnix : negated conditional → KILLED 6. isUnix : negated conditional → KILLED 7. isUnix : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return getOsName().indexOf("nix") >= 0 || getOsName().indexOf("nux") >= 0 || getOsName().indexOf("aix") > 0; |
| 45 | } | |
| 46 | ||
| 47 | public static boolean isSolaris() { | |
| 48 |
3
1. isSolaris : changed conditional boundary → KILLED 2. isSolaris : negated conditional → KILLED 3. isSolaris : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return getOsName().indexOf("sunos") >= 0; |
| 49 | } | |
| 50 | ||
| 51 | } | |
Mutations | ||
| 32 |
1.1 |
|
| 36 |
1.1 2.2 3.3 |
|
| 40 |
1.1 2.2 3.3 |
|
| 44 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 |
|
| 48 |
1.1 2.2 3.3 |