Question

I just came across a BNF Grammar for JAVA. In it, "modifier" has a terminal symbol called "threadsafe". However, I have never seen it before and have not been able to locate that modifier in The Java Language Specification, Java SE 7 Edition (docs.oracle.com/javase/specs/jls/se7/jls7.pdf). Yet, I found it here, describing it in bullet 16 as:

If another thread excuting this code at the same time can not change the value of a variable then the variable is threadsafe and the compiler may do clever things with it to make the code faster or smaller.

Is this a real modifier? Is it supposed to be introduced in upcomming versions of JAVA?

Was it helpful?

Solution

Try to find it here, at the official source of Java BNF.

OTHER TIPS

No it's not, nor is private_protected in the same list.

Both Java and Groovy have keywords like "threadsafe" and "goto" as "reserved tokens" in the compiler, but they have no meaning right now in the language.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top