This bug report is derived from this email to nashorn-dev alias:
http://mail.openjdk.java.net/pipermail/nashorn-dev/2014-August/003345.html
File: atomic.js
x = new java.util.concurrent.atomic.AtomicInteger()
x.incrementAndGet()
print(x + '\n')
function getAtomic() {
return new java.util.concurrent.atomic.AtomicInteger()
}
x = getAtomic()
x.incrementAndGet()
print(x + '\n')
Expected output:
1
1
Output seen with jdk8u20:
1
1
Output seen with jdk8u-dev and jdk9-dev:
1
atomic.js:10 TypeError: 0 has no such function "incrementAndGet"
Output with --optimistic-types=false option:
1
1