Skip to content

Commit

Permalink
Reduce visibility of FieldContext
Browse files Browse the repository at this point in the history
  • Loading branch information
scordio committed Jul 15, 2023
1 parent 0101abf commit 759fa79
Showing 1 changed file with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import org.junit.platform.commons.logging.LoggerFactory;
import org.junit.platform.commons.util.AnnotationUtils;
import org.junit.platform.commons.util.ExceptionUtils;
import org.junit.platform.commons.util.Preconditions;
import org.junit.platform.commons.util.ReflectionUtils;
import org.junit.platform.commons.util.ToStringBuilder;

Expand Down Expand Up @@ -440,12 +441,28 @@ private Path relativizeSafely(Path path) {
}
}

static class FieldContext implements AnnotatedElementContext {
enum Scope {

PER_CONTEXT,

PER_DECLARATION

}

interface FileOperations {

FileOperations DEFAULT = Files::delete;

void delete(Path path) throws IOException;

}

private static class FieldContext implements AnnotatedElementContext {

private final Field field;

FieldContext(Field field) {
this.field = field;
private FieldContext(Field field) {
this.field = Preconditions.notNull(field, "field must not be null");
}

@Override
Expand Down Expand Up @@ -479,20 +496,4 @@ public String toString() {

}

enum Scope {

PER_CONTEXT,

PER_DECLARATION

}

interface FileOperations {

FileOperations DEFAULT = Files::delete;

void delete(Path path) throws IOException;

}

}

0 comments on commit 759fa79

Please sign in to comment.