Skip to content

Commit 40597ff

Browse files
committed
sonarqube cleanup.
1 parent c7735c8 commit 40597ff

29 files changed

Lines changed: 52 additions & 139 deletions

src/main/java/org/hdf5javalib/dataclass/HdfCompound.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,8 @@ public HdfCompound(byte[] bytes, CompoundDatatype datatype) {
8080
public String toString() {
8181
try {
8282
return datatype.getInstance(String.class, bytes);
83-
} catch (InvocationTargetException e) {
84-
throw new RuntimeException(e);
85-
} catch (InstantiationException e) {
86-
throw new RuntimeException(e);
87-
} catch (IllegalAccessException e) {
88-
throw new RuntimeException(e);
89-
} catch (IOException e) {
90-
throw new RuntimeException(e);
83+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
84+
throw new IllegalStateException(e);
9185
}
9286
}
9387

src/main/java/org/hdf5javalib/dataclass/HdfCompoundMember.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,8 @@ public HdfCompoundMember(byte[] bytes, CompoundMemberDatatype datatype) {
6868
public String toString() {
6969
try {
7070
return datatype.getInstance(HdfData.class, bytes).toString();
71-
} catch (InvocationTargetException e) {
72-
throw new RuntimeException(e);
73-
} catch (InstantiationException e) {
74-
throw new RuntimeException(e);
75-
} catch (IllegalAccessException e) {
76-
throw new RuntimeException(e);
77-
} catch (IOException e) {
78-
throw new RuntimeException(e);
71+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
72+
throw new IllegalStateException(e);
7973
}
8074
}
8175

src/main/java/org/hdf5javalib/dataclass/HdfEnum.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,8 @@ public byte[] getBytes() {
8383
public String toString() {
8484
try {
8585
return datatype.getInstance(String.class, bytes);
86-
} catch (InvocationTargetException e) {
87-
throw new RuntimeException(e);
88-
} catch (InstantiationException e) {
89-
throw new RuntimeException(e);
90-
} catch (IllegalAccessException e) {
91-
throw new RuntimeException(e);
92-
} catch (IOException e) {
93-
throw new RuntimeException(e);
86+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
87+
throw new IllegalStateException(e);
9488
}
9589
}
9690

src/main/java/org/hdf5javalib/dataclass/HdfFixedPoint.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,8 @@ public boolean isUndefined() {
149149
public String toString() {
150150
try {
151151
return datatype.getInstance(String.class, bytes);
152-
} catch (InvocationTargetException e) {
153-
throw new RuntimeException(e);
154-
} catch (InstantiationException e) {
155-
throw new RuntimeException(e);
156-
} catch (IllegalAccessException e) {
157-
throw new RuntimeException(e);
158-
} catch (IOException e) {
159-
throw new RuntimeException(e);
152+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
153+
throw new IllegalStateException(e);
160154
}
161155
}
162156

src/main/java/org/hdf5javalib/dataclass/HdfFloatPoint.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,8 @@ public HdfFloatPoint(byte[] bytes, FloatingPointDatatype datatype) {
6464
public String toString() {
6565
try {
6666
return datatype.getInstance(String.class, bytes);
67-
} catch (InvocationTargetException e) {
68-
throw new RuntimeException(e);
69-
} catch (InstantiationException e) {
70-
throw new RuntimeException(e);
71-
} catch (IllegalAccessException e) {
72-
throw new RuntimeException(e);
73-
} catch (IOException e) {
74-
throw new RuntimeException(e);
67+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
68+
throw new IllegalStateException(e);
7569
}
7670
}
7771

src/main/java/org/hdf5javalib/dataclass/HdfOpaque.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,8 @@ public byte[] getBytes() {
8080
public String toString() {
8181
try {
8282
return datatype.getInstance(String.class, bytes);
83-
} catch (InvocationTargetException e) {
84-
throw new RuntimeException(e);
85-
} catch (InstantiationException e) {
86-
throw new RuntimeException(e);
87-
} catch (IllegalAccessException e) {
88-
throw new RuntimeException(e);
89-
} catch (IOException e) {
90-
throw new RuntimeException(e);
83+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
84+
throw new IllegalStateException(e);
9185
}
9286
}
9387

src/main/java/org/hdf5javalib/dataclass/HdfReference.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,8 @@ public ReferenceDatatype getDatatype() {
3434
public String toString() {
3535
try {
3636
return datatype.toString(bytes);
37-
} catch (InvocationTargetException e) {
38-
throw new RuntimeException(e);
39-
} catch (InstantiationException e) {
40-
throw new RuntimeException(e);
41-
} catch (IllegalAccessException e) {
42-
throw new RuntimeException(e);
43-
} catch (IOException e) {
44-
throw new RuntimeException(e);
37+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
38+
throw new IllegalStateException(e);
4539
}
4640
}
4741

src/main/java/org/hdf5javalib/dataclass/HdfString.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,8 @@ public byte[] getBytes() {
105105
public String toString() {
106106
try {
107107
return datatype.getInstance(String.class, bytes);
108-
} catch (InvocationTargetException e) {
109-
throw new RuntimeException(e);
110-
} catch (InstantiationException e) {
111-
throw new RuntimeException(e);
112-
} catch (IllegalAccessException e) {
113-
throw new RuntimeException(e);
114-
} catch (IOException e) {
115-
throw new RuntimeException(e);
108+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
109+
throw new IllegalStateException(e);
116110
}
117111
}
118112

src/main/java/org/hdf5javalib/dataclass/HdfTime.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,8 @@ public byte[] getBytes() {
9494
public String toString() {
9595
try {
9696
return datatype.getInstance(String.class, bytes);
97-
} catch (InvocationTargetException e) {
98-
throw new RuntimeException(e);
99-
} catch (InstantiationException e) {
100-
throw new RuntimeException(e);
101-
} catch (IllegalAccessException e) {
102-
throw new RuntimeException(e);
103-
} catch (IOException e) {
104-
throw new RuntimeException(e);
97+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
98+
throw new IllegalStateException(e);
10599
}
106100
}
107101

src/main/java/org/hdf5javalib/dataclass/HdfVariableLength.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,8 @@ public byte[] getBytes() {
8282
public String toString() {
8383
try {
8484
return datatype.getInstance(String.class, bytes);
85-
} catch (InvocationTargetException e) {
86-
throw new RuntimeException(e);
87-
} catch (InstantiationException e) {
88-
throw new RuntimeException(e);
89-
} catch (IllegalAccessException e) {
90-
throw new RuntimeException(e);
91-
} catch (IOException e) {
92-
throw new RuntimeException(e);
85+
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | IOException e) {
86+
throw new IllegalStateException(e);
9387
}
9488
}
9589

0 commit comments

Comments
 (0)