Skip to content

Commit

Permalink
clean(core): Remove BaseResource's (now) no longer required weird #ha…
Browse files Browse the repository at this point in the history
…cked constructor with #fake fixedMediaType parameter
  • Loading branch information
vorburger committed Dec 14, 2024
1 parent 09c8cc8 commit 35cdf0b
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 14 deletions.
7 changes: 0 additions & 7 deletions java/dev/enola/common/io/resource/BaseResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ protected BaseResource(URI uri, MediaType mediaType) {
this.mediaType = mtd.adjustCharset(uri, requireNonNull(mediaType, "mediaType"));
}

// TODO Remove this weird "hacked" constructor with "fake" fixedMediaType parameter...
protected BaseResource(URI uri, MediaType mediaType, boolean fixedMediaType) {
this.uri = requireNonNull(uri, "uri");
this.mediaType = requireNonNull(mediaType, "mediaType");
if (!fixedMediaType) throw new IllegalArgumentException();
}

// No need for: protected BaseResource(URI uri, MediaType mediaType, ByteSource byteSource) {

@Override
Expand Down
2 changes: 1 addition & 1 deletion java/dev/enola/common/io/resource/ErrorResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Resource getResource(URI uri) {
public static final ErrorResource INSTANCE = new ErrorResource();

private ErrorResource() {
super(ERROR_URI, MEDIA_TYPE, true);
super(ERROR_URI, MEDIA_TYPE);
}

@Override
Expand Down
4 changes: 0 additions & 4 deletions java/dev/enola/common/io/resource/MemoryResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ private static URI nextURI(String querySuffix) {

private final MemoryByteSink memoryByteSink = new MemoryByteSink();

protected MemoryResource(URI uri, MediaType mediaType, boolean fixedMediaType) {
super(uri, mediaType, fixedMediaType);
}

public MemoryResource(URI uri, MediaType mediaType) {
super(uri, mediaType);
}
Expand Down
2 changes: 1 addition & 1 deletion java/dev/enola/common/io/resource/NullResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public Resource getResource(URI uri) {
static final String SCHEME = "null";

public NullResource(MediaType mediaType) {
super(uri(mediaType), mediaType, true);
super(uri(mediaType), mediaType);
}

private static URI uri(MediaType mediaType) {
Expand Down
2 changes: 1 addition & 1 deletion java/dev/enola/common/io/resource/TestResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TestResource extends MemoryResource implements CloseableResource {
private final long id;

private TestResource(MediaType mediaType, URI uri, long id) {
super(uri, mediaType, true);
super(uri, mediaType);
this.id = id;
}

Expand Down

0 comments on commit 35cdf0b

Please sign in to comment.