Skip to content

Commit ccdf5ae

Browse files
committed
[GR-45992] Let msgs of ImplicitExceptions match HotSpot again.
PullRequest: graal/14506
2 parents 10495f1 + c431f61 commit ccdf5ae

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

substratevm/src/com.oracle.svm.core/.checkstyle_checks.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@
7171
<property name="message" value="Exception and error messages must not start with a lowercase letter"/>
7272
<property name="ignoreComments" value="true"/>
7373
</module>
74+
<module name="SuppressionCommentFilter">
75+
<property name="offCommentFormat" value="Checkstyle: allow inconsistent exceptions and errors"/>
76+
<property name="onCommentFormat" value="Checkstyle: disallow inconsistent exceptions and errors"/>
77+
<property name="idFormat" value="exceptionsAndErrors"/>
78+
<metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Tolerate inconsistent exceptions and errors"/>
79+
</module>
7480

7581
<module name="RegexpSinglelineJava">
7682
<property name="id" value="newLinesFormatStrings"/>

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/snippets/ImplicitExceptions.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,20 +234,24 @@ private static ArithmeticException createDivisionByZeroException() {
234234
return new ArithmeticException("/ by zero");
235235
}
236236

237+
// Checkstyle: allow inconsistent exceptions and errors
238+
237239
/** Foreign call: {@link #CREATE_INTEGER_OVERFLOW_EXCEPTION}. */
238240
@SubstrateForeignCallTarget(stubCallingConvention = true)
239241
private static ArithmeticException createIntegerOverflowException() {
240242
vmErrorIfImplicitExceptionsAreFatal();
241-
return new ArithmeticException("Integer overflow");
243+
return new ArithmeticException("integer overflow");
242244
}
243245

244246
/** Foreign call: {@link #CREATE_LONG_OVERFLOW_EXCEPTION}. */
245247
@SubstrateForeignCallTarget(stubCallingConvention = true)
246248
private static ArithmeticException createLongOverflowException() {
247249
vmErrorIfImplicitExceptionsAreFatal();
248-
return new ArithmeticException("Long overflow");
250+
return new ArithmeticException("long overflow");
249251
}
250252

253+
// Checkstyle: disallow inconsistent exceptions and errors
254+
251255
/** Foreign call: {@link #CREATE_ASSERTION_ERROR_NULLARY}. */
252256
@SubstrateForeignCallTarget(stubCallingConvention = true)
253257
private static AssertionError createAssertionErrorNullary() {
@@ -354,20 +358,24 @@ private static void throwNewDivisionByZeroException() {
354358
throw new ArithmeticException("/ by zero");
355359
}
356360

361+
// Checkstyle: allow inconsistent exceptions and errors
362+
357363
/** Foreign call: {@link #THROW_NEW_INTEGER_OVERFLOW_EXCEPTION}. */
358364
@SubstrateForeignCallTarget(stubCallingConvention = true)
359365
private static void throwNewIntegerOverflowException() {
360366
vmErrorIfImplicitExceptionsAreFatal();
361-
throw new ArithmeticException("Integer overflow");
367+
throw new ArithmeticException("integer overflow");
362368
}
363369

364370
/** Foreign call: {@link #THROW_NEW_LONG_OVERFLOW_EXCEPTION}. */
365371
@SubstrateForeignCallTarget(stubCallingConvention = true)
366372
private static void throwNewLongOverflowException() {
367373
vmErrorIfImplicitExceptionsAreFatal();
368-
throw new ArithmeticException("Long overflow");
374+
throw new ArithmeticException("long overflow");
369375
}
370376

377+
// Checkstyle: disallow inconsistent exceptions and errors
378+
371379
/** Foreign call: {@link #THROW_NEW_ASSERTION_ERROR_NULLARY}. */
372380
@SubstrateForeignCallTarget(stubCallingConvention = true)
373381
private static void throwNewAssertionErrorNullary() {

0 commit comments

Comments
 (0)