Skip to content

Commit

Permalink
Remove Jetbrains annotations from Toml processor
Browse files Browse the repository at this point in the history
Change requested for vert-x3#49 by Clement Escoffier

Makes sense as do not gain a whole lot by having them present and they
add another dependency to the project.
  • Loading branch information
Lyndon Armitage committed Sep 25, 2018
1 parent 050929d commit 8e100f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
6 changes: 0 additions & 6 deletions vertx-config-toml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
<artifactId>toml4j</artifactId>
<version>${toml4j.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>16.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.json.JsonObject;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.ByteArrayInputStream;
import java.util.Map;
Expand All @@ -35,19 +32,17 @@ public final class TomlProcessor implements ConfigProcessor {
public TomlProcessor() {
}

@NotNull
@Contract(pure = true)
@Override
public final String name() {
return "toml";
}

@Override
public final void process(
@NotNull Vertx vertx,
@Nullable JsonObject configuration,
@NotNull Buffer input,
@NotNull Handler<AsyncResult<JsonObject>> handler
Vertx vertx,
JsonObject configuration,
Buffer input,
Handler<AsyncResult<JsonObject>> handler
) {
Objects.requireNonNull(vertx, "vertx cannot be null");
Objects.requireNonNull(input, "input cannot be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.RunTestOnContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -28,17 +26,11 @@
@RunWith(VertxUnitRunner.class)
public final class TomlProcessorTest {

@NotNull
private static final String EMPTY_FILE_PATH = "src/test/resources/empty.toml";
@NotNull
private static final String NON_EXISTENT_PATH = "src/test/resources/does-not-exist.toml";
@NotNull
private static final String EXAMPLE_PATH = "src/test/resources/example.toml";
@NotNull
private static final JsonObject EXAMPLE_JSON = loadJson("src/test/resources/example.json");
@NotNull
private static final String COMPLEX_EXAMPLE_PATH = "src/test/resources/complex-example.toml";
@NotNull
private static final String BAD_FILE_PATH = "src/test/resources/bad.toml";

@Rule
Expand Down Expand Up @@ -169,10 +161,8 @@ public void fails_for_bad_file(TestContext context) {
}


@Contract(pure = true)
@NotNull
private static ConfigStoreOptions createFileStoreOptions(
@NotNull String path
String path
) {
Objects.requireNonNull(path);
return new ConfigStoreOptions()
Expand All @@ -181,9 +171,7 @@ private static ConfigStoreOptions createFileStoreOptions(
.setConfig(new JsonObject().put("path", path));
}

@Contract(pure = true)
@NotNull
private static JsonObject loadJson(@NotNull String path) {
private static JsonObject loadJson(String path) {
Objects.requireNonNull(path);
byte[] bytes;
try {
Expand Down

0 comments on commit 8e100f1

Please sign in to comment.