ch.vorburger.exec icon indicating copy to clipboard operation
ch.vorburger.exec copied to clipboard

MultiCauseIOException fails on errorprone

Open mosesn opened this issue 2 years ago • 3 comments
trafficstars

On master

[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /Users/moses/projects/ch.vorburger.exec/src/main/java/ch/vorburger/exec/MultiCauseIOException.java:[41,33] non-transient instance field of a serializable class declared with a non-serializable type
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/moses/projects/ch.vorburger.exec/src/main/java/ch/vorburger/exec/MultiCauseIOException.java: warnings found and -Werror specified
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

mosesn avatar May 14 '23 20:05 mosesn

Huh?! I'm ... very stunned why I'm neither seeing this locally with ./mvnw clean test nor on CI.

The Continous Integration of the master branch is green & passes (note the green tick mark).

See https://github.com/vorburger/ch.vorburger.exec/actions/runs/4974375147/jobs/8900782436.

You seem to know what you are doing, but are you 100% sure you have a pristine local version, without any local changes, with the exact same dependencies from Maven, and not e.g. something "dirty" (different) in your local Maven repo. Because that's the only logical explanation - that I can think of.

Shout if you can think of any other reason why we would have such a discrepancy.

Or could this be related to JDK version? I run OpenJDK 17 locally, and then CI is on Java 11 (even though we are enforcing Java 8 source and target and API). But no, that actually can't be - Error Prone won't even run on Java 8.

I'm honestly at a loss about what be causing this for you!

vorburger avatar May 14 '23 20:05 vorburger

Ah, I think I spotted it. I'm on Java 19 locally. Looks like this was added in Java 18.

https://bugs.openjdk.org/browse/JDK-8274336

mosesn avatar May 15 '23 00:05 mosesn

Oh! How about we simply entirely disable the Lint category for Serializable in the pom.xml? (I think Serializable is irrelevant nowadays.) If you know how, do you want to raise a PR?

vorburger avatar May 15 '23 04:05 vorburger

https://github.com/vorburger/ch.vorburger.exec/commit/25dd04ce83dc18d71e053cba802faa5c67377a3c just fixed this!

@mosesn heads-up FYI #187 ...

vorburger avatar Mar 27 '24 20:03 vorburger