Skip to content

CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit www.eclipse.org/openj9/docs

-XX:[+|-]PositiveIdentityHash

Eclipse OpenJ9™ allows both positive and negative identity hashcodes (System.identityHashCode / Object.hashCode). This is problematic for programs that incorrectly assume hashcodes can only be positive.

When enabled, this option limits identity hash codes to non-negative values.

Because limiting identity hash codes to non-negative values can have an impact on the performance of hash-intensive operations, this option is not enabled by default.

Syntax

    -XX:[+|-]PositiveIdentityHash
Setting Effect Default
-XX:+PositiveIdentityHash Enable
-XX:-PositiveIdentityHash Disable yes