Skip to content

Commit 10458b5

Browse files
author
Krystof Tulinger
committed
code review nits (inherited, renaming, package level control)
1 parent c641f66 commit 10458b5

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

test/org/opensolaris/opengrok/condition/ConditionalRun.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import java.lang.annotation.Documented;
2626
import java.lang.annotation.ElementType;
27+
import java.lang.annotation.Inherited;
2728
import java.lang.annotation.Repeatable;
2829
import java.lang.annotation.Retention;
2930
import java.lang.annotation.RetentionPolicy;
@@ -33,8 +34,9 @@
3334
* Repeatable annotation for automatic test skipping.
3435
*/
3536
@Retention(RetentionPolicy.RUNTIME)
36-
@Target(value = {ElementType.METHOD, ElementType.TYPE})
37+
@Target(value = {ElementType.METHOD, ElementType.TYPE, ElementType.PACKAGE})
3738
@Repeatable(ConditionalRunRepeatable.class)
39+
@Inherited
3840
@Documented
3941
public @interface ConditionalRun {
4042

test/org/opensolaris/opengrok/condition/ConditionalRunRepeatable.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import java.lang.annotation.Documented;
2626
import java.lang.annotation.ElementType;
27+
import java.lang.annotation.Inherited;
2728
import java.lang.annotation.Retention;
2829
import java.lang.annotation.Target;
2930

@@ -36,7 +37,8 @@
3637
*/
3738
@Retention(value = RUNTIME)
3839
@Documented
39-
@Target(value = {ElementType.METHOD, ElementType.TYPE})
40+
@Inherited
41+
@Target(value = {ElementType.METHOD, ElementType.TYPE, ElementType.PACKAGE})
4042
public @interface ConditionalRunRepeatable {
4143

4244
ConditionalRun[] value();

test/org/opensolaris/opengrok/condition/ConditionalRunRule.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ public boolean isSatisfied() {
121121
protected static class IgnoreConditionCreator {
122122

123123
private final Class<?> mTestClass;
124-
private final List<Class<? extends RunCondition>> conditionType;
124+
private final List<Class<? extends RunCondition>> conditionTypes;
125125

126126
public IgnoreConditionCreator(Class<?> aTestClass, ConditionalRun[] annotation) {
127127
this.mTestClass = aTestClass;
128-
this.conditionType = new ArrayList<>(annotation.length);
128+
this.conditionTypes = new ArrayList<>(annotation.length);
129129
for (int i = 0; i < annotation.length; i++) {
130-
this.conditionType.add(i, annotation[i].condition());
130+
this.conditionTypes.add(i, annotation[i].condition());
131131
}
132132
}
133133

@@ -148,7 +148,7 @@ private RunCondition createCondition() throws Exception {
148148
* Run through the list of classes implementing RunCondition and
149149
* create a new class from it.
150150
*/
151-
for (Class<? extends RunCondition> clazz : conditionType) {
151+
for (Class<? extends RunCondition> clazz : conditionTypes) {
152152
if (result == null) {
153153
result = new CompositeCondition();
154154
}
@@ -162,7 +162,7 @@ private RunCondition createCondition() throws Exception {
162162
}
163163

164164
private void checkConditionType() {
165-
for (Class<? extends RunCondition> clazz : conditionType) {
165+
for (Class<? extends RunCondition> clazz : conditionTypes) {
166166
if (!isConditionTypeStandalone(clazz) && !isConditionTypeDeclaredInTarget(clazz)) {
167167
String msg
168168
= "Conditional class '%s' is a member class "

0 commit comments

Comments
 (0)