Pārlūkot izejas kodu

Merge branch 'rc-2023.2.1' of public/ls-standard-library-jni into main

patrick-christopher.mattulat 11 mēneši atpakaļ
vecāks
revīzija
59b5b279d5

+ 14 - 0
LICENSE.MIT

@@ -0,0 +1,14 @@
+Copyright (c) 2023 Patrick-Christopher Mattulat (webmaster@lynarstudios.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 16 - 3
README.md

@@ -1,4 +1,4 @@
-# Lynar Studios - Standard Library - JNI - 2023.2.0 #
+# Lynar Studios - Standard Library - JNI - 2023.2.1 #
 
 
 This library has __Java Native Interface__ (JNI) bindings to selective functionalities of the C++ counterpart library "Lynar Studios - Standard Library". The purpose of this Java library is to provide functionalities within the Java world, you'd usually miss.
 This library has __Java Native Interface__ (JNI) bindings to selective functionalities of the C++ counterpart library "Lynar Studios - Standard Library". The purpose of this Java library is to provide functionalities within the Java world, you'd usually miss.
 
 
@@ -10,12 +10,25 @@ The following modules are supported via the Java Native Interface:
 
 
 The time module currently provides functionalities to set the local system time.
 The time module currently provides functionalities to set the local system time.
 
 
+### ChangeLog ###
+##### Features #####
+
+- none
+
+##### Improvements #####
+
+- ran SonarLint static code analysis and fixed most findings
+
+##### Fixes #####
+
+- none
+
 ### Setup ###
 ### Setup ###
 
 
 In order to use the C++ library's functionalities in a Java application the required binary file(s) must be available on the system in use.
 In order to use the C++ library's functionalities in a Java application the required binary file(s) must be available on the system in use.
 
 
 For that the binary file has to be located in the operating system's library path location.  
 For that the binary file has to be located in the operating system's library path location.  
-e.g. __libls-std-time.so__ must be located in __/user/lib__ location on Linux systems 
+e.g. __libls-std-time.so__ must be located in __/usr/lib__ location on Linux systems 
 
 
 ### Build ###
 ### Build ###
 
 
@@ -25,7 +38,7 @@ Compilation of this library requires the following prerequisites to be in place:
 |--------------------------------------------------------------|------------------------------------------------------------------------------------------|
 |--------------------------------------------------------------|------------------------------------------------------------------------------------------|
 | Maven                                                        | this is the library's build tool and is required in version __3.6.x__                    |
 | Maven                                                        | this is the library's build tool and is required in version __3.6.x__                    |
 | Java Development Kit (JDK)                                   | this library uses JDK-11                                                                 |
 | Java Development Kit (JDK)                                   | this library uses JDK-11                                                                 |
-| Lynar Studios - Standard Library - Time Module (ls-std-time) | this is the native shared library, required on the system in use in version __2023.2.0__ |
+| Lynar Studios - Standard Library - Time Module (ls-std-time) | this is the native shared library, required on the system in use in version __2023.2.1__ |
 
 
 If your system fulfills these prerequisites, compiling the Java library is simple - navigate to the project's root directory and use the following maven command:
 If your system fulfills these prerequisites, compiling the Java library is simple - navigate to the project's root directory and use the following maven command:
 
 

+ 2 - 2
src/main/java/com/lynarstudios/ls/std/time/Library.java

@@ -4,8 +4,8 @@ public class Library
 {
 {
   public final String getBinaryName()
   public final String getBinaryName()
   {
   {
-    return binaryName;
+    return BINARY_NAME;
   }
   }
 
 
-  private static final String binaryName = "ls-std-time";
+  private static final String BINARY_NAME = "ls-std-time";
 }
 }

+ 3 - 1
src/main/java/com/lynarstudios/ls/std/time/systemtime/LocalDateTimeConverter.java

@@ -1,7 +1,6 @@
 package com.lynarstudios.ls.std.time.systemtime;
 package com.lynarstudios.ls.std.time.systemtime;
 
 
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
-import java.time.ZoneId;
 
 
 public class LocalDateTimeConverter
 public class LocalDateTimeConverter
 {
 {
@@ -17,4 +16,7 @@ public class LocalDateTimeConverter
 
 
     return dateParameter;
     return dateParameter;
   }
   }
+
+  private LocalDateTimeConverter()
+  {}
 }
 }

+ 2 - 2
src/test/java/com/lynarstudios/ls/std/time/LibraryTest.java

@@ -3,10 +3,10 @@ package com.lynarstudios.ls.std.time;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 
 
-public class LibraryTest
+class LibraryTest
 {
 {
   @Test
   @Test
-  public void getBinaryName()
+  void getBinaryName()
   {
   {
     Assertions.assertEquals("ls-std-time", new Library().getBinaryName());
     Assertions.assertEquals("ls-std-time", new Library().getBinaryName());
   }
   }

+ 13 - 13
src/test/java/com/lynarstudios/ls/std/time/systemtime/DateParameterTest.java

@@ -8,7 +8,7 @@ class DateParameterTest
   private final DateParameter parameter = new DateParameter();
   private final DateParameter parameter = new DateParameter();
 
 
   @Test
   @Test
-  public void constructor()
+  void constructor()
   {
   {
     DateParameter dateParameter = new DateParameter(1989, (byte) 6, (byte) 1, (byte) 10, (byte) 52, (byte) 22);
     DateParameter dateParameter = new DateParameter(1989, (byte) 6, (byte) 1, (byte) 10, (byte) 52, (byte) 22);
 
 
@@ -21,78 +21,78 @@ class DateParameterTest
   }
   }
 
 
   @Test
   @Test
-  public void getDay()
+  void getDay()
   {
   {
     Assertions.assertEquals(0, this.parameter.getDay());
     Assertions.assertEquals(0, this.parameter.getDay());
   }
   }
 
 
   @Test
   @Test
-  public void getHour()
+  void getHour()
   {
   {
     Assertions.assertEquals(0, this.parameter.getHour());
     Assertions.assertEquals(0, this.parameter.getHour());
   }
   }
 
 
   @Test
   @Test
-  public void getMinute()
+  void getMinute()
   {
   {
     Assertions.assertEquals(0, this.parameter.getMinute());
     Assertions.assertEquals(0, this.parameter.getMinute());
   }
   }
 
 
   @Test
   @Test
-  public void getMonth()
+  void getMonth()
   {
   {
     Assertions.assertEquals(0, this.parameter.getMonth());
     Assertions.assertEquals(0, this.parameter.getMonth());
   }
   }
 
 
   @Test
   @Test
-  public void getSecond()
+  void getSecond()
   {
   {
     Assertions.assertEquals(0, this.parameter.getSecond());
     Assertions.assertEquals(0, this.parameter.getSecond());
   }
   }
 
 
   @Test
   @Test
-  public void getYear()
+  void getYear()
   {
   {
     Assertions.assertEquals(0, this.parameter.getYear());
     Assertions.assertEquals(0, this.parameter.getYear());
   }
   }
 
 
   @Test
   @Test
-  public void setDay()
+  void setDay()
   {
   {
     this.parameter.setDay((byte) 1);
     this.parameter.setDay((byte) 1);
     Assertions.assertEquals(1, this.parameter.getDay());
     Assertions.assertEquals(1, this.parameter.getDay());
   }
   }
 
 
   @Test
   @Test
-  public void setHour()
+  void setHour()
   {
   {
     this.parameter.setHour((byte) 10);
     this.parameter.setHour((byte) 10);
     Assertions.assertEquals(10, this.parameter.getHour());
     Assertions.assertEquals(10, this.parameter.getHour());
   }
   }
 
 
   @Test
   @Test
-  public void setMinute()
+  void setMinute()
   {
   {
     this.parameter.setMinute((byte) 52);
     this.parameter.setMinute((byte) 52);
     Assertions.assertEquals(52, this.parameter.getMinute());
     Assertions.assertEquals(52, this.parameter.getMinute());
   }
   }
 
 
   @Test
   @Test
-  public void setMonth()
+  void setMonth()
   {
   {
     this.parameter.setMonth((byte) 6);
     this.parameter.setMonth((byte) 6);
     Assertions.assertEquals(6, this.parameter.getMonth());
     Assertions.assertEquals(6, this.parameter.getMonth());
   }
   }
 
 
   @Test
   @Test
-  public void setSecond()
+  void setSecond()
   {
   {
     this.parameter.setSecond((byte) 22);
     this.parameter.setSecond((byte) 22);
     Assertions.assertEquals(22, this.parameter.getSecond());
     Assertions.assertEquals(22, this.parameter.getSecond());
   }
   }
 
 
   @Test
   @Test
-  public void setYear()
+  void setYear()
   {
   {
     this.parameter.setYear(1989);
     this.parameter.setYear(1989);
     Assertions.assertEquals(1989, this.parameter.getYear());
     Assertions.assertEquals(1989, this.parameter.getYear());

+ 1 - 1
src/test/java/com/lynarstudios/ls/std/time/systemtime/LocalDateTimeConverterTest.java

@@ -8,7 +8,7 @@ import java.time.LocalDateTime;
 class LocalDateTimeConverterTest
 class LocalDateTimeConverterTest
 {
 {
   @Test
   @Test
-  public void toDateParameter()
+  void toDateParameter()
   {
   {
     LocalDateTime localDateTime = LocalDateTime.of(2030, 6, 1, 10, 55, 13);
     LocalDateTime localDateTime = LocalDateTime.of(2030, 6, 1, 10, 55, 13);
     DateParameter parameter = LocalDateTimeConverter.toDateParameter(localDateTime);
     DateParameter parameter = LocalDateTimeConverter.toDateParameter(localDateTime);