Eclipse Project Photon (4.8) M6 - New and Noteworthy

Modify project natures The Project Properties dialog now features a page to add or remove natures on a project.

As mentioned on the page, some natures may not properly handle manual addition/removal, so using this can lead to some inconsistencies in those cases.
Possibility to configure the color of text editor's range indicator The text editor's range indicators's color can now be configured via the Colors and Fonts preference page.

Range indicator in the Colors and Fonts preference page

Styling for text editor's range indicator The Eclipse default dark theme now includes styling for the text editor's range indicator.

Range indicator in the dark theme

Improved text operation icons for the dark theme The block selection, word warp and show whitespace icons have been adjusted to look good in the dark theme.



Improved text color in text editor for the dark theme The text editor now uses an improved font color in the dark theme so that you can read better.


Allow workspace to build projects in parallel The Workspace preference page now has a new option to allow the workspace to build projects in parallel:

preference page screenshot

Under some safe circumstances, the workspace can now choose to build independent projects in parallel. In such case, the maximum amount of jobs/threads that will be running builds in parallel will be controlled by this preference. A value of 1 will indicate that build won't be parallelized keeping the legacy behavior.

The optimal value will depend on the machine and workspace projects specificities. Recommendation is to try relatively low values (such as 4) first which will allow to save time, when allowed by projects, while not risking the CPU overload.

Refresh on access on by default For years the Eclipse IDE is shipping with a customization that files are automatically refreshed if the user accesses them. Other Eclipse based tools like the Spring Tools Suite were missing this customization, so now they do not have to manually instruct their IDE to see the update.
Open resource dialog always shows the paths You can now use the Open Resource dialog to see the file paths. Previously it only showed the paths if there were duplicate entries.


@NonNullByDefault improvements When using annotation-based null analysis, there are now more ways to define which unannotated locations are implicitly assumed to be annotated as @NonNull:
  • @NonNullByDefault annotations based on enum DefaultLocation can be also used if the primary nullness annotations are declaration annotations (previously this was supported only for TYPE_USE annotations).
  • Support for @NonNullByDefault annotations that are targeted at parameters has been implemented.
  • Multiple different @NonNullByDefault annotations (especially with different default values) may be placed at the same target, in which case the sets of affected locations are merged.
  • Annotations which use a meta annotation @TypeQualifierDefault instead of a DefaultLocation-based specification are now understood, too, e.g. @org.springframework.lang.NonNullApi.
Version 2.2.0 of bundle org.eclipse.jdt.annotations containing an annotation type NonNullByDefault that can be applied to parameter and module declarations (in addition to the previously allowed targets).
Test sources There is now support for running Java annotation processors on test sources. The output folder for files generated for these can be configured in the project properties in Java Compiler > Annotation Processing as Generated test source directory

Improved coloring of inherited members in the Quick Outline in the dark theme The Eclipse default dark theme now includes styling of inherited members in JDT's Quick Outline. This improves readability in the dark theme a lot. The color can be configured via the "Java > Inherited Members" color definition on the Colors and Fonts preference page.



Generate dialogs use verbs instead of OK The "Generate..." dialogs of the Java tools have been adapted to use verbs instead of OK.
Sort library entries alphabetically in Package Explorer The content of libraries are displayed in the order of the classpath. This makes it difficult to find specific libraries by their name, especially when projects have many dependencies. The library entries can now be sorted alphabetically when setting the preference "Sort library entries alphabetically in Package Explorer" on the Java > Appearance preference page:

before before

The default for this preference is OFF.

Formatter: align Javadoc tags in columns The formatter can now align names and/or descriptions in Javadoc tags in new ways. The formatter profile editor is available for selection, under Comments > Javadoc.

For example, the Align descriptions, grouped by type setting is now used in the built-in Eclipse profile.

The setting previously known as Indent Javadoc tags is now called Align descriptions to tag width. The two settings related to @param tags also had their labels changed to better describe what they do.

QuickFix for unresolved module on module name in requires directive A new quickFix is offered on requires statements in the file to fix issues that are reported due to unresolved module. The below quickFix will be provided if the module related to the unresolved module error has its related classpath added to the class path and not to the module path.

This quickFix is applicable if the project is a Java9 project and has a file

This quick Fix can be invoked from the editor.

Before the quickFix is applied the classpath entries look as below:

After the quickFix is applied the classpath entries look as below:

Creation of file on creation of a New Java9 Project A new feature is offered on creation of a java project with compliance Java9 or above for the creation of file.

A new checkbox is added in page 2 of the project creation page, highlighted in RED in the Page 2 image below.

Page 1

Page 2

The new checkbox for the creation of file is checked by default

If this checkbox is checked, upon project creation the below dialog will appear for creation of a new file

Selecting Don't Create in the above dialog does not create the file, but creates the project.

Test sources Sources folders in plug-in projects whose project name ends with ".test" or ".tests", or contains ".tests.", are now marked to contain test sources when using Plug-in Tools > Update Classpath..., so the related filtering options in various tools can be used. The exact name matching rule can be configured as regular expression in Preference > Plug-In Development in the group Test plug-in detection. Setting it to an empty value disables this mechanism.

Command to update IU versions The right-click context menu within .target file source editors now contains a new Update IU Versions from Repositories command to update the version attribute of all units to the newest available version.



Improved coloring of the target file editor in the dark theme The text colors for .target file source editors have been updated to be more legible in the dark theme.



Platform Developers
New API: org.eclipse.e4.core.di The package org.eclipse.e4.core.di in bundle org.eclipse.e4.core.di has been released as API. This package contains the following mentionable types:
  • InjectionException: When using the ContextInjectionFactory to manually trigger dependency injection, all methods eventually throw an InjectionException. By making org.eclipse.e4.core.di API, this InjectionException becomes API, too and can therefore be processed properly.
  • IInjector: To manually trigger dependency injection on a more fine-grained level, e.g. without using the IEclipseContext as an ObjectSupplier.
  • InjectorFactory: To create an instance of IInjector.
New API getAverageCharacterWidth added to FontMetrics A new method has been added in FontMetrics:

double getAverageCharacterWidth()

which is a replacement for

int getAverageCharWidth()

They are similar in function, except that the new method returns the average character width of the Font as a double-precision floating point value instead of a integer value.

The method FontMetrics#getAverageCharWidth() has been deprecated.

Datetime on Gtk now has support for localization Datetime on Gtk now has support for localized date format.
A snippet to demonstrate can be found Snippet370 .
Configure workspace description to allow independent projects to build in parallel The IWorkspaceDescription has received a new API method setMaxConcurrentBuilds(int n) which allows to configure throttling of how many threads/jobs will be used in case workspace can build independent projects in parallel.

At the moment, parallel builds with happen when under safe circumstances, depending on the scheduling rules involved in IncrementalProjectBuilder.getRule(). Having all builders specifying a "relaxed" scheduling rule (not containing workspace root) is a requirement for paralllel builds to happen. As such, to take advantage of parallel builds, consider refining the implementation of getRule() in your builders.

Passing a value of 1 to setMaxConcurrentBuilds(int n) will disable the parallel builds in general, and will make workspace build behave as it's used to, building projects sequentially. This it still the default value and behavior, so it makes parallel builds of independent project an opt-in feature so far.

The optimal value for throttling depends on your machine and workspace projects specificities. We do recommend to try relatively low values (such as 4) first which already allow to save time, when projects allow it, while not risking to overload your CPU.

JDT Developers
Package binding with recovery The existing method IBinding#getJavaElement() now accommodates recovered packages in which case a null may be returned for such problem package bindings. Pre-Java 9 compliant code will continue to have a non-null return value for this api for packages.
Use SHA-256 to check artifact's data integrity To ensure data integrity of artifacts, alongside MD5, p2 now also generates and checks checksums using SHA-256 MessageDigest implementation, provided by any JRE. These checksums stored in two new artifact's metadata properties:
  • download.checksum.sha-256
  • artifact.checksum.sha-256
In standalone applications like a mirror application, use org.eclipse.equinox.artifact.comparator.checksum.sha-256 as a comparator ID.
Support any MessageDigest implementation as artifact's checksum algorithm With new extension point org.eclipse.equinox.p2.artifact.repository.artifactChecksums, it is now possible to contribute any MessageDigest implementation as a way to calculate and check artifact's checksums:
  • Register your contribution:
                <extension point="org.eclipse.equinox.p2.artifact.repository.artifactChecksums">
                  <artifactChecksum algorithm="TIGER" id="tiger"/>
  • In your bundle's Activator, register a SecurityProvider that provides an actual MessageDigest implementation:
                public void start(BundleContext context) throws Exception {
                  Security.addProvider(new BouncyCastleProvider());
  • Create p2 repository

    Artifact's checksum will be calculated using your implementation and stored in two new properties, download.checksum.tiger and artifact.checksum.tiger.

  • Consume in p2 client

    If p2 client has no support for such MessageDigest implementation, it will ignore it.

For more information, check artifactChecksums extension point's documentation.

The above features are just the ones that are new since the previous milestone build. Summaries for earlier Photon milestone builds: