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

Commit

Permalink
chore: Sonar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zepfred committed Jul 3, 2024
1 parent 6015a19 commit eb230e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public PythonLikeObject toPythonObject(ConstraintRef javaObject) {
@Override
public ConstraintRef toJavaObject(PythonLikeObject pythonObject) {
try {
var packageName = ((PythonString) packageNameField.get(pythonObject)).value.toString();
var constraintName = ((PythonString) constraintNameField.get(pythonObject)).value.toString();
var packageName = ((PythonString) packageNameField.get(pythonObject)).value;
var constraintName = ((PythonString) constraintNameField.get(pythonObject)).value;
return ConstraintRef.of(packageName, constraintName);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def constraint_id(self) -> str:
@staticmethod
def parse_id(constraint_id: str):
slash_index = constraint_id.rfind('/')
if slash_index == -1: raise RuntimeError(
if slash_index == -1: raise IndexError(
f'The constraint_id {constraint_id} is invalid as it does not contain a package separator \'/\'.')
package_name = constraint_id[:slash_index]
constraint_name = constraint_id[slash_index + 1:]
Expand Down

0 comments on commit eb230e9

Please sign in to comment.