Unverified Commit 718e4b15 authored by Gabry.wu's avatar Gabry.wu Committed by GitHub
Browse files

Adapting partial code(file name start with O) to the sonar cloud rule (#2259)



* Adapting partial code(file name start with O) to the sonar cloud rule

* resolve conflict with dev branch

Co-authored-by: default avatardailidong <dailidong66@gmail.com>
parent 2b174353
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -352,13 +352,7 @@ public class OSUtils {

      return sb.toString();
    } finally {
      if (br != null) {
        try {
          br.close();
        } catch (Exception e) {
          logger.error(e.getMessage(), e);
        }
      }
      IOUtils.closeQuietly(br);
    }
  }

@@ -408,7 +402,7 @@ public class OSUtils {
   * whether is windows
   * @return true if windows
   */
  public static boolean isWindows() { ;
  public static boolean isWindows() {
    return getOSName().startsWith("Windows");
  }

+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public class OSUtilsTest {
    @Test
    public void cpuUsage() throws Exception {
        logger.info("cpuUsage : {}", OSUtils.cpuUsage());
        Thread.sleep(1000l);
        Thread.sleep(1000L);
        logger.info("cpuUsage : {}", OSUtils.cpuUsage());

        double cpuUsage = OSUtils.cpuUsage();