Browse Source

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

patrick-christopher.mattulat 11 months ago
parent
commit
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.
 
@@ -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.
 
+### ChangeLog ###
+##### Features #####
+
+- none
+
+##### Improvements #####
+
+- ran SonarLint static code analysis and fixed most findings
+
+##### Fixes #####
+
+- none
+
 ### 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.
 
 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 ###
 
@@ -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__                    |
 | 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:
 

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

@@ -4,8 +4,8 @@ public class Library
 {
   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;
 
 import java.time.LocalDateTime;
-import java.time.ZoneId;
 
 public class LocalDateTimeConverter
 {
@@ -17,4 +16,7 @@ public class LocalDateTimeConverter
 
     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.Test;
 
-public class LibraryTest
+class LibraryTest
 {
   @Test
-  public void getBinaryName()
+  void 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();
 
   @Test
-  public void constructor()
+  void constructor()
   {
     DateParameter dateParameter = new DateParameter(1989, (byte) 6, (byte) 1, (byte) 10, (byte) 52, (byte) 22);
 
@@ -21,78 +21,78 @@ class DateParameterTest
   }
 
   @Test
-  public void getDay()
+  void getDay()
   {
     Assertions.assertEquals(0, this.parameter.getDay());
   }
 
   @Test
-  public void getHour()
+  void getHour()
   {
     Assertions.assertEquals(0, this.parameter.getHour());
   }
 
   @Test
-  public void getMinute()
+  void getMinute()
   {
     Assertions.assertEquals(0, this.parameter.getMinute());
   }
 
   @Test
-  public void getMonth()
+  void getMonth()
   {
     Assertions.assertEquals(0, this.parameter.getMonth());
   }
 
   @Test
-  public void getSecond()
+  void getSecond()
   {
     Assertions.assertEquals(0, this.parameter.getSecond());
   }
 
   @Test
-  public void getYear()
+  void getYear()
   {
     Assertions.assertEquals(0, this.parameter.getYear());
   }
 
   @Test
-  public void setDay()
+  void setDay()
   {
     this.parameter.setDay((byte) 1);
     Assertions.assertEquals(1, this.parameter.getDay());
   }
 
   @Test
-  public void setHour()
+  void setHour()
   {
     this.parameter.setHour((byte) 10);
     Assertions.assertEquals(10, this.parameter.getHour());
   }
 
   @Test
-  public void setMinute()
+  void setMinute()
   {
     this.parameter.setMinute((byte) 52);
     Assertions.assertEquals(52, this.parameter.getMinute());
   }
 
   @Test
-  public void setMonth()
+  void setMonth()
   {
     this.parameter.setMonth((byte) 6);
     Assertions.assertEquals(6, this.parameter.getMonth());
   }
 
   @Test
-  public void setSecond()
+  void setSecond()
   {
     this.parameter.setSecond((byte) 22);
     Assertions.assertEquals(22, this.parameter.getSecond());
   }
 
   @Test
-  public void setYear()
+  void setYear()
   {
     this.parameter.setYear(1989);
     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
 {
   @Test
-  public void toDateParameter()
+  void toDateParameter()
   {
     LocalDateTime localDateTime = LocalDateTime.of(2030, 6, 1, 10, 55, 13);
     DateParameter parameter = LocalDateTimeConverter.toDateParameter(localDateTime);