Skip to content

Commit a97cec5

Browse files
committed
IGNITE-24850 Remove unnecessary OSes
1 parent eca2994 commit a97cec5

File tree

3 files changed

+6
-80
lines changed

3 files changed

+6
-80
lines changed

modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java

+5-78
Original file line numberDiff line numberDiff line change
@@ -357,48 +357,12 @@ public abstract class IgniteUtils extends CommonUtils {
357357
/** JDK string. */
358358
private static String jdkStr;
359359

360-
/** Indicates whether current OS is Windows 95. */
361-
private static boolean win95;
362-
363-
/** Indicates whether current OS is Windows 98. */
364-
private static boolean win98;
365-
366-
/** Indicates whether current OS is Windows NT. */
367-
private static boolean winNt;
368-
369-
/** Indicates whether current OS is Windows Vista. */
370-
private static boolean winVista;
371-
372-
/** Indicates whether current OS is Windows 7. */
373-
private static boolean win7;
374-
375-
/** Indicates whether current OS is Windows 8. */
376-
private static boolean win8;
377-
378-
/** Indicates whether current OS is Windows 8.1. */
379-
private static boolean win81;
380-
381360
/** Indicates whether current OS is some version of Windows. */
382-
private static boolean unknownWin;
383-
384-
/** Indicates whether current OS is Windows 2000. */
385-
private static boolean win2k;
386-
387-
/** Indicates whether current OS is Windows XP. */
388-
private static boolean winXp;
389-
390-
/** Indicates whether current OS is Windows Server 2003. */
391-
private static boolean win2003;
392-
393-
/** Indicates whether current OS is Windows Server 2008. */
394-
private static boolean win2008;
361+
private static boolean win;
395362

396363
/** Indicates whether current OS is UNIX flavor. */
397364
private static boolean unix;
398365

399-
/** Indicates whether current OS is Solaris. */
400-
private static boolean solaris;
401-
402366
/** Indicates whether current OS is Linux flavor. */
403367
private static boolean linux;
404368

@@ -601,32 +565,8 @@ public abstract class IgniteUtils extends CommonUtils {
601565
String osLow = osName.toLowerCase();
602566

603567
// OS type detection.
604-
if (osLow.contains("win")) {
605-
if (osLow.contains("95"))
606-
win95 = true;
607-
else if (osLow.contains("98"))
608-
win98 = true;
609-
else if (osLow.contains("nt"))
610-
winNt = true;
611-
else if (osLow.contains("2000"))
612-
win2k = true;
613-
else if (osLow.contains("vista"))
614-
winVista = true;
615-
else if (osLow.contains("xp"))
616-
winXp = true;
617-
else if (osLow.contains("2003"))
618-
win2003 = true;
619-
else if (osLow.contains("2008"))
620-
win2008 = true;
621-
else if (osLow.contains("7"))
622-
win7 = true;
623-
else if (osLow.contains("8.1"))
624-
win81 = true;
625-
else if (osLow.contains("8"))
626-
win8 = true;
627-
else
628-
unknownWin = true;
629-
}
568+
if (osLow.contains("win"))
569+
win = true;
630570
else if (osLow.contains("mac os"))
631571
mac = true;
632572
else {
@@ -638,10 +578,7 @@ else if (osLow.contains("mac os"))
638578
break;
639579
}
640580

641-
// UNIX name detection.
642-
if (osLow.contains("olaris") || osLow.contains("sunos"))
643-
solaris = true;
644-
else if (osLow.contains("inux"))
581+
if (osLow.contains("inux"))
645582
linux = true;
646583
}
647584

@@ -5762,15 +5699,6 @@ public static boolean isMacOs() {
57625699
return mac;
57635700
}
57645701

5765-
/**
5766-
* Indicates whether current OS is Solaris.
5767-
*
5768-
* @return {@code true} if current OS is Solaris (SPARC or x86) - {@code false} otherwise.
5769-
*/
5770-
public static boolean isSolaris() {
5771-
return solaris;
5772-
}
5773-
57745702
/**
57755703
* Indicates whether current OS is UNIX flavor.
57765704
*
@@ -5786,8 +5714,7 @@ public static boolean isUnix() {
57865714
* @return {@code true} if current OS is Windows (any versions) - {@code false} otherwise.
57875715
*/
57885716
public static boolean isWindows() {
5789-
return win7 || win8 || win81 || winXp || win95 || win98 || winNt || win2k ||
5790-
win2003 || win2008 || winVista || unknownWin;
5717+
return win;
57915718
}
57925719

57935720
/**

modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsSelfTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ public void testOs() throws Exception {
240240
System.out.println("Is Windows: " + U.isWindows());
241241
System.out.println("Is Linux: " + U.isLinux());
242242
System.out.println("Is Mac OS: " + U.isMacOs());
243-
System.out.println("Is Solaris: " + U.isSolaris());
244243
}
245244

246245
/**

modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ public void testLoopbackProblemFirstNodeOnLoopback() throws Exception {
12021202
// On Windows and Mac machines two nodes can reside on the same port
12031203
// (if one node has localHost="127.0.0.1" and another has localHost="0.0.0.0").
12041204
// So two nodes do not even discover each other.
1205-
if (U.isWindows() || U.isMacOs() || U.isSolaris())
1205+
if (U.isWindows() || U.isMacOs())
12061206
return;
12071207

12081208
try {

0 commit comments

Comments
 (0)