Skip to content

Commit

Permalink
De-finalize marshallable fields OpenHFT/Chronicle-Wire#414
Browse files Browse the repository at this point in the history
  • Loading branch information
alamar committed Apr 22, 2022
1 parent 32f4af2 commit 5acaca2
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package net.openhft.chronicle.queue.internal.domestic;

import net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder;
import net.openhft.chronicle.wire.SelfDescribingMarshallable;
import org.jetbrains.annotations.NotNull;

import java.time.LocalTime;
import java.time.ZoneId;
import java.util.Arrays;
import java.util.function.Function;

public final class QueueOffsetSpec {
public final class QueueOffsetSpec extends SelfDescribingMarshallable {

private static final String TOKEN_DELIMITER = ";";
private final Type type;
private final String[] spec;
private Type type;
private String[] spec;
private QueueOffsetSpec(final Type type, final String[] spec) {
this.type = type;
this.spec = spec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interface Pinger {

static class PingDTO extends SelfDescribingMarshallable {
static int constructionCounter, constructionExpected;
final Bytes<?> bytes = Bytes.allocateElasticOnHeap();
Bytes<?> bytes = Bytes.allocateElasticOnHeap();

PingDTO() {
if (++constructionCounter > constructionExpected)
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/openhft/chronicle/queue/ProxyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public interface TestMessageListener {

public static class Message extends SelfDescribingMarshallable {

private final StringBuilder message = new StringBuilder();
private StringBuilder message = new StringBuilder();

CharSequence message() {
return message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ interface PersonListener {
static class Person implements Marshallable {
static final String INTERRUPT = "Arthur";
static final String THROW = "Thrower";
final int age;
final String name;
int age;
String name;

Person(int age, String name) {
this.age = age;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static class OtherExtendedBuilder extends SingleChronicleQueueBuilder {
@Test
public void testReadMarshallable() {
expectException("Overriding roll epoch from existing metadata");
ignoreException("Overwriting final field id in class java.time.ZoneRegion");
final String tmpDir = getTmpDir().toString();
SingleChronicleQueueBuilder builder = Marshallable.fromString("!net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder {\n" +
" writeBufferMode: None,\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3771,7 +3771,7 @@ public void shouldWaitForConditionWhenAcquiringAppender() throws TimeoutExceptio
}

private static class MapWrapper extends SelfDescribingMarshallable {
final Map<CharSequence, Double> map = new HashMap<>();
Map<CharSequence, Double> map = new HashMap<>();
}

static class MyMarshable extends SelfDescribingMarshallable implements Demarshallable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import net.openhft.chronicle.wire.SelfDescribingMarshallable;

public class OrderIdea extends SelfDescribingMarshallable {
final String symbol;
final Side side;
final double limitPrice;
final double quantity;
String symbol;
Side side;
double limitPrice;
double quantity;

public OrderIdea(String symbol, Side side, double limitPrice, double quantity) {
this.symbol = symbol;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class TopOfBookPrice extends SelfDescribingMarshallable {
public static final long TIMESTAMP_LIMIT = TimeUnit.SECONDS.toMillis(1000);
final String symbol;
String symbol;
long timestamp;
double buyPrice, buyQuantity;
double sellPrice, sellQuantity;
Expand Down

0 comments on commit 5acaca2

Please sign in to comment.