Eclipse Authors: Pat Romanski, Elizabeth White, Liz McMillan, David H Deans, JP Morgenthal

Related Topics: Java IoT, Eclipse, Recurring Revenue

Java IoT: Article

Five Years Waiting for JRE 7: Is It Justified? (Part 1)

Comparing JRE 6 to JRE 7

Metric View
In the Metric View, the code base is represented through a Treemap. Treemapping is a method for displaying tree-structured data by using nested rectangles. The tree structure used in a JavaDepend treemap is the usual code hierarchy:

  • Java projects contain packages
  • Packages contain types
  • Types contain methods and fields

The treemap view provides a useful way to represent the result of CQL request, so we can see the types concerned by the request.

For example to have an idea of which types were added to JRE 7, we can execute the following CQL request:


The blue rectangles represent all code elements added.

Code Changes
Dependency cycles betwen jars. Having a dependency cycle is an indicator of a lack of levelization, and to improve the design it's better to avoid them. Here's a nice blog post that describes the goal of layering. JRE 6 as shown by the following dependency graph contains three dependency cycles between jars.

But for JRE 7 a refactoring was made, and the dependency cycle between rt and charsets was removed.

What changes made in JRE 7 were responsible for removing this dependency cycle? To answer this question let's discover what rt jar was used before in other jars.

SELECT TYPES WHERE IsDirectlyUsedBy "rt"

Only HKSCS from charsets was used in rt. This class was removed from charsets to rt  and that explain why the dependency cycle disappeared. But other dependency cycles remain. To see what code elements are implied in this dependency cycle, let’s search for types used by rt that exist in other jars concerned with the dependency cycle.

The interesting remark is that for jsse only two types remain used. Before in JRE 6 18 types was used, and we hope that for the next release this dependency cycle disappears also.

Abstractness vs Instability
The “Abstractness vs Instability” graph can be useful to detect projects that will be difficult to change. This following post describes the utility of this graph and how to exploit it to improve the design. It's interesting to know if with JRE 7 this indicator has improved or not. Here's the graph regarding JRE 6.

As we can observe only rt is in the red zone. That means that any changes to rt could impact other jars and a big testing effort is needed to validate that there's no regression. And here's the graph regarding JRE 7.

It has shifted a little more than before into the red zone, which is not a good point for JRE 7, there's more risk when changing rt.

Methods Changed
To detect implementation refactoring we can search all methods where the code was changed.


Only 5% of the code was changed. Methods became deprecated

It's very useful to know which methods became deprecated to avoid using them.

Onlya  few methods became deprecated. And we can also search for deprecated methods but still used by other methods. In this case it's preferable to refactor them.

SELECT  METHODS WHERE IsDeprecated AND MethodCa >0

Dominant Paradigm: Generics or OOP?
2799 types were added to JRE, and it's interesting to know if these types are generics or classes.


Only some types added are generics, so the dominant paradigm is still OOP.

Annotation is a mechanism for associating a meta-tag with code elements and allowing the compiler or the VM to extract program behaviors from these annotated elements and generate interdependent code when necessary. It makes your development easier by allowing you to spend less time writing boilerplate code under many circumstances by enabling tools to generate it from annotations in the source code. Let's search for annotations added in JRE 7.

SELECT TYPES WHERE IsAnnotationClass AND WasAdded

Code Complexity
Cyclomatic complexity is a popular procedural software metric equal to the number of decisions that can be taken in a procedure. This metric is computed from source code. BCCyclomaticComplexity is the same as Cyclomatic Complexity but computed from byte code.

The following request provides more info about the complexity in JRE 6.

SELECT  TYPES WHERE IsInOlderBuild  AND BCCyclomaticComplexity >0

The average is equal to 20, It's interesting to know the evolution of this average for new features added to JRE7.

SELECT  TYPES WHERE WasAdded AND BCCyclomaticComplexity >0 

The cyclomatic complexity average had decreased slightly for new features added to JRE 7.

Low coupling is desirable because a change in one area of an application will require less changes throughout the entire application. In the long run, this could alleviate a lot of time, effort, and cost associated with modifying and adding new features to an application.

Using interfaces and abstract classes improve the low coupling. Let's search for these kind of types in the added code of JRE 7.

SELECT TYPES WHERE (IsInterface OR IsAbstract) AND WasAdded 

Many interfaces were added. It's a good indicator that features added are described by their contracts and we have the possibility of having many implementations for the same contract, which makes JRE very flexible. For example, if we search types implementing WindowFactory interface:

SELECT TYPES WHERE Implement "com.sun.deploy.uitoolkit.WindowFactory"

The single responsibility principle states that a class should have one, and only one, reason to change. Such a class is said to be cohesive. A high LCOM value generally pinpoints a poor cohesive class. There are several LCOM metrics. The LCOM takes its values in the range [0-1]. The LCOMHS (HS stands for Henderson-Sellers) takes its values in the range [0-2]. Note that the LCOMHS metric is often considered a more efficient way to detect non-cohesive types. A LCOMHS value higher than 0.95 should be considered alarming. Let's search for added that can be considerd noncohesive.

SELECT TYPES WHERE LCOMHS > 0.95 AND   NbFields > 10 AND   NbMethods >10 AND WasAdded

Only three classes could be considered noncohesive.

Meir Manny Lehman said: "As an evolving program is continually changed, its complexity, reflecting deteriorating structure, increases unless work is done to maintain or reduce it." We have to be aware of any evolution and try to improve the implementation and design. For that we need to audit the code after each developement iteration to keep the code flexible and easy to maintain. Regarding JRE no big changes concerning refactoring were made and only 5% of the existing code was changed. In the next post we will focus more on added types, and see if there are many features added that can explain the five year wait.

More Stories By Lahlali Issam

Lahlali Issam Lead Developer at JavaDepend, a tool to manage and understand complex Java code. With JavaDepend, software quality can be measured using Code Metrics, visualized using Graphs and Treemaps, and queried using CQL language, a SQL like to query the code base.

@ThingsExpo Stories
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things’). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing? IoT is not about the devices, it’s about the data consumed and generated. The devices are tools, mechanisms, conduits. In his session at Internet of Things at Cloud Expo | DXWor...
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone inn...
SYS-CON Events announced today that Google Cloud has been named “Keynote Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Companies come to Google Cloud to transform their businesses. Google Cloud’s comprehensive portfolio – from infrastructure to apps to devices – helps enterprises innovate faster, scale smarter, stay secure, and do more with data than ever before.