Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Java 11 (#359)
Browse files Browse the repository at this point in the history
* Remove unused Bresenham class, the only one which uses the big java.desktop dependency

* Introduce XChars#decapitalize in order to get rid of dependency to java.beans.Introspector

* Update to Java 11

Update maven config and remove moditect plugin (module-info generator)
Move module-infos to actual source folder
Update readme and docs

* Cosmetics

* Fixed dependency

* Workflow - change to java 11

* Remove moditect plugin

* Transitive dependencies

* Fix warnings

* add module-info.java for spring project

* add transitive into module-info.java

* format and order

* Update spring boot module-info

* Update spring boot module-info

* Fix warnings

* Fix format

* Update docs

Co-authored-by: Zdenek Jonas <johny2000uwb@gmail.com>
  • Loading branch information
fh-ms and zdenek-jonas authored May 6, 2022
1 parent a8067aa commit 8213b31
Show file tree
Hide file tree
Showing 66 changed files with 202 additions and 692 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
Expand All @@ -30,24 +30,6 @@ jobs:
MAVEN_USERNAME: ${{ secrets.REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.REPO_PASSWORD }}

#java 11 build
- uses: actions/checkout@v2
- name: Set up Java 11 for publishing to Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build with java 11
run: mvn -pl integrations/cdi clean source:jar install -am -B
- name: Deploy module build with java 11
run: mvn -Pdeploy -pl integrations/cdi -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} deploy
env:
MAVEN_USERNAME: ${{ secrets.REPO_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.REPO_PASSWORD }}

#java 17 build
- uses: actions/checkout@v2
- name: Set up Java 17 for publishing to Maven Central Repository
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/maven_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@ jobs:
runs-on: ubuntu-latest

steps:
#Build with java 8
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B package --file pom.xml

#Build with java 11
- uses: actions/checkout@v2
- name: Set up JDK 11
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MicroStream is available under [Eclipse Public License - v 2.0](LICENSE).

## Build

To build MicroStream you need Java 8 and Maven.
To build MicroStream you need Java 11 and Maven.

Just run

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
exports one.microstream.afs.types;
exports one.microstream.afs.exceptions;

requires microstream.base;
requires transitive microstream.base;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
module microstream.afs.nio
{
exports one.microstream.afs.nio.types;

requires microstream.afs;
requires microstream.base;

requires transitive microstream.afs;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
{
exports one.microstream.afs.sql.types;

requires java.sql;
requires microstream.afs;
requires microstream.base;
requires microstream.configuration;
requires transitive microstream.afs;
requires transitive microstream.configuration;
requires transitive java.sql;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import static one.microstream.chars.XChars.notEmpty;

import java.lang.reflect.InvocationTargetException;

import javax.sql.DataSource;

import one.microstream.afs.types.AFileSystem;
Expand Down Expand Up @@ -64,7 +66,7 @@ public AFileSystem create(
try
{
final SqlDataSourceProvider dataSourceProvider = (SqlDataSourceProvider)
Class.forName(dataSourceProviderClassName).newInstance()
Class.forName(dataSourceProviderClassName).getDeclaredConstructor().newInstance()
;
final SqlProvider sqlProvider = this.createSqlProvider(
sqlConfiguration,
Expand All @@ -76,7 +78,11 @@ public AFileSystem create(
: SqlConnector.New(sqlProvider)
);
}
catch(InstantiationException | IllegalAccessException | ClassNotFoundException e)
catch(InstantiationException | IllegalAccessException |
ClassNotFoundException | IllegalArgumentException |
InvocationTargetException | NoSuchMethodException |
SecurityException e
)
{
throw new ConfigurationException(sqlConfiguration, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
exports one.microstream.math;
exports one.microstream.util.cql;
exports one.microstream.time;

requires java.compiler;
requires java.desktop;
requires java.management;
requires jdk.unsupported;
requires org.slf4j;
requires transitive java.management;
requires transitive jdk.unsupported;
requires transitive org.slf4j;
}
20 changes: 19 additions & 1 deletion base/src/main/java/one/microstream/chars/XChars.java
Original file line number Diff line number Diff line change
Expand Up @@ -2277,7 +2277,7 @@ public static final Integer[] parseToIntegerArray(final String... intStrings)
final Integer[] ints = new Integer[intStrings.length];
for(int i = 0; i < intStrings.length; i++)
{
ints[i] = new Integer(intStrings[i]);
ints[i] = Integer.parseInt(intStrings[i]);
}

return ints;
Expand Down Expand Up @@ -2967,6 +2967,24 @@ public static String mathRangeExcExc(final String lowerBound, final String upper
return "]" + lowerBound + "; " + upperBound + "[";
}


public static String decapitalize(final String name)
{
if(name == null || name.length() == 0)
{
return name;
}
if(name.length() > 1
&& Character.isUpperCase(name.charAt(1))
&& Character.isUpperCase(name.charAt(0))
)
{
return name;
}
final char chars[] = name.toCharArray();
chars[0] = Character.toLowerCase(chars[0]);
return new String(chars);
}


///////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ public final long maximumCapacity()



final class OldConstant implements OldList<E>, OldSet<E>
public final class OldConstant implements OldList<E>, OldSet<E>
{
@Override
public final Constant<E> parent()
Expand Down
2 changes: 1 addition & 1 deletion base/src/main/java/one/microstream/collections/Empty.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public long maximumCapacity()



final class OldEmpty implements OldList<E>, OldSet<E>
public final class OldEmpty implements OldList<E>, OldSet<E>
{
@Override
public Empty<E> parent()
Expand Down
2 changes: 1 addition & 1 deletion base/src/main/java/one/microstream/collections/Single.java
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ public Single<E> shiftBy(final long sourceIndex, final long distance, final long
}


final class OldSingle implements one.microstream.collections.old.OldSingle<E>
public final class OldSingle implements one.microstream.collections.old.OldSingle<E>
{
@Override
public int size()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ public final Singleton<E> sort(final Comparator<? super E> comparator)



final class OldSingleton implements OldList<E>, OldSet<E>
public final class OldSingleton implements OldList<E>, OldSet<E>
{
@Override
public final Singleton<E> parent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*/
public interface EntityVersionContext<K> extends EntityLayerProviderProvider
{
@SuppressWarnings("unchecked")
public static <K> EntityVersionContext<K> lookup(final Entity entity)
{
final EntityLayerVersioning<K> versioningLayer = Entity.searchLayer(
Expand All @@ -58,7 +59,7 @@ public default K versionForUpdate()

public EntityVersionCleaner<K> cleaner();

@SuppressWarnings("rawtypes")
@SuppressWarnings({"rawtypes", "unchecked"})
public default <E extends Entity> XGettingTable<K, E> versions(final E entity)
{
Entity layer = entity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
import one.microstream.entity.EntityException;


/**
*
*
*/
@SuppressWarnings("exports")
public class EntityExceptionInvalidEntityMethod extends EntityException
{
private final ExecutableElement method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@
import one.microstream.entity.Entity;


/**
*
*
*/
@SuppressWarnings("exports")
public class EntityProcessor extends AbstractProcessor
{
private final static String OPTION_HASHEQUALATOR = "microstream.entity.hashequalator";
Expand Down
5 changes: 2 additions & 3 deletions base/src/main/java/one/microstream/entity/codegen/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
* #L%
*/

import java.beans.Introspector;

import javax.lang.model.element.ExecutableElement;
import javax.lang.model.type.TypeMirror;

import one.microstream.chars.VarString;
import one.microstream.chars.XChars;

/**
*
Expand Down Expand Up @@ -71,7 +70,7 @@ else if(methodName.startsWith("is"))

return offset <= 0 || methodName.length() <= offset
? methodName
: Introspector.decapitalize(methodName.substring(offset));
: XChars.decapitalize(methodName.substring(offset));
}

private static String setterName(final String name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
* #L%
*/

import java.beans.Introspector;
import java.util.List;
import java.util.stream.Collectors;

import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;

import one.microstream.chars.VarString;
import one.microstream.chars.XChars;


/**
Expand Down Expand Up @@ -60,7 +60,7 @@ void generateCode()
final String typeParametersCode = typeParameters.isEmpty()
? ""
: typeParameters.stream().map(tp -> "?").collect(Collectors.joining(", ", "<", ">"));
final String varName = Introspector.decapitalize(this.entityName);
final String varName = XChars.decapitalize(this.entityName);

this.add("public interface ").add(this.typeName)
.add(" extends ").add(this.addImport(VarString.class)).add(".Appendable")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* #L%
*/

import java.beans.Introspector;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
Expand All @@ -31,6 +30,7 @@

import one.microstream.X;
import one.microstream.chars.VarString;
import one.microstream.chars.XChars;
import one.microstream.hashing.HashEqualator;
import one.microstream.typing.Stateless;

Expand Down Expand Up @@ -82,7 +82,7 @@ void generateCode()
.add(this.typeName).add(", ").add(this.addImport(Stateless.class)).newline()
.tab().add("{").newline();

final String varName = Introspector.decapitalize(this.entityName);
final String varName = XChars.decapitalize(this.entityName);
final String varName1 = varName.concat("1");
final String varName2 = varName.concat("2");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
* #L%
*/

import java.beans.Introspector;
import java.util.List;

import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;

import one.microstream.chars.XChars;
import one.microstream.entity.Entity;

/**
Expand Down Expand Up @@ -66,7 +66,7 @@ void generateCode()
? ""
: "<>";
final String varName =
Introspector.decapitalize(this.entityName);
XChars.decapitalize(this.entityName);

this.add("public interface ").add(this.typeName).add(typeParametersDeclCode)
.add(" extends ").add(this.addImport(Entity.class)).add(".Updater<")
Expand Down
Loading

0 comments on commit 8213b31

Please sign in to comment.