Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
chore: Throw IllegalStateException instead of RuntimeException
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-Chianelli committed Jul 12, 2024
1 parent 8fb60b9 commit 5bae727
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public PythonLikeObject toPythonObject(BendableBigDecimalScore javaObject) {
softScoresField.set(instance, toPythonList(javaObject.softScores()));
return (PythonLikeObject) instance;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand All @@ -82,7 +82,7 @@ public BendableBigDecimalScore toJavaObject(PythonLikeObject pythonObject) {
return BendableBigDecimalScore.ofUninitialized(initScore, hardScores, softScores);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public PythonLikeObject toPythonObject(BendableLongScore javaObject) {
softScoresField.set(instance, toPythonList(javaObject.softScores()));
return (PythonLikeObject) instance;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand All @@ -79,7 +79,7 @@ public BendableLongScore toJavaObject(PythonLikeObject pythonObject) {
return BendableLongScore.ofUninitialized(initScore, hardScores, softScores);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public PythonLikeObject toPythonObject(HardMediumSoftBigDecimalScore javaObject)
softScoreField.set(instance, new PythonDecimal(javaObject.softScore()));
return (PythonLikeObject) instance;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand All @@ -68,7 +68,7 @@ public HardMediumSoftBigDecimalScore toJavaObject(PythonLikeObject pythonObject)
return HardMediumSoftBigDecimalScore.ofUninitialized(initScore, hardScore, mediumScore, softScore);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public PythonLikeObject toPythonObject(HardMediumSoftLongScore javaObject) {
softScoreField.set(instance, PythonInteger.valueOf(javaObject.softScore()));
return (PythonLikeObject) instance;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand All @@ -67,7 +67,7 @@ public HardMediumSoftLongScore toJavaObject(PythonLikeObject pythonObject) {
return HardMediumSoftLongScore.ofUninitialized(initScore, hardScore, mediumScore, softScore);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public PythonLikeObject toPythonObject(HardSoftBigDecimalScore javaObject) {
softScoreField.set(instance, new PythonDecimal(javaObject.softScore()));
return (PythonLikeObject) instance;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand All @@ -64,7 +64,7 @@ public HardSoftBigDecimalScore toJavaObject(PythonLikeObject pythonObject) {
return HardSoftBigDecimalScore.ofUninitialized(initScore, hardScore, softScore);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public PythonLikeObject toPythonObject(HardSoftLongScore javaObject) {
softScoreField.set(instance, PythonInteger.valueOf(javaObject.softScore()));
return (PythonLikeObject) instance;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand All @@ -62,7 +62,7 @@ public HardSoftLongScore toJavaObject(PythonLikeObject pythonObject) {
return HardSoftLongScore.ofUninitialized(initScore, hardScore, softScore);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public PythonLikeObject toPythonObject(SimpleBigDecimalScore javaObject) {
scoreField.set(instance, new PythonDecimal(javaObject.score()));
return (PythonLikeObject) instance;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand All @@ -60,7 +60,7 @@ public SimpleBigDecimalScore toJavaObject(PythonLikeObject pythonObject) {
return SimpleBigDecimalScore.ofUninitialized(initScore, score);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public PythonLikeObject toPythonObject(SimpleLongScore javaObject) {
scoreField.set(instance, PythonInteger.valueOf(javaObject.score()));
return (PythonLikeObject) instance;
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand All @@ -58,7 +58,7 @@ public SimpleLongScore toJavaObject(PythonLikeObject pythonObject) {
return SimpleLongScore.ofUninitialized(initScore, score);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}

0 comments on commit 5bae727

Please sign in to comment.