Skip to content

Commit

Permalink
X.26 (#889)
Browse files Browse the repository at this point in the history
* Initial branch of x.26

* Error on deprecated (#862)

* Review deprecated methods, change build to error on deprecation

* <release>8</release>

* Fix compilation on Java 21

* Don't use UnsafeText here

* Don't use UnsafeText here

* Use release 8 only for Java 11+

* MacOSX issue on modification date

* Clarify why the @deprecated is commented out.

* Clarify why the @deprecated is commented out.

* Deprecate due x.26

* reduced compatibility

* Remove se.eris.notnull.instrument

* Wire to 2.26ea0

* X.26 common compile flags (#865)

* Initial branch of x.26

* Error on deprecated (#862)

* Review deprecated methods, change build to error on deprecation

* <release>8</release>

* Fix compilation on Java 21

* Don't use UnsafeText here

* Don't use UnsafeText here

* Use release 8 only for Java 11+

* MacOSX issue on modification date

* Clarify why the @deprecated is commented out.

* Clarify why the @deprecated is commented out.

* Use a common configuration for the compiler-plugin where deprecation warnings cause the build to fail

* Tidy up compiler setting and some warnings

* X.26 lint all (#868)

* Add -Xlint:all,-options as default compiler

* Add -Xlint:all,-options as default compiler

* Add -Xlint:all,-options as default compiler

* @SuppressWarnings({"rawtypes"}) -> @SuppressWarnings("rawtypes")

* Minor fixes

* Narrow the SuppressWarnings

* X.26 lint all (#869)

* Add -Xlint:all,-options as default compiler

* Add -Xlint:all,-options as default compiler

* Add -Xlint:all,-options as default compiler

* @SuppressWarnings({"rawtypes"}) -> @SuppressWarnings("rawtypes")

* Minor fixes

* Narrow the SuppressWarnings

* Add -Xlint:all,-options as default compiler

* Fix deprecated field

* Fix deprecated field

* Tidy up code base

* resolve merge issues

* resolve Javadoc issues

* Added fail on warning lint for Javadoc, and rawtypes fixes for Bytes (#872)

* serializable warning suppressed

* Fix Javadoc formatting

* Fix warnings following rebase with develop

* Add methods for clear() and emptyHistory() to reduce direct references to VanillaMessageHistory

* Fix warnings following rebase with develop

* removed unwanted cast

* updated test

* FIX deprecation issues in Java 17+

* revert change

* Fix newlines

* </p> tag in javadoc not allowed

* Don't try to serialize a thread (#893)

* Using reflection to unmonitor a reference results in errors in Java 17 Fixes OpenHFT/Chronicle-Core#656

* Fix warnings following rebase with develop

* Add methods for clear() and emptyHistory() to reduce direct references to VanillaMessageHistory

* Handle deprecated members

* parent poms -> x.26.0

* Where marked for removal, also mark for deprecation

---------

Co-authored-by: yevgen.pavlenko <yevgen.pavlenko@chronicle.software>
Co-authored-by: Rob Austin <rob.austin@boundedbuffer.co.uk>
  • Loading branch information
3 people committed May 28, 2024
1 parent 35d7e24 commit 4a894bd
Show file tree
Hide file tree
Showing 331 changed files with 1,395 additions and 2,949 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ Data{message='Howyall', number=1234567890, timeUnit=SECONDS, price=1000.0}
----

=== link:https://github.com/OpenHFT/Chronicle-Wire/blob/ea/demo/src/main/java/run/chronicle/wire/demo/Example7.java[Using the `ClassAliasPool`]
This example shows how to pass your classes to `ClassAliasPool.CLASS_ALIASES.addAlias(Class... classes)`, to create alias names for them so that you can refer to them without using the complete name of their packages.
This example shows how to pass your classes to `ClassAliasPool.CLASS_ALIASES.addAlias(Class<?>... classes)`, to create alias names for them so that you can refer to them without using the complete name of their packages.

[source,java]
----
Expand Down
4 changes: 2 additions & 2 deletions demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
<dependency>
<groupId>net.openhft</groupId>
<artifactId>third-party-bom</artifactId>
<version>3.24.0</version>
<version>3.26.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-bom</artifactId>
<version>2.25ea-SNAPSHOT</version>
<version>2.26ea-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/java/run/chronicle/wire/demo/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ public String toString() {
public BinaryLengthLength binaryLengthLength() {
return BinaryLengthLength.LENGTH_8BIT;
}
}
}
2 changes: 1 addition & 1 deletion demo/src/main/java/run/chronicle/wire/demo/Example1.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ public static void main(String[] args) {
bytes2.releaseLast();

}
}
}
2 changes: 1 addition & 1 deletion demo/src/main/java/run/chronicle/wire/demo/Example2.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ public static void main(String[] args) {
bytes2.releaseLast();
}

}
}
2 changes: 1 addition & 1 deletion demo/src/main/java/run/chronicle/wire/demo/Example3.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ public static void main(String[] args) {
bytes2.releaseLast();

}
}
}
2 changes: 1 addition & 1 deletion demo/src/main/java/run/chronicle/wire/demo/Example4.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ public static void main(String[] args) {
wire2.bytes().releaseLast();
}

}
}
2 changes: 1 addition & 1 deletion demo/src/main/java/run/chronicle/wire/demo/Example5.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ public static void main(String[] args) {
bytes.releaseLast();
bytes2.releaseLast();
}
}
}
2 changes: 1 addition & 1 deletion demo/src/main/java/run/chronicle/wire/demo/Example6.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ public static void main(String[] args) {
bytes.releaseLast();
bytes2.releaseLast();
}
}
}
2 changes: 0 additions & 2 deletions demo/src/main/java/run/chronicle/wire/demo/ListLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public static void main(String[] args) {
} else {
System.out.println("Not found!");
}

}

private static final class Data extends SelfDescribingMarshallable {
Expand Down Expand Up @@ -134,5 +133,4 @@ else if (cmp > 0)
}
return -(low + 1); // key not found
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ else if (cmp > 0)
return -(low + 1);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ else if (cmp > 0)
return -(low + 1);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,4 @@ public static void main(String[] args) {

System.out.println("security100 = " + security100);
}

}
4 changes: 2 additions & 2 deletions marshallingperf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
<dependency>
<groupId>net.openhft</groupId>
<artifactId>third-party-bom</artifactId>
<version>3.24.0</version>
<version>3.26.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-bom</artifactId>
<version>2.25ea-SNAPSHOT</version>
<version>2.26ea-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions microbenchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
<dependency>
<groupId>net.openhft</groupId>
<artifactId>third-party-bom</artifactId>
<version>3.24.0</version>
<version>3.26.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-bom</artifactId>
<version>2.25ea-SNAPSHOT</version>
<version>2.26ea-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ public int code() {
return ordinal();
}
}

@Retention(RetentionPolicy.RUNTIME)
@interface PrintAsText {
}

@State(Scope.Thread)
public class Main {
final Bytes<?> bytes = Bytes.allocateDirect(128).unchecked(true);
Expand Down Expand Up @@ -235,4 +233,3 @@ public Data2 writeReadTest2(Wire wire) {
return data2B;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@
@State(Scope.Thread)
public class ObjectPoolMain {

private static final BytesStore CHAR1 = BytesStoreFrom("A");
private static final BytesStore CHAR2 = BytesStoreFrom("A2");
private static final BytesStore CHAR4 = BytesStoreFrom("A234");
private static final BytesStore CHAR8 = BytesStoreFrom("A2345678");
private static final BytesStore CHAR16 = BytesStoreFrom("A234567890123456");
private static final BytesStore CHAR32 = BytesStoreFrom("A2345678901234567890123456789012");
private static final BytesStore<?, ?> CHAR1 = BytesStoreFrom("A");
private static final BytesStore<?, ?> CHAR2 = BytesStoreFrom("A2");
private static final BytesStore<?, ?> CHAR4 = BytesStoreFrom("A234");
private static final BytesStore<?, ?> CHAR8 = BytesStoreFrom("A2345678");
private static final BytesStore<?, ?> CHAR16 = BytesStoreFrom("A234567890123456");
private static final BytesStore<?, ?> CHAR32 = BytesStoreFrom("A2345678901234567890123456789012");
private static final byte[] BUFFER = new byte[32];
private final Bit8StringInterner si = new Bit8StringInterner(64);

private static BytesStore<?, Void> BytesStoreFrom(String s) {
return BytesStore.nativeStoreFrom(s.getBytes(StandardCharsets.ISO_8859_1));
}

public static void main(String... args) throws RunnerException, InvocationTargetException, IllegalAccessException {
Affinity.setAffinity(2);
if (Jvm.isDebug()) {
Expand Down Expand Up @@ -79,7 +79,7 @@ public static void main(String... args) throws RunnerException, InvocationTarget
}

// @NotNull
protected static String newStringUTF8(BytesStore bs) {
protected static String newStringUTF8(BytesStore<?, ?> bs) {
int length = bs.length();
bs.read(0, BUFFER, 0, length);
return new String(BUFFER, 0, length, StandardCharsets.UTF_8);
Expand Down Expand Up @@ -148,11 +148,11 @@ public String newString32() {

// @Benchmark
public String newStringB01() {
BytesStore bs = CHAR1;
BytesStore<?, ?> bs = CHAR1;
return newStringHiByte0(bs);
}

protected String newStringHiByte0(BytesStore bs) {
protected String newStringHiByte0(BytesStore<?, ?> bs) {
int length = bs.length();
bs.read(0, BUFFER, 0, length);
return new String(BUFFER, 0, 0, length);
Expand Down Expand Up @@ -183,4 +183,3 @@ public String newStringB32() {
return newStringHiByte0(CHAR32);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public final void writeMarshallable(BytesOut<?> bytes) {
bytes.unsafeWriteObject(this, DTO_START, DTO_LENGTH);
}

public static int start(Class c) {
public static int start(Class<?> c) {
return BytesUtil.triviallyCopyableRange(c)[0];
}

public static int length(Class c) {
public static int length(Class<?> c) {
int[] BYTE_RANGE = BytesUtil.triviallyCopyableRange(c);
return BYTE_RANGE[1] - BYTE_RANGE[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class NativeData implements Byteable {
static final int TEXT = FLAG + 1;
private static final int MAX_TEXT = 16;

private BytesStore bytesStore;
private BytesStore<?, ?> bytesStore;
private long offset;
private long length;

Expand Down Expand Up @@ -75,7 +75,7 @@ public void setSide(Side side) {
}

@Override
public void bytesStore(BytesStore bytesStore, long offset, long length) {
public void bytesStore(BytesStore<?, ?> bytesStore, long offset, long length) {
this.bytesStore = bytesStore;
this.offset = offset;
this.length = length;
Expand All @@ -95,7 +95,7 @@ public void copyTo(Data data) {
}

@Override
public BytesStore bytesStore() {
public BytesStore<?, ?> bytesStore() {
return bytesStore;
}

Expand Down
43 changes: 11 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,42 @@
~ limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.openhft</groupId>
<artifactId>java-parent-pom</artifactId>
<version>1.25.4</version>
<relativePath />
<version>1.26.0</version>
<relativePath/>
</parent>

<artifactId>chronicle-wire</artifactId>
<version>2.25ea17-SNAPSHOT</version>
<version>2.26ea0-SNAPSHOT</version>
<name>OpenHFT/Chronicle-Wire</name>
<description>Chronicle-Wire</description>
<packaging>bundle</packaging>
<properties>
<argLine />
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<compiler.argument>-Xlint:deprecation</compiler.argument>
<sonar.organization>openhft</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<!-- The parent POM defines this plugin and activates it in a profile. Unfortunately this plugin will generate
code at @NotNull call-sites that throws IllegalArgumentException rather than NullPointerException. This will
break various core tests. Chronicle have raised this issue before with the maintainers of the plugin. See:
https://github.com/osundblad/intellij-annotations-instrumenter-maven-plugin/issues/53
-->
<se.eris.notnull.instrument>false</se.eris.notnull.instrument>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>third-party-bom</artifactId>
<version>3.25.0</version>
<version>3.26.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-bom</artifactId>
<version>2.25ea-SNAPSHOT</version>
<version>2.26ea-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -198,7 +189,7 @@
<configuration>
<referenceVersion>2.25ea0</referenceVersion>
<artifactsURI>https://teamcity.chronicle.software/repository/download</artifactsURI>
<binaryCompatibilityPercentageRequired>99.6</binaryCompatibilityPercentageRequired>
<binaryCompatibilityPercentageRequired>98</binaryCompatibilityPercentageRequired>
<extraOptions>
<extraOption>
<name>skip-internal-packages</name>
Expand Down Expand Up @@ -237,20 +228,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:deprecation</arg>
<arg>-parameters</arg>
</compilerArgs>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!--
generate maven dependencies versions file that can be used later
to install the right bundle in test phase.
Expand Down Expand Up @@ -519,7 +496,9 @@
</goals>
<configuration>
<executable>${java.home}/bin/java</executable>
<commandlineArgs>${jvm.requiredArgs} -classpath %classpath net.openhft.chronicle.wire.AbstractTimestampLongConverterJLBHBenchmark</commandlineArgs>
<commandlineArgs>${jvm.requiredArgs} -classpath %classpath
net.openhft.chronicle.wire.AbstractTimestampLongConverterJLBHBenchmark
</commandlineArgs>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public ValueOut write(CharSequence key) {
}

@Override
public ValueOut writeEvent(Class expectedType, Object eventKey) throws InvalidMarshallableException {
public ValueOut writeEvent(Class<?> expectedType, Object eventKey) throws InvalidMarshallableException {
return wireAcquisition.acquireWire().writeEvent(expectedType, eventKey);
}

Expand Down
Loading

0 comments on commit 4a894bd

Please sign in to comment.