Archive for the ‘Video’ Category

Eclipse Oxygen.3a IDE Improvements: Java 10

April 12, 2018

Three weeks after the Oxygen.3 and the Java 10 release, Oxygen.3a now adds official support for Java 10 which was previously offered only as a pre-release via the Eclipse Marketplace. Because Oxygen.3a also contains some bug fixes, an upgrade is also recommended for Java developers who do not (yet) want to use Java 10.

The main innovation and the only language change of Java 10 is the so-called Local-Variable Type Inference: within code blocks, in variable declaration, you can use var instead of the type. The specific type is determined implicitly from the assigned value. With var ArrayList<String> list = new ArrayList<>(); can be shortened to var list = new ArrayList<String>();. This is often handy (e. g. in try-with-resources statements like try (var reader = new BufferedReader(new FileReader(path))) { /*...*/ }), but in some cases it can also lead to less readable code (in my opinion e. g. in enhanced for-loops like for (var item : x.getItems()) { /*...*/ }).

var is not a keyword, just a reserved type name. This means that var can still be used as a variable name but not as a type name: int int = 1; and var int = 1; are invalid, but int var = 1; and var var = 1; are both valid Java code. Hopefully I will never have to explain to anyone why a module can be named “module” and a var can be named “var”, but an int cannot be named “int” and a class cannot be named “class” and why “module” is a valid class name whereas “var” is not. And because var is just a reserved type name, final var invar = 1; may look weird but is valid.

Nonetheless, the Eclipse developers did a great job enhancing the Eclipse Java IDE to support var. The inferred type will be shown on mouse over and in the Javadoc view, the content assist is aware of the inferred type and offers the corresponding proposals and in Mark Occurences var is handled as a substitute for the inferred type:

Furthermore, the incremental Eclipse Java compiler had to be adapted for Java 10. Unlike Oracle’s Java compiler javac the Eclipse compiler, however, does not stumble over var s=List.of("a",1).

For Java and other developers, several Eclipse Oxygen.3a IDE packages are available for download. Older versions of Oxygen will prompt you to upgrade to Oxygen.3a unless the built-in automatic update is disabled. Oxygen.3a is the last update for Eclipse Oxygen. Numerous major changes are currently being finalized for the next major release, Eclipse Photon, on June 27. If you want you can already test a pre-release of Eclipse Photon.

Happy coding!


Eclipse Oxygen.3 IDE Improvements: Java, Gradle and PHP

March 21, 2018

Eclipse Oxygen.3 is the last quarterly update of Oxygen. Thanks to everyone who has contributed in any way! Even if the main focus is already on Photon, which will be released on June 27, it is worth updating your Eclipse IDE (unless you want to test a pre-version of Photon instead).

As usual, I have made a short video that shows the IDE improvements that I find most noteworthy in action:


Gradle (see also Buildship 2.2):

PHP (see also PDT 5.3):

Eclipse Oxygen IDE Improvements: General, Java and Git Eclipse Oxygen.1a IDE Improvements: Java 9, JUnit 5, General, Gradle and PHP Eclipse Oxygen.2 IDE Improvements: Java IDE, Git, C/C++

Together with the previous Oxygen videos, you can view 72 improvements in action, in total about half an hour. Here are the direct chapter links (number of improvements in brackets):

Thank you for watching and happy coding!