Skip to content

Commit fdc234b

Browse files
[OPS] remove redundant modifiers in interface (#957)
* remove redundant modifiers in interface * rename variable * Use lambda reference
1 parent 69fba22 commit fdc234b

File tree

1 file changed

+13
-13
lines changed
  • dumper/app/src/main/java/com/google/edwmigration/dumper/application/dumper/task

1 file changed

+13
-13
lines changed

dumper/app/src/main/java/com/google/edwmigration/dumper/application/dumper/task/Task.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
/** @author shevek */
2828
public interface Task<T> {
2929

30-
public static interface Condition {
30+
interface Condition {
3131

32-
static class AlwaysTrue implements Condition {
32+
class AlwaysTrue implements Condition {
3333

3434
private static final AlwaysTrue instance = new AlwaysTrue();
3535

@@ -41,21 +41,21 @@ public boolean evaluate(@Nonnull TaskSetState state) {
4141
private AlwaysTrue() {}
4242
}
4343

44-
public static final Condition @ArrayLen(0) [] EMPTY_ARRAY = new Condition[0];
44+
Condition @ArrayLen(0) [] EMPTY_ARRAY = new Condition[0];
4545

4646
static Condition alwaysTrue() {
4747
return AlwaysTrue.instance;
4848
}
4949

50-
public boolean evaluate(@Nonnull TaskSetState state);
50+
boolean evaluate(@Nonnull TaskSetState state);
5151

5252
@Nonnull
53-
public default String toSkipReason() {
53+
default String toSkipReason() {
5454
return "[" + this + "] was not true";
5555
}
5656
}
5757

58-
public static class StateCondition implements Condition {
58+
class StateCondition implements Condition {
5959

6060
private final Task<?> task;
6161
private final TaskState taskState;
@@ -87,7 +87,7 @@ public String toString() {
8787
}
8888
}
8989

90-
public static class AndCondition implements Condition {
90+
class AndCondition implements Condition {
9191

9292
private final List<Condition> conditions;
9393

@@ -103,7 +103,7 @@ public boolean evaluate(TaskSetState state) {
103103

104104
@Override
105105
public String toSkipReason() {
106-
return "all of " + Lists.transform(conditions, t -> t.toSkipReason());
106+
return "all of " + Lists.transform(conditions, Condition::toSkipReason);
107107
}
108108

109109
@Override
@@ -113,7 +113,7 @@ public String toString() {
113113
}
114114

115115
@Nonnull
116-
public default String getName() {
116+
default String getName() {
117117
return getTargetPath();
118118
}
119119

@@ -123,19 +123,19 @@ default TaskCategory getCategory() {
123123
}
124124

125125
@Nonnull
126-
public String getTargetPath();
126+
String getTargetPath();
127127

128128
@Nonnull
129-
public default Condition[] getConditions() {
129+
default Condition[] getConditions() {
130130
return Condition.EMPTY_ARRAY;
131131
}
132132

133133
@CheckForNull
134-
public T run(@Nonnull TaskRunContext context) throws Exception;
134+
T run(@Nonnull TaskRunContext context) throws Exception;
135135

136136
// returns true if tasks handles the exception.
137137
// so it's not sent to user's screen
138-
public default boolean handleException(Exception Fe) {
138+
default boolean handleException(Exception e) {
139139
return false;
140140
}
141141
}

0 commit comments

Comments
 (0)