Skip to content

Commit 45524a9

Browse files
committed
Changed exception signature for assignments reflective methods to support older Java versions
1 parent 62c0364 commit 45524a9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Diff for: src/main/java/org/junit/experimental/theories/internal/Assignments.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public Assignments assignNext(PotentialAssignment source) {
5757
fAssigned);
5858
assigned.add(source);
5959

60-
return new Assignments(assigned, fUnassigned.subList(1, fUnassigned
61-
.size()), fClass);
60+
return new Assignments(assigned, fUnassigned.subList(1,
61+
fUnassigned.size()), fClass);
6262
}
6363

6464
public Object[] getActualValues(int start, int stop, boolean nullsOk)
@@ -75,25 +75,25 @@ public Object[] getActualValues(int start, int stop, boolean nullsOk)
7575
}
7676

7777
public List<PotentialAssignment> potentialsForNextUnassigned()
78-
throws ReflectiveOperationException {
78+
throws Exception {
7979
ParameterSignature unassigned = nextUnassigned();
8080
return getSupplier(unassigned).getValueSources(unassigned);
8181
}
8282

8383
private ParameterSupplier getSupplier(ParameterSignature unassigned)
84-
throws ReflectiveOperationException {
84+
throws Exception {
8585
ParametersSuppliedBy annotation = unassigned
8686
.findDeepAnnotation(ParametersSuppliedBy.class);
87-
87+
8888
if (annotation != null) {
8989
return buildParameterSupplierFromClass(annotation.value());
9090
} else {
9191
return new AllMembersSupplier(fClass);
9292
}
9393
}
9494

95-
private ParameterSupplier buildParameterSupplierFromClass(Class<? extends ParameterSupplier> cls)
96-
throws ReflectiveOperationException {
95+
private ParameterSupplier buildParameterSupplierFromClass(
96+
Class<? extends ParameterSupplier> cls) throws Exception {
9797
Constructor<?>[] supplierConstructors = cls.getConstructors();
9898

9999
for (Constructor<?> constructor : supplierConstructors) {

Diff for: src/test/java/org/junit/tests/experimental/theories/extendingwithstubs/StubbedTheories.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected void runWithIncompleteAssignment(Assignments incomplete)
5050
}
5151

5252
private GuesserQueue createGuesserQueue(Assignments incomplete)
53-
throws ReflectiveOperationException {
53+
throws Exception {
5454
ParameterSignature nextUnassigned = incomplete.nextUnassigned();
5555

5656
if (nextUnassigned.hasAnnotation(Stub.class)) {

0 commit comments

Comments
 (0)