Skip to content

Commit

Permalink
Java 17 and JUnit5 (#71)
Browse files Browse the repository at this point in the history
* Changed to Junit5
* Updated Maven Wrapper
* Code cleanup
* Switched to Java 17 and added marshaller builder
  • Loading branch information
michael-schnell authored Dec 27, 2023
1 parent ecbd2f3 commit b942c44
Show file tree
Hide file tree
Showing 73 changed files with 1,005 additions and 521 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 11
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'zulu'
cache: maven

Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ A small Java library that contains several helpful utility classes.
[![Java Development Kit 11](https://img.shields.io/badge/JDK-11-green.svg)](https://openjdk.java.net/projects/jdk/11/)

## Versions
- 0.12.x (or later) = **Java 11** with new **jakarta** namespace
- 0.13.x (or later) = **Java 17**
- 0.12.0 = **Java 11** with new **jakarta** namespace
- 0.11.x = **Java 11** before namespace change from 'javax' to 'jakarta'
- 0.9.x/0.10.x = **Java 8**
- 0.8 (or previous) = **Java 1.4.2**
Expand Down
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>org.fuin</groupId>
<artifactId>pom</artifactId>
<version>1.8.0</version>
<version>1.9.0</version>
</parent>

<artifactId>utils4j</artifactId>
<packaging>bundle</packaging>
<version>0.12.1-SNAPSHOT</version>
<version>0.13.0-SNAPSHOT</version>
<description>A small Java library that contains several helpful utility classes.</description>
<url>http://www.fuin.org/utils4j/</url>

Expand Down Expand Up @@ -54,9 +54,9 @@
<!-- Test -->

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>

Expand All @@ -75,9 +75,9 @@
</dependency>

<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.6</version>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>2.8.2</version>
<scope>test</scope>
</dependency>

Expand Down
7 changes: 1 addition & 6 deletions src/main/java/org/fuin/utils4j/ChangeTrackingMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@
*/
package org.fuin.utils4j;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.*;

/**
* A wrapper for maps that keeps track of all changes made to the map since construction. Only adding, replacing or deleting elements is
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/org/fuin/utils4j/ChangeTrackingUniqueList.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@
*/
package org.fuin.utils4j;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.*;

/**
* A wrapper for lists that keeps track of all changes made to the list since construction. Only adding, replacing or deleting elements is
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/fuin/utils4j/JandexUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package org.fuin.utils4j;

import org.jboss.jandex.Indexer;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -25,8 +27,6 @@
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

import org.jboss.jandex.Indexer;

/**
* Utilities related to Jandex.
*/
Expand Down
15 changes: 2 additions & 13 deletions src/main/java/org/fuin/utils4j/PropertiesFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,9 @@
*/
package org.fuin.utils4j;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.io.*;
import java.nio.channels.FileLock;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.*;

/**
* A properties file that is capable of merging concurrent changes made by another JVM or another process.
Expand Down
14 changes: 3 additions & 11 deletions src/main/java/org/fuin/utils4j/PropertiesUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,13 @@
*/
package org.fuin.utils4j;

import static org.fuin.utils4j.Utils4J.checkNotNull;
import static org.fuin.utils4j.Utils4J.checkValidFile;
import static org.fuin.utils4j.Utils4J.createUrl;
import static org.fuin.utils4j.Utils4J.getPackagePath;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;

import static org.fuin.utils4j.Utils4J.*;

/**
* Utilities related to the {@link Properties} class.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
*/
package org.fuin.utils4j;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.io.*;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
*/
package org.fuin.utils4j;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.io.*;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;

Expand Down
39 changes: 7 additions & 32 deletions src/main/java/org/fuin/utils4j/Utils4J.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,12 @@
*/
package org.fuin.utils4j;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.RandomAccessFile;
import java.io.Reader;
import java.io.Writer;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
Expand All @@ -48,25 +35,13 @@
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;

import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;

/**
* Common utility methods for use in Java applications and libraries.
*/
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/org/fuin/utils4j/VariableResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@
*/
package org.fuin.utils4j;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;

/**
* Resolves the references from variable values to other variable names.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/fuin/utils4j/filter/ComparableFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
*/
package org.fuin.utils4j.filter;

import org.fuin.utils4j.Utils4J;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.fuin.utils4j.Utils4J;

/**
* Defines a filter on a Comparable value.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/fuin/utils4j/filter/RegExprFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public class RegExprFilter implements Filter {
private static final String[] TYPES = new String[] { "matches", "lookingAt", "find" };

/** Compiled pattern. */
private Pattern p = null;
private Pattern p;

/** String pattern to apply. */
private String pattern = null;
private String pattern;

/** Type of matching. */
private int type = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/fuin/utils4j/filter/StringFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
*/
package org.fuin.utils4j.filter;

import org.fuin.utils4j.Utils4J;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.fuin.utils4j.Utils4J;

/**
* Defines a filter on a String.
*/
Expand Down
Loading

0 comments on commit b942c44

Please sign in to comment.