Skip to content

Commit

Permalink
Reformatting all files
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos committed Dec 15, 2021
1 parent 29c163a commit 78f7adc
Show file tree
Hide file tree
Showing 1,474 changed files with 105,182 additions and 99,520 deletions.
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,3 @@ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.ht

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
- [Features](#features)
- [Release candidates](#release-candidates)
- [Releases](#releases)
- [Hotfixes](#hotfixes)
- [Hotfixes](#hotfixes)
- [Contribute](#contribute)
- [Code style](#code-style)
- [Code structure](#code-structure)
- [Commit messages](#commit-messages)
- [Opening a pull request](#opening-a-pull-request)


## Code of conduct

Expand All @@ -32,7 +32,7 @@ Please report unacceptable behavior to [hello@radixdlt.com](mailto:hello@radixdl
* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/radixdlt/radixdlt-parent/issues).
* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/radixdlt/radixdlt-parent/issues/new). Be sure to include:
* a **title**,
* a **clear description**,
* a **clear description**,
* as much **relevant information** as possible,
* a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.

Expand Down Expand Up @@ -85,7 +85,7 @@ When QA gives the green light, a new release branch is created

These branches will stay alive forever, or at least while we support the release, thereby allowing us to release security hotfixes for older versions.

If QA discovers a bug with any of the features before a release happens, it is fixed in the feature branch taken from the release branch and then merged into the release again.
If QA discovers a bug with any of the features before a release happens, it is fixed in the feature branch taken from the release branch and then merged into the release again.

These changes should immediately be propagated to the current release candidate branch.

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ allprojects {
}
java {
// don't need to set target, it is inferred from java

targetExclude('**/openapitools/**/*.java')
// apply a specific flavor of google-java-format
googleJavaFormat('1.13.0').reflowLongStrings()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,43 +68,42 @@
import com.google.inject.Module;
import com.google.inject.multibindings.ProvidesIntoSet;
import com.radixdlt.environment.EventProcessorOnDispatch;

import java.util.Optional;
import java.util.function.Function;

public final class FailOnEvent {
private FailOnEvent() {
throw new IllegalStateException("Cannot instantiate");
}
private FailOnEvent() {
throw new IllegalStateException("Cannot instantiate");
}

public static Module asModule(Class<?> eventClass) {
return new AbstractModule() {
@ProvidesIntoSet
EventProcessorOnDispatch<?> failOnEvent() {
return new EventProcessorOnDispatch<>(
eventClass,
i -> {
throw new IllegalStateException("Invalid event: " + i);
}
);
};
};
}
public static Module asModule(Class<?> eventClass) {
return new AbstractModule() {
@ProvidesIntoSet
EventProcessorOnDispatch<?> failOnEvent() {
return new EventProcessorOnDispatch<>(
eventClass,
i -> {
throw new IllegalStateException("Invalid event: " + i);
});
}
;
};
}

public static <T> Module asModule(Class<T> eventClass, Function<T, Optional<Throwable>> mapper) {
return new AbstractModule() {
@ProvidesIntoSet
EventProcessorOnDispatch<?> failOnEvent() {
return new EventProcessorOnDispatch<>(
eventClass,
i -> {
var maybeError = mapper.apply(i);
if (maybeError.isPresent()) {
throw new IllegalStateException("Invalid event: " + i, maybeError.get());
}
}
);
};
};
}
public static <T> Module asModule(Class<T> eventClass, Function<T, Optional<Throwable>> mapper) {
return new AbstractModule() {
@ProvidesIntoSet
EventProcessorOnDispatch<?> failOnEvent() {
return new EventProcessorOnDispatch<>(
eventClass,
i -> {
var maybeError = mapper.apply(i);
if (maybeError.isPresent()) {
throw new IllegalStateException("Invalid event: " + i, maybeError.get());
}
});
}
;
};
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Copyright 2021 Radix Publishing Ltd incorporated in Jersey (Channel Islands).
/* Copyright 2021 Radix Publishing Ltd incorporated in Jersey (Channel Islands).
*
* Licensed under the Radix License, Version 1.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at:
*
* radixfoundation.org/licenses/LICENSE-v1
*
* The Licensor hereby grants permission for the Canonical version of the Work to be
* published, distributed and used under or by reference to the Licensor’s trademark
* Radix ® and use of any unregistered trade names, logos or get-up.
Expand Down Expand Up @@ -66,28 +67,30 @@
import java.util.function.Supplier;

/**
* Configuration which describes how often an actor will be called upon to act in a deterministic test.
* Configuration which describes how often an actor will be called upon to act in a deterministic
* test.
*/
public final class ActorConfiguration {
private final Supplier<DeterministicActor> actorSupplier;
private final int numerator;
private final int denominator;
private final Supplier<DeterministicActor> actorSupplier;
private final int numerator;
private final int denominator;

public ActorConfiguration(Supplier<DeterministicActor> actorSupplier, int numerator, int denominator) {
this.actorSupplier = actorSupplier;
this.numerator = numerator;
this.denominator = denominator;
}
public ActorConfiguration(
Supplier<DeterministicActor> actorSupplier, int numerator, int denominator) {
this.actorSupplier = actorSupplier;
this.numerator = numerator;
this.denominator = denominator;
}

public int getNumerator() {
return numerator;
}
public int getNumerator() {
return numerator;
}

public int getDenominator() {
return denominator;
}
public int getDenominator() {
return denominator;
}

public DeterministicActor createActor() {
return actorSupplier.get();
}
public DeterministicActor createActor() {
return actorSupplier.get();
}
}
Loading

0 comments on commit 78f7adc

Please sign in to comment.