error while after erorprone to build

16 views
Skip to first unread message

Daan Hoogland

unread,
Jan 12, 2023, 1:26:59 PM1/12/23
to error-prone-discuss
LS,
I try adding errorprone to the maven build of apache cloudstack and see this:

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.errorprone.util.ErrorProneTokens$CommentSavingTokenizer (file:/home/dahn/.m2/repository/com/google/errorprone/error_prone_check_api/2.18.0/error_prone_check_api-2.18.0.jar) to field com.sun.tools.javac.parser.JavaTokenizer.reader
WARNING: Please consider reporting this to the maintainers of com.google.errorprone.util.ErrorProneTokens$CommentSavingTokenizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
/home/dahn/apache/cloudstack/utils/src/main/java/com/cloud/utils/SerialVersionUID.java:[26,47] error: [BadShiftAmount] Shift by an amount that is out of range
    (see https://errorprone.info/bugpattern/BadShiftAmount)
  Did you mean 'public static final long Base = 0x564D4F70L << 32;'?
[ERROR] /home/dahn/apache/cloudstack/utils/src/main/java/com/cloud/utils/events/SubscriptionMgr.java:[153,23] error: [EqualsHashCode] Classes that override equals should also override hashCode.
    (see https://errorprone.info/bugpattern/EqualsHashCode)
[INFO] 2 errors

this is the main branch of the project, it uses jdk 11 if than is relevant. Any clues?
thanks

Liam Miller-Cushon

unread,
Jan 13, 2023, 12:14:39 AM1/13/23
to error-pro...@googlegroups.com
Are you asking about the 'Illegal reflective access' part? The --add-exports= and --add-opens= flags documented here should suppress that: https://errorprone.info/docs/installation#maven

--
Googlers: This an external list. Please be careful when posting.
---
You received this message because you are subscribed to the Google Groups "error-prone-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to error-prone-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/error-prone-discuss/5048c658-c543-4188-a3e0-997b6de6708en%40googlegroups.com.

Daan Hoogland

unread,
Jan 13, 2023, 1:10:49 AM1/13/23
to error-pro...@googlegroups.com
Yes, I am, I added the complete error output. But as said, this is jdk11. the doc you refer to states that it is needed for jdk16. Are you saying this is also needed for jdk11?



--
Daan

Liam Miller-Cushon

unread,
Jan 13, 2023, 12:23:14 PM1/13/23
to error-pro...@googlegroups.com
The flags are required for JDK 16, because those warnings become errors in JDK 16 (https://openjdk.org/jeps/396). The warnings are present starting in JDK 9, and the flags suppress them.

Daan Hoogland

unread,
Jan 15, 2023, 4:33:25 AM1/15/23
to error-pro...@googlegroups.com
clear, thanks.

You received this message because you are subscribed to a topic in the Google Groups "error-prone-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/error-prone-discuss/LEAMvt4P10c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to error-prone-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/error-prone-discuss/CAL4QsgvMQBkoxSMK-ucoTjvJBevH8suecc9Av4MGDPMA6TG%2BxA%40mail.gmail.com.


--
Daan
Reply all
Reply to author
Forward
0 new messages