Eliminating Swear Words From OpenJDK
Written by Sue Gee   
Tuesday, 18 December 2018

Last week concern was raised over "too many swear words" in  the source code for OpenJDK. Within three days the issue was resolved after a courteous exchange of views.


The issue was opened by IBM software developer Adam Farley, who is an OpenJDK team member and contributor. His initial post to the core-libs-dev mailing list opened with:

I've spotted 12 instances of swear words in OpenJDK source comments, and it seems appropriate to remove them.

Although he had already created a bug report and a webrev intended to rectify the situation, and maybe in view of the fallout that had followed the attempt to deal with the f-word in the Linux kernel code, Farley invited comments prior to going any further to replace instances of f***, "damn" and "crap".

The first response, from Alan Bateman at Oracle pointed out that:

"Where's that damn torpedo?" might be from Star Trek. 

Agreeing that Kirk said it, Farley suggested "darn" might preserve the quote but later conceded that "damn" was acceptable after Oracle's David Holmes pointed out it was not a swear word and provided dectionary definitions to prove it.

He also had to give way regarding "crap" partly on the grounds that replacing it by an alternative such as "difficult" just didn't convey the same meaning. Another objection to the suggested change came from Phil Race at Oracle who pointed out that it would create far too much work:

Regarding the comment in the bug report about
hb-private.hh and the use of /* CRAP pool: Common Region for Access Protection. */ since it not only is in an upstream library, but also used 14 times in variable names, then I can't possibly agree with your comment that an argument for leaving them would be "shaky". Take this up with the upstream library ... I have no interest in renaming these every time we upgrade this library.

Even Mark Reinhold expressed his opinion saying:

I can certainly see removing the f-word, and other words of a sexual nature. Those are clearly inappropriate. Removing lesser words, and continuing to police their use henceforth, strikes me as overkill.

However, as most of the instances of f*** were indentified as being in an upstream library, they were left to be dealt with elsewhere on the grounds that:

... we shouldn't touch imported sources...Let the rudeness be fixed at source.

In light of the comments the following three determinations were made: 

  • "Damn" and "Crap" are not swear words.
  • Three of the four f-bombs are located in jszip.js, which should be corrected upstream (will follow up).
  • The f-bomb in BitArray.java, as well as the rude typo in SoftChannel.java, *are* swear words and should be removed to resolve this work item.

Having implemented the changeset, Stuart Marks posted:

As a closing observation, I'll note that the original patch did find several vulgarities in OpenJDK. However, all of them originated from upstream sources. That means the 8 million or so lines of code in OpenJDK that aren't from any upstream source base don't have any vulgarities. smarksjdk

This is clearly a joke and didn't attract any recriminations.

Personally I find myself in agreement with Pavel Rappo who chipped in with:

I wouldn't change cave art just because we might find it inappropriate, it's history now.

Another comment that strikes me as the correct balance came from Red Hat's Andrew Haley who posted:

Sometimes emphasis is important, and to reduce a very strong emphasis to mild disapproval is an information-losing change. We would be doing a disservice to the reader.

The most tetchy comment in the entire thread came from Mark Reinhold who marked it as nit-picking:

Nit: Please use sentence case in issue summaries  (“OpenJDK source has too many swear words”) rather  than title case.  This is just a patch, not a novel.
- Mark




More Information

JDK-8215217: OpenJDK source has too many swear words

Related Articles

Insane Linux Kernel Patches Resulting From Code Of Conduct 

JVM Ecosystem Report Reveals the State of Java 

Java 8 Still Dominates

Is Java Still Free?

Oracle Says Drop Nashorn From JDKs

JDK 10 Released

Oracle Promises To Open Source Oracle JDK And Improve Java EE

JavaFX Will Be Removed From JDK


To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.


JetBrains Updates IDEs With AI Code Completion

JetBrains has launched the first set of updates for 2024 of its JetBrains IDEs. The new versions include full-line code autocompletion powered by locally run AI models.

GitHub Introduces Code Scanning

GitHub has announced a public beta of a code scanner that automatically fixes problems. The new feature was announced back in November, but has now moved to public beta status.  

More News

raspberry pi books



or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 18 December 2018 )