Tuesday, December 16, 2014

Raising Sapphire minimum Java version

I am considering raising Sapphire's minimum supported Java version for the release 9 that will be contributed to Mars in the Summer of 2015.

The current minimum supported Java version is 6, last raised for the 0.7 release.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=409330

Java 6 (2006)

Dropping support for Java 6 would allow us to integrate Sapphire models with the try-with-resources feature by making Sapphire Element extend AutoCloseable.

try( Example element = Example.TYPE.instantiate() )
{
    ...
}

vs currently

final Example element = Example.TYPE.instantiate();

try
{
    ...
}
finally
{
    try
    {
        element.dispose();
    }
    catch( final Exception e ) {}
}

Java 7 (2011)

Dropping support for Java 7 would allow us to take advantage of multiple annotations per site improvement in Java 8 and allow us to remove the grouping annotations (@Service and @Services, @Validation and @Validations, etc.).

@Validation( rule = "${ Max >= Min }", message = "Must not be smaller than min" )
@Validation( rule = "${ Max <= 100 }", message = "Must be less than or equal to 100" )
    
ValueProperty PROP_MAX = new ValueProperty( TYPE, "Max" );

vs currently

@Validations
(
    {
        @Validation( rule = "${ Max >= Min }", message = "Must not be smaller than min" ),
        @Validation( rule = "${ Max <= 100 }", message = "Must be less than or equal to 100" )
    }
)
    
ValueProperty PROP_MAX = new ValueProperty( TYPE, "Max" );

Please respond to this post with your thoughts on what minimum Java version support you anticipate needing for Sapphire 9 in Summer of 2015.

Resolution: Based on the feedback received, the minimum Java version for Sapphire 9 and beyond has been changed to Java 8. As a consequence of this change, support for Indigo, Juno and Kepler was dropped (Eclipse added Java 8 support in Luna). Sapphire 8.x will continue to support Java 6 and all Eclipse releases going back to Indigo.

1 comment:

Bananeweizen said...

Go with Java 7. To my personal mind, Eclipse projects are trying to hold compatibility with really old Java versions over a too long time anyway. E.g. some projects are still using Java 5. Why? To stay compatible with other software that didn't manage to make the switch to a newer version?

To get the right perspective, consider this: Even Java 7 will reach end of life in 3 months already: http://www.oracle.com/technetwork/java/eol-135779.html