Apache Developers: Java 7 Contains Bugs
Java 7 holds errors that can cause virtual machines to crash or create bugs in apps, say Apache devs
The newly released Java 7, five years in the making, includes bugs that can cause Java virtual machines to crash or lead to bugs in applications, according to Apache Lucene developers.
Lucene is an open source full-text search engine library written in Java. In an email list posting, the project warned developers to be wary of the new Java release, saying it contains bugs that can affect the code of several projects.
Bugs Hit Core And Solr
“Oracle released Java 7 today. Unfortunately it contains HotSpot compiler optimisations which miscompile some loops,” the advisory read. “This can affect code of several Apache projects. Sometimes JVMs only crash but, in several cases, results calculated can be incorrect, leading to bugs in applications.”
Apache Lucene Core and Apache Solr are two of the Apache projects affected by the bugs, according to the advisory.
“Solr users with the default configuration will have Java crashing with SIGSEGV [invalid memory reference] as soon as they start to index documents, as one affected part is the well-known Porter stemmer,” the advisory said. “Other loops in Lucene may be miscompiled, too, leading to index corruption.”
The problems were detected only five days before the official release of Java 7, meaning Oracle had no time to fix them, according to the advisory. Oracle has proposed to include fixes for the problems in Java 7 Update 2, according to the Lucene project.
“This means you cannot use Apache Lucene/Solr with Java 7 releases before Update 2,” the advisory said.
New features
Java 7 brings several new features to the platform, including Project Coin, also known as Java Specification Request 334: Small language enhancements. The project consists of a set of small language changes intended to simplify common, day-to-day programming tasks. The Project Coin language changes enhance developer productivity and reduces the amount of code needed to do certain tasks. Key Project Coin features include the diamond operator, try-with resources and strings in switch.
Oracle launched Java 7 on Thursday with great fanfare, though Java experts said the changes in the language and platform are more evolutionary than revolutionary.
Progressing the language became difficult as Java was plagued by political and market unrest, first at Sun and then at Oracle after its acquisition of Sun. The Java Community Process, which governs the progress of Java, was rife with infighting and accusations of favouritism by Sun and then Oracle. And “Moving Java Forward” became a mantra at Oracle, as if to say it is ours now and we are going to take it forward no matter what.
Adam Messinger, vice president of product development at Oracle, said Java has been at Oracle for 18 months since the company acquired Sun Microsystems and Java is in good hands. Acknowledging that Oracle is “standing on the shoulders of giants” with Java, Messinger noted that Oracle is investing heavily in Java by putting together “the largest team ever” to work on the language and platform by combining the HotSpot and JRockit teams.
Messinger also said Oracle is working to continue to build out the Java community and has moved to make the Java Community Process (JCP) more open.