Introducing Vert.x MQTT client

by sammers21 at August 21, 2017 12:00 AM

In this article we will see how to sett up the new Vert.x MQTT client. Actually, I have a real example so you can try it quickly.

If you are using Maven or Gradle, add the following dependency to the dependencies section of your project descriptor to access the Vert.x MQTT client:

  • Maven (in your pom.xml):
<dependency>
    <groupId>io.vertxgroupId>
    <artifactId>vertx-mqttartifactId>
    <version>3.5.0.Beta1version>
dependency>
  • Gradle (in your build.gradle file):
dependencies {
  compile 'io.vertx:vertx-mqtt:3.5.0.Beta1'
}

Now that you’ve set up your project, you can create a simple application which will receive all messages from all broker channels:

import io.vertx.core.AbstractVerticle;
import io.vertx.mqtt.MqttClient;
import io.vertx.mqtt.MqttClientOptions;

import java.io.UnsupportedEncodingException;

public class MainVerticle extends AbstractVerticle {

  @Override
  public void start() {
     MqttClientOptions options = new MqttClientOptions();
      // specify broker host
      options.setHost("iot.eclipse.org");
      // specify max size of message in bytes
      options.setMaxMessageSize(100_000_000);

    MqttClient client = MqttClient.create(vertx, options);

    client.publishHandler(s -> {
      try {
        String message = new String(s.payload().getBytes(), "UTF-8");
        System.out.println(String.format("Receive message with content: \"%s\" from topic \"%s\"", message, s.topicName()));
      } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
      }
    });

    client.connect(s -> {
      // subscribe to all subtopics
      client.subscribe("#", 0);
    });
  }
}

The publishHandler is the handler called each time the broker, located at iot.eclipse.org:1883, sends a message to you, from the topics you are subscribing for.

But only providing a handler is not enough, you should also connect to the broker and subscribe to some topics. For this reason, you should use the connect method and then call subscribe when the connection established.

To deploy this verticle from an application you should have in your main method something like that:

Vertx vertx = Vertx.vertx();
vertx.deployVerticle(MainVerticle.class.getCanonicalName());

When you have completed all steps correctly the result should look like that:

As the alternative and recommended way to bootstrap Vert.x applications you can use vertx-maven-starter or vertx-gradle-starter. For completing this guide I have used the first one. The final source code available here. If you would like to learn more about Vert.x MQTT client API then check out the full documentation and more examples.

Thank you for reading!

Cheers!


by sammers21 at August 21, 2017 12:00 AM

As a matter of Factory — Part 1 (Mutable)

by Donald Raab at August 18, 2017 08:35 PM

I’ve read a few blogs, articles and tweets over the past year about an upcoming feature in Java 9. Some of the articles have been titled “Immutable Collections in Java 9”. There will be new factory methods on the Java collections interfaces (List, Set, Map) that will create “compact, unmodifiable collection instances”. This feature is described in JEP 269 — http://openjdk.java.net/jeps/269. This feature will be a welcome addition for many Java developers, especially in places like unit tests, where creating small collections can be a frequent and potentially cumbersome activity.

But… we are not getting “contractually” immutable collections in Java 9 and JEP 269 does not claim to provide them. If we were getting “contractually” immutable collections in Java 9, I would expect to see new interfaces named ImmutableCollection, ImmutableSet, ImmutableList and ImmutableMap. Those interfaces could then have the “of” factory methods to produce compile time safe immutable collection instances. ImmutableCollection interfaces should not have methods like add/addAll, remove/removeAll on them because these methods are unsafe and can only throw UnsupportedOperationExceptions.

If you are looking for contractually immutable collections for Java, there are a few open source libraries available today that provide them. Eclipse Collections provides both mutable and immutable collections, and has collection factories for both of them. In part 1 of this blog, I will compare the mutable factory methods available in Eclipse Collections with the new factory methods that will be added in Java 9. In part 2, I will explore the factories available for immutable collections.

There have always been static factory methods on all of the mutable container implementations in Eclipse Collections. These methods are still available, so you can write the following to create mutable Lists, Sets and Maps using Eclipse Collections.

MutableList<String> list = 
FastList.newListWith(“1”, “2”, “3”);
MutableSet<String> set = 
UnifiedSet.newSetWith("1", "2", "3");
MutableMap<Integer, String> map = 
UnifiedMap.newWithKeysValues(1, "1", 2, "2", 3, "3");

For developers new to the library, these methods can be hard to discover because the developer first needs to know the name of the appropriate implementation classes .

When immutable collections were introduced in the library, we had to make a decision how to create them. We wanted a consistent approach for creating both mutable and immutable collections that would follow a consistent convention that would be easy for developers to learn. Our solution was to create dedicated collection factory classes. We decided the convention we would use with our factory classes would be to match the container types we had with corresponding types that ended in “s”. So List(s), Set(s), Map(s), etc. We aim for good symmetry here so we can meet developer expectations. Here’s the equivalent code to create mutable collection instances using the factory classes.

MutableList<String> list = 
Lists.mutable.with(“1”, “2”, “3”);
MutableSet<String> set = 
Sets.mutable.with("1", "2", "3");
MutableMap<Integer, String> map = 
Maps.mutable.with(1, "1", 2, "2");

If you want to create empty mutable collections, simply use the empty() method.

MutableList<String> list = 
Lists.mutable.empty();
MutableSet<String> set = 
Sets.mutable.empty();
MutableMap<Integer, String> map = 
Maps.mutable.empty();

If you would like a more succinct option for creating collections, you can use the Iterables class with static imports. Then you can write the following.

MutableList<String> list = 
mList("1", "2", "3");
MutableSet<String> set = 
mSet("1","2","3");
MutableMap<Integer, String> map = 
mMap(1, "1", 2, "2", 3, "3");

The “m” methods are short for “mutable” and there are also “i” methods which are short for “immutable”.

All of the mutable interfaces in Eclipse Collections extend the corresponding mutable interfaces in the JDK. So MutableList is a java.util.List, MutableSet is a java.util.Set, etc.

Yellow — JDK, Blue — Eclipse Collections

The mutable factories will return the most specific type (e.g. MutableList), but you can choose to use a more abstract type (e.g. java.util.List).

List<String> list = 
Lists.mutable.with(“1”, “2”, “3”);
Set<String> set = 
Sets.mutable.with("1", "2", "3");
Map<Integer, String> map = 
Maps.mutable.with(1, "1", 2, "2", 3, "3");

The factory methods being added in Java 9 will look as follows.

List<String> list = 
List.of(“1”, “2”, “3”);
Set<String> set = 
Set.of("1", "2", "3");
Map<Integer, String> map = 
Map.of(1, "1", 2, "2", 3, "3");

The difference is that the above methods return unmodifiable instances which have mutable interfaces.

If you want to use the java.util.Collection interfaces, and want the instances returned to be unmodifiable like the Java 9 factory methods directly above, you can use asUnmodifiable() method available on all mutable collections in Eclipse Collections.

List<String> list = 
Lists.mutable.with(“1”, “2”, “3”).asUnmodifiable();
Set<String> set = 
Sets.mutable.with("1", "2", "3").asUnmodifiable();
Map<Integer, String> map = 
Maps.mutable.with(1, "1", 2, "2", 3, "3").asUnmodifiable();

If you want them to be synchronized, you can use asSynchronized().

List<String> list = 
Lists.mutable.with(“1”, “2”, “3”).asSynchronized();
Set<String> set = 
Sets.mutable.with("1", "2", "3").asSynchronized();
Map<Integer, String> map = 
Maps.mutable.with(1, "1", 2, "2", 3, "3").asSynchronized();

The following shows all of the factories for mutable object collections that are available in Eclipse Collections.

MutableList<T> list = Lists.mutable.empty();
MutableSet<T> set = Sets.mutable.empty();
MutableSortedSet<T> sortedSet = SortedSets.mutable.empty();
MutableMap<K, V> map = Maps.mutable.empty();
MutableSortedMap<K, V> sortedMap = SortedMaps.mutable.empty();
MutableStack<T> stack = Stacks.mutable.empty();
MutableBag<T> bag = Bags.mutable.empty();
MutableSortedBag<T> sortedBag = SortedBags.mutable.empty();
MutableBiMap<K, V> biMap = BiMaps.mutable.empty();
MutableListMultimap<K, V> multimap = Multimaps.mutable.list.empty();
MutableSetMultimap<K, V> multimap = Multimaps.mutable.set.empty();
MutableBagMultimap<K, V> multimap = Multimaps.mutable.bag.empty();

Eclipse Collections also supports containers for all eight of the Java primitive types as well. In order to provide good symmetry with their object counterparts, there are factory classes for all of the mutable primitive container types as well.

MutableIntList list = 
IntLists.mutable.empty();
MutableIntSet set =
IntSets.mutable.empty();
MutableIntBag bag =
IntBags.mutable.empty();
MutableIntStack stack =
IntStacks.mutable.empty();
// supports all combinations for all 8 primitives
MutableIntIntMap map =
IntIntMaps.mutable.empty();
MutableIntObjectMap<V> map =
IntObjectMaps.mutable.empty();
MutableObjectIntMap<K> map =
ObjectIntMaps.mutable.empty();

There are factories for all primitive types for all container types. The mutable primitive containers also have unmodifiable and synchronized versions as well, to provide good symmetry with their object counterparts.

MutableIntList list = 
IntLists.mutable.with(1, 2, 3).asUnmodifiable();
MutableIntList list = 
IntLists.mutable.with(1, 2, 3).asSynchronized();

The collection factories in Eclipse Collections work with all versions of Java all the way back to version 5. If you want to use the collection factories with Java versions prior to Java 8, you will need to use Eclipse Collections 7.x. Eclipse Collections 8.x is only compatible with Java 8+. Both Eclipse Collections 7.x and 8.x work with Java 8.

With of or of with

All of the examples that I have shown so far that use “with”, can also be written using “of” as well. In a naming battle between “with” and “of”, there were two winners. So you can write the following if you prefer of instead of with. FWIW, the “with” approach is more consistent with Smalltalk style.

List<String> list = 
Lists.mutable.of(“1”, “2”, “3”);
Set<String> set = 
Sets.mutable.of("1", "2", "3");
Map<Integer, String> map = 
Maps.mutable.of(1, "1", 2, "2", 3, "3");

I think this is a good place to stop for now. In part 2 of this blog series, I will give an overview of the immutable factories that are available for Eclipse Collections.


by Donald Raab at August 18, 2017 08:35 PM

Be a 10X Developer! Write Parameterized Tests

by maggierobb at August 18, 2017 06:06 PM

Following on from Yannick’s previous post about the necessity of thorough testing we wanted to look at the subject from an alternative angle. Within the confines of Junit’s Parameterized Test it is possible to test multiple classes simultaneously – thus saving  time and effort – but as with every labour-saving device, the devil is in the detail at the front end of the task – how to create a test we can rely on that will also reduce our ongoing test maintenance burden? Kichwa Coders’ intern Pierre Sachot grapples with this problem in his latest blog detailing how he set about creating a Parameterized Test within the Eclipse January Project. Find out how he got on and let us know what you think in the comments below.

Context:

I was back on the January Eclipse project, more specifically on JUnit Tests. We needed to test two functions of the Maths.java: arctan2() function and abs() in order to calculate the absolute value of a Dataset. I worked more on the second function, and as those two functions were really similar we decided to create a Parameterized Test class to include the first function too. This is a test that could be applied to both series of code, with only variable changing. It can therefore be used to test a function with a lot of values to find the one which is failing, or in our case, on several class types.

Tests before using Parameterized Tests:

Our tests were really similar:

@Test
public void testAbsDoubleInput() {
  double[] obj = new double[] { 4.2, -2.9, 6.1 };
  Dataset a = DatasetFactory.createFromObject(obj);

  int size = a.getSize();
  double[] c = new double[size];
  for (int i = 0; i < size; i++) {
    double abs = Math.abs(obj[i]);
    c[i] = abs;
  }
  Dataset expectedResult = DatasetFactory.createFromObject(c);

  Dataset actualResult = Maths.abs(a);
  TestUtils.assertDatasetEquals(expectedResult, actualResult, true, ABSERRD, ABSERRD);
}

@Test
public void testAbsbyteInput() {
  Dataset a = DatasetFactory.createFromObject(new byte[] { -4, 8, 6 });

  int size = a.getSize();
  byte[] c = new byte[size];
  for (int i = 0; i < size; i++) {
    int abs = Math.abs(a.getByte(i));
    c[i] = (byte) abs;
  }
  Dataset expectedResult = DatasetFactory.createFromObject(c);

  Dataset actualResult = Maths.abs(a);
  TestUtils.assertDatasetEquals(expectedResult, actualResult, true, ABSERRD, ABSERRD);
}

Here I have shown examples of two of the classes, but we did in fact use it for six. So now we needed to identify what was similar and what was different in all the tests, and what could be changed to make them more similar.

Here the actualResult needed to be in the result type we wanted, because that is what we needed to test, but the expected result type could be written which ever way we wanted it:

public void testAbsDoubleInput() {
  double[] obj = new double[] { 4.2, -2.9, 6.1 };
  Dataset a = DatasetFactory.createFromObject(DoubleDataset.class, obj);

  int size = a.getSize();
  double[] c = new double[size];
  for (int i = 0; i < size; i++) {
    double abs = Math.abs(obj[i]);
    c[i] = abs;
  }
  Dataset expectedResult = DatasetFactory.createFromObject(DoubleDataset.class, c);

  Dataset actualResult = Maths.abs(a);
  TestUtils.assertDatasetEquals(expectedResult, actualResult, true, ABSERRD, ABSERRD);
}

@Test
public void testAbsbyteInput() {
  double[] obj = new double[] { 4.2, -2.9, 6.1 };
  Dataset a = DatasetFactory.createFromObject(ByteDataset.class, obj);

  int size = a.getSize();
  double[] c = new double[size];
  for (int i = 0; i < size; i++) {
    double abs = Math.abs(obj[i]);
    c[i] = abs;
  }
  Dataset expectedResult = DatasetFactory.createFromObject(ByteDataset.class, c);

  Dataset actualResult = Maths.abs(a);
  TestUtils.assertDatasetEquals(expectedResult, actualResult, true, ABSERRD, ABSERRD);
}

Here in the Dataset constructor you can see that we created a ByteDataset from a double array. This was possible because Dataset class allows the user to do this. Now it was possible to see that the only thing that would need to be changed in our tests was the class variable in order to create the Dataset.

We wrote a variable to take the class type like this:

@Test
public void testAbsbyteInput() {
  Class<? extends Dataset> class1 = ByteDataset.class;
  double[] obj = new double[] {4.2, -2.9, 6.10};
  Dataset input = DatasetFactory.createFromObject(class1, obj);
  ...
}

Tests using Parameterized Tests:

So once you can write a parameterize class test you can reduce your code size and simplify your tests:

package org.eclipse.january.dataset;

import org.junit.Test;
import org.eclipse.january.asserts.TestUtils;

import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import org.junit.runner.RunWith;

import java.util.Arrays;
import java.util.Collection;

@RunWith(Parameterized.class)
public class MathsBasicTypeAbsFunctionParameterizeTest {

  @Parameters(name = "{index}: {0}") //the "(name = "{index}: {0}")" allows the Junit test to write which test failed with which parameter
  public static Collection<Object> data() { //called to get the array of variables that need to be change
    return Arrays.asList(
      new Object[] {
        FloatDataset.class,
        DoubleDataset.class,
        ByteDataset.class,
        ShortDataset.class,
        IntegerDataset.class,
        LongDataset.class
      });
  }

  @Parameter
  public Class<? extends Dataset> classType; //Parameter which change when the last test is done.

  //parameter specific to our test don't worry about this one
  private final static double ABSERRD = 1e-8;

  @Test
  public void test() {
    Class<? extends Dataset> class1 = classType;
    double[] obj = new double[] {4.2, -2.9, 6.10};
    Dataset input = DatasetFactory.createFromObject(class1, obj);
    Dataset output = DatasetFactory.createFromObject(class1, new double[]{0,0,0});

    int size = input.getSize();
    double[] c = new double[size];
    for (int i = 0; i < size; i++) {
      double abs = Math.abs(obj[i]);
      c[i] = abs;
    }
    Dataset expectedResult = DatasetFactory.createFromObject(class1, c);

    Dataset actualResult = Maths.abs(input, output);
    TestUtils.assertDatasetEquals(expectedResult, actualResult, true, ABSERRD, ABSERRD);
  }
}

Here the function data() is the one which will be called to change the data type. Now we had  a parameterized test which would work with every class which extended Dataset.

Conclusion:

Once you know how to reduce your tests code and can identify things which are the same between tests, it becomes possible to code tests efficiently, winning back time and avoiding code duplication.  This is why Parameterized Tests are essential for every true and wannabe 10X Developer.



by maggierobb at August 18, 2017 06:06 PM

Launching Eclipse IoT Newsletter

August 18, 2017 09:40 AM

We're lauching a quarterly Eclipse IoT Newsletter. Subscribe to receive the first issue this September.

August 18, 2017 09:40 AM

Two new Eclipse projects: Xpect and Xsemantics

by Jens v.P. (noreply@blogger.com) at August 18, 2017 06:59 AM

Yesterday, two new Eclipse projects had been created: Both project are around for quite some time and they both are based on Eclipse Xtext, the famous framework to create editors with all state-of-the-art features (parser, linker, validators, content assist, etc.) for your own textual DSLs, simply based on a grammar.

Xpect is written by Moritz Eysholdt, who is also a committer of Xtext. It is a unit- and integration-testing framework to be used for Xtext-based languages. Instead of writing fiddly JUnit tests, you can simply write things like

// XPECT errors --> "cannot divide two strings"
"hello" / "world"
assuming your language supports division, strings, and types.

And types is the topic of Xsemantics, written by Lorenzo Bettini, author of the book "Implementing DSLs with Xtext and Xtend". It is a DSL (implemented in Xtext itself) for writing type systems, reduction rules, interpreters and general relation rules for languages implemented in Xtext. So you can write rules like that:

rule subtypeUnion_Left
 G|- UnionTypeExpression U <: TypeRef S
from {
 U.typeRefs.forall[T| G |- T <: S]
}
Well, you probably need to know type theory a little bit to see the beauty in that.

Both of these frameworks are heavily used by Eclipse N4JS: it contains more than 10.000 Xpect tests (e.g., all specification tests) and a Java 8 like type system defined in Xsemantics, and this is also why I act as kind of "assisting project lead" to help the original authors to bring these great tools to Eclipse. The authors and the N4JS team at enfore are now working on bringing the code to Eclipse as soon as possible, to simplify the usage of these frameworks for all Xtext users!

Keep on modelling!

I once said that modelling without graphical editors is like Tour de France without mountains. Well, I have to correct myself: a great test suite and a complicated type system are just as exciting ;-)


by Jens v.P. (noreply@blogger.com) at August 18, 2017 06:59 AM

Eclipse IoT Day @ ThingMonk

August 17, 2017 12:55 PM

Register for the Eclipse IoT Day co-located with ThingMonk on September 11 in London, UK.

August 17, 2017 12:55 PM

EclipseCon Europe 2017, Modeling Symposium

by Maximilian Koegel and Jonas Helming at August 17, 2017 10:35 AM

Ed, Philip and I are organizing the Modeling Symposium for the EclipseCon Europe 2017 in Ludwigsburg. It is scheduled for the second day of the conference, i.e., Wednesday, October 25th, 2017. The symposium aims to provide a forum for community members to present a brief overview of their work. We offer 10 minute lightning slots (including questions) to facilitate a broad range of speakers. The primary goal is to introduce interesting, new technological features. This targets mainly modeling projects which are otherwise not represented at the conference.

If you are interested in giving a talk, please send a short description (a few sentences) to munich@eclipsesource.com. Depending on the number, we might have to select among the submissions.

Deadline for submisson: Friday, September 8th, 2017

Please adhere to the following guidelines:

  • Please provide sufficient context. Talks should start with a concise overview of what the presenter plans to demonstrate, or what a certain framework offers.  Even more important, explain how and why this is relevant.
  • Do not bore us! Get to the point quickly.  You do not have to use all your allocation. An interesting 3 minute talk will have a bigger impact than a boring 10 minute talk. We encourage you to plan for a 5 minute talk, leaving room for 5 minutes of discussion.
  • Keep it short and sweet, focus on the most important aspects. A conference offers the major advantage of getting in contact with people who are interested in your work. So consider the talk more as a teaser to prompt follow-up conversations than a forum to demonstrate or discuss technical details in depth.
  • A demo is worth a thousand slides. We prefer to see how your stuff works rather than be told about how it works with illustrative slides.  Please restrict the slides to  summarize your introduction or conclusion.

Looking forward to your submissions!

Jonas


by Maximilian Koegel and Jonas Helming at August 17, 2017 10:35 AM

Presentation: The Java Evolution of Eclipse Collections

by Kristen O'Leary at August 16, 2017 01:26 AM

Kristen O'Leary talks about some of the newest features from the 8.0.0 release including the use of Java 8 features such as Collectors, Optional and SummaryStatistics. These new interactions allow developers to have a more seamless experience coding using both Eclipse Collections and Java. She also discusses some of the upcoming changes to the framework to better prepare for Java 9.

By Kristen O'Leary

by Kristen O'Leary at August 16, 2017 01:26 AM

LiClipse 4.1.1 / LiClipseText 2.0.0

by Fabio Zadrozny (noreply@blogger.com) at August 15, 2017 07:05 PM

Ok, the new versions of LiClipse (4.1.1) and LiClipseText (2.0.0) are now out.

This version had many changes, the major one being that LiClipseText now reuses the same engine that tm4e uses for parsing code when based on a TextMate grammar (which is is a translation from the same engine used in VSCode), so, hopefully this should iron out most issues when dealing with TextMate grammars.

Also, it can now parse in a thread to prevent the UI from becoming unresponsive (although it'll only really do that if there are too many changes for it to parse).

There were also improvements in the definition being used for JavaScript, so, parsing should be *much* faster (although this was done at the expense of not showing some entries in the outline) -- but as on JavaScript having huge files isn't uncommon, the big performance gain, should be worth it.

Aside from that, the standalone is now based on Eclipse 4.7 (final) and PyDev was also updated for 5.9.2, which brought enhancements such as the new debugging approach using bytecode modification with the new Python 3.6 hooks and isort integration, besides a critical fix to the Lucene integration, which affected users which used a different plugin which also used Lucene but on a different version.

So, if you're a LiClipse user, hurry to http://www.liclipse.com/download.html to get the new version!

by Fabio Zadrozny (noreply@blogger.com) at August 15, 2017 07:05 PM

JBoss Tools and Red Hat Developer Studio for Eclipse Oxygen

by jeffmaury at August 14, 2017 05:04 PM

JBoss Tools 4.5 and Red Hat JBoss Developer Studio 11.0 for Eclipse Oxygen are here waiting for you. Check it out!

devstudio11

Installation

JBoss Developer Studio comes with everything pre-bundled in its installer. Simply download it from our JBoss Products page and run it like this:

java -jar jboss-devstudio-<installername>.jar

JBoss Tools or Bring-Your-Own-Eclipse (BYOE) JBoss Developer Studio require a bit more:

This release requires at least Eclipse 4.7 (Oxygen) but we recommend using the latest Eclipse 4.7 Oxygen JEE Bundle since then you get most of the dependencies preinstalled.

Once you have installed Eclipse, you can either find us on the Eclipse Marketplace under "JBoss Tools" or "Red Hat JBoss Developer Studio".

For JBoss Tools, you can also use our update site directly.

http://download.jboss.org/jbosstools/oxygen/stable/updates/

What is new?

Our main focus for this release was on adoption of Eclipse Oxygen, improvements for container based development and bug fixing. Eclipse Oxygen itself has a lot of new cool stuff but let me highlight just a few updates in both Eclipse Oxygen and JBoss Tools plugins that I think are worth mentioning.

OpenShift 3

oc client selection per connection

Some operations (logs, file synchronization) require the user of the oc CLI client. It was possible to specific a single instance of the used oc CLI tool for the whole workspace. This may cause some trouble when working simultaneously with several OpenShift clusters (that may have different version levels). It is now possible to specify the oc CLI tool on the connection level. This is optional, and the default is to use the oc CLI tool specified at the workspace level.

The connection specific oc CLI tool is accessible through the OpenShift connection edit dialog with the Advanced button:

connection wizard override oc1

Enable the Override &aposoc&apos location&apos flag and select a specific oc CLI tool for this connection through the *Browse button:

connection wizard override oc2

OpenShift connections created by the CDK server adapter will automatically have a specific oc CLI tool set as the CDK installs locally an oc CLI tool that is aligned with the embedded OpenShift version.

connection wizard override oc3

OpenShift server and Kubernetes server versions displayed

The OpenShift server and Kubernetes server versions are now displayed in the OpenShift connection properties. This information is retrieved using an un-authenticated request login to the OpenShift cluster is not required. This allow user to verify the OpenShift and Kubernetes level when interacting.

Here is an example based on an OpenShift connection against CDK3:

openshift k8s versions

if the cluster is not started or accessible, then no values are displayed:

openshift k8s versions1

Docker

New Security Options

Support has been added when launching commands in a Container to specify a security option profile. This can be done in lieu of specifying privileged mode. For example, to run gdbserver, one can specify "seccomp:unprofiled" to allow ptrace commands to be run by the gdb server.

The Run Image Wizard has been modified to allow specifying an unconfined seccomp profile to replace the default seccomp profile.

LinuxToolsUnconfinedOption

Security options are also now shown in the Properties View.

LinuxToolsUnconfinedProperty

Docker Tooling JDT Integration

The Eclipse Docker Tooling Feature now contains a plugin that integrates with the Java Development Tools (JDT). This permits the running and debugging of Eclipse Java projects within containers. The functionality is provided through the context menu under the &aposRun As&apos and &aposDebug As&apos options. The daemon connection used, as well as the image chosen are configurable through launch configurations.

Docker-tooling-jdt-debug-menu

This is intended to work in the same way that a regular run/debug session works.

Docker-tooling-jdt-debug

Docker Client Upgrade

The version of docker-client used by the Docker Tooling plug-ins has been upgraded to 6.1.1 for the 3.0.0 release of the Docker Tooling feature.

Server Tools

EAP 7.1 Server Adapter

A server adapter has been added to work with EAP 7.1. It’s currently released in Tech-Preview mode only, since the underlying WildFly 11 continues to be under active development with substantial opportunity for breaking changes. This new server adapter includes support for incremental management deployment like it’s upstream WildFly 11 counterpart.

Removal of Event Log and other Deprecated Code

The Event Log view has been removed. The standard eclipse log is to be used for errors and other important messages regarding errors during server state transitions.

Fuse Tooling

Bean Support

We are happy to finally announce support for Beans (Spring / Blueprint).

Using the Route Editor you can now access Spring / Blueprint Beans in your Camel Context through the Configurations tab.

Configurations tab in Editor

In the Configurations tab you can see all global configuration elements of your Camel Context. You can Add, Edit and Delete elements using the buttons on the right side.

Configurations tab content

By clicking the Add or Edit button a wizard will be openend to guide you on the creation of the Bean.

New Bean wizard

In the wizard you can select an existing bean class from your project or create a new bean class. You can also specify constructor arguments and bean properties. Once created you can then modify the properties of that Bean inside the Properties view.

alt

Hibernate Tools

Hibernate Search Support

We are glad to announce the support of the Hibernate Search. The project was started by Dmitrii Bocharov in the Google Summer Code program and has been successfully transferred in the current release of the JBoss Tools from Dmitrii’s repository into the jbosstools-hibernate repository and has become a part of the JBoss family of tools.

Functionality

The plugin was thought to be some kind of a Luke tool inside Eclipse. It was thought to be more convenient than launching a separate application, and picks up the configuration directly from your Hibernate configuration.

Two options were added to the console configurations submenu: Index Rebuild and Index Toolkit. They become available when you use hibernate search libraries (they exist in the build path of your application, e.g. via maven).

Configuration menu items
Index Rebuild

When introducing Hibernate Search in an existing application, you have to create an initial Lucene index for the data already present in your database.

The option "Index Rebuild" will do so by re-creating the Lucene index in the directory specified by the hibernate.search.default.indexBase property.

Hibernate Search indexed entities
Hibernate Search configuration properties
Index Toolkit

"Open Index Toolkit" submenu of the console configuration opens an "Index Toolkit" view, which has three tabs: Analyzers, Explore Documents, Search.

Analyzers

This tab allows you to view the result of work of different Lucene Analyzers. The combo-box contains all classes in the workspace which extend org.apache.lucene.analysis.Analyzer, including custom implementations created by the user. While you type the text you want to analyse, the result immediately appears on the right.

Analyzers
Explore Documents

After creating the initial index you can now inspect the Lucene Documents it contains.

All entities annotated as @Indexed are displayed in the Lucene Documents tab. Tick the checkboxes as needed and load the documents. Iterate through the documents using arrows.

Lucene Documents inspection
Searching

The plugin passes the input string from the search text box to the QueryParser which parses it using the specified analyzer and creates a set of search terms, one term per token, over the specified default field. The result of the search pulls back all documents which contain the terms and lists them in a table below.

Search tab
Demo

Hibernate Runtime Provider Updates

The Hibernate 5.1 runtime provider now incorporates Hibernate Core version 5.1.8.Final and Hibernate Tools version 5.1.5.Final.

The Hibernate 5.2 runtime provider now incorporates Hibernate Core version 5.2.10.Final and Hibernate Tools version 5.2.5.Final.

Forge

Forge Runtime updated to 3.7.2.Final

The included Forge runtime is now 3.7.2.Final. Read the official announcement here.

Freemarker

Freemarker component deprecation

The Freemarker component has been marked deprecated as there is no more maintenance on the source code. It is still available in Red Hat Central and may be removed in the future.

Seam

Seam component deprecation

The Seam component has been marked deprecated as the Seam project has been stopped. It is still available in Red Hat Central and may be removed in the future.

Gradle

Maven integration has been a long time first class citizen in Red Hat JBoss Developer Studio. Gradle is now having the same level. You can now manage Gradle projects in the base Red Hat JBoss Developer Studio installation. For more information, please see Buildship documentation.

Platform

"Always run in background" enabled by default

The Always run in background preference is now enabled by default. If you prefer to see a progress dialog for long-running operations, you can disable this option on the General preference page.

Improved default styling for the toolbar

The styling of the window toolbar has been improved. On Windows, the toolbar color is now consistent with the color of the perspective switcher.

css styles windows toolbar

New default styling for form-based user interfaces

The default styling for form-based user interfaces was changed to use a flat, gray style. This change was inspired by the popular "Clean Sheet" plug-in. Below you see screenshots of the MANIFEST.MF editor and the Git Staging view in this new design.

forms grey styling2

Images are opened in the Eclipse IDE

Image files are now opened directly in Eclipse by default. The Internal Web Browser has been registered as default editor for files with the png, jpg, jpeg, gif, bmp, and ico extensions.

image opened in eclipse

Use Open With > System Editor to open files in the default external program.

Installation Details menu entry removed

The Help > Installation Details menu entry has been removed. You can access this dialog via Help > About > Installation Details or via Quick Access (Ctrl+3) and then typing "Installation Details".

Maximize and Minimize via Window > Appearance menu

The Maximize and Minimize Active View or Editor menu items have been moved to the Window > Appearance menu. They used to be in the Window > Navigate menu.

"Terminate and Relaunch" from Run menu, context menu and tool bar

A Terminate and Relaunch option is now available while launching from Run menu, context menu and tool bar. The default setting is to launch without terminating previous launches. To enable automatic termination, select the option Terminate and Relaunch while launching on Preferences > Run/Debug > Launching. The behavior not selected on the preference page can also be activated on-demand by holding the Shift key while launching the configuration from history.

launch preference terminate relaunch

Breakpoints in Overview Ruler

Breakpoints are now visible in the Overview Ruler by default.

breakpoint overview ruler

To configure the rendering of annotations, right-click the overview ruler and choose Preferences…​. This directly opens the preference page General > Editors > Text Editors > Annotations.

Configure left and right sides in Compare editors

Compare editors now offer a button Swap Left and Right View.

compare editor

The direction of comparison is preserved between invocations of the Compare editor and can also be changed in the Compare/Patch preference page.

compare preferences

&aposSwitch Workspace&apos and &aposRestart&apos menu items

The Switch Workspace and Restart menu items are now at the bottom of the File menu: just above the Exit item on Windows and Linux, and as last menu items on the Mac.

switch workspace restart menu items

Quick Access search text in Help

You can now Search in Help after you’ve entered text in the Quick Access dialog. The option is shown when the filter text is longer than three characters, and it is always added at the end of the results.

Search in Help using the new Quick Access dialog:

quick access search in help

Search in Help using the standalone dialog:

quick access search in help standalone

Command icons shown in Quick Access

Quick Access (Ctrl+3) now shows the icon for a Command if available. Otherwise, it still shows the default blue ball.

command image visible in quick access

Colors in interactive popups

Interactive popups like JDT’s Quick Outline don’t use the platform’s tooltip colors any more, since those were sometimes hard to read.

Old style:

old popup color constants

New style:

new popup color constants

Simplified filters dialog for Problems, Bookmarks, and Tasks views

The Filters dialog of the Problems, Bookmarks, and Tasks views has been simplified. If you select several configurations, items matching any of these configurations will be shown.

Old dialog in Problems view:

old problems filter

New dialog in Problems view:

new problems filter

Filter dialog for Problems, Bookmarks, and Tasks views easier to reach

The Filters dialog is now accessible from the toolbar of the Problems, Bookmarks, and Tasks views.

Previously, it was only accessible via view menu > Configure Contents…​:

old filter location

Now also as a toolbar button:

new filter location

Editor selection dialog: Use for all

The Editor Selection dialog now offers a one-click option for choosing the editor that should open all files with the same extension in the future.

Example when selecting "file.xyz" and choosing Open with > Other…​:

editor selection dialog one click for all files by type

More high resolution images

More images in the old GIF format were replaced by images in the PNG format. In addition, high resolution images where added. As PNG can handle transparency much better than GIF, the ugly white borders around shapes visible in the dark theme are now gone for these icons.

To see their full beauty, a high-DPI monitor (e.g. a Retina Mac) is needed. The lower part of the screenshot shows the wizard banner image of the Import dialog in high resolution.

import before and after

The right part of the screenshot shows all the icons in high resolution.

customize navigator before and after

&aposFilters and Customization…​&apos in Project Explorer

The Customize View…​ command in the Project Explorer&aposs view menu has been renamed to Filters and Customization…​

filters and customization menu item

Copy Details submenu for Problems and Tasks views

You can copy the description or the resource qualified name of an error, warning, or task into the clipboard using commands in the Copy Details context menu.

problems and tasks copy details submenu

Show Annotation renamed to Show Revision Information

For files checked out from CVS, the Show Annotation command in the text editor’s vertical ruler and in the Team menu has been renamed to Show Revision Information. This change has been synchronized with the Eclipse Git team provider, so future versions of EGit will use the same name.

"Other Projects" working set in Project Explorer

If you’re using the Project Explorer and working sets as top-level elements, the Top Level Elements view menu now provides a way to show an Other Projects group for projects that are not in one of the currently active working sets.

other projects ws

"Recently used filters" feature in Project Explorer

The Project Explorer view now has a Recent Filters menu that shows the most recently used filters.

recent filters project explorer

Reduced window margins

The window margins have been reduced to provide more space in the IDE.

Old style:

window margins old

New style (see the reduced space below the Quick Access box).

window margins new

External browsers on Linux

On Linux, the list of recognized external browsers has been updated to include:

  • Firefox (/usr/bin/firefox)

  • Chrome (/usr/bin/google-chrome)

  • Chromium (/usr/bin/chromium-browser)

  • Epiphany/Gnome Web (/usr/bin/epiphany)

  • Konqueror (/usr/bin/konqueror)

browsers linux update

GTK theme system property

SWT now stores the GTK theme used at launch time in a system property, org.eclipse.swt.internal.gtk.theme. This property can help with troubleshooting issues that are specific to certain themes. It can be viewed in About > Installation Details > Configuration.

Ctrl+E command improvements

You can use the Quick Switch Editor (Ctrl+E) command to list and filter all the open editors. This works now also if you have selected a view in the editor area. You can filter the list using wildcards, and select editors using mouse or keyboard.

Now you can also cycle through the list by pressing Ctrl+E again. Or use Arrow Up/Down as before.

ctrl e improvements

Perspective descriptions in Open Perspective dialog

You can now see the description for a perspective (if provided by the contributing plug-in) by pressing F2 in the Open Perspective dialog.

open perspective dialog description

Improved string matching in Quick Access

You can now search for partial descriptions in Quick Access (Ctrl+3). The search result matches space-separated words in the search string. For example, searching for "clone repo", will match the "Clone a Git Repository" command.

quick access better string matching

The improved string matching works also in case of parenthesis, or when the search string matches the category name.

quick access better string matching extended

Filter previous choices in Quick Access

The Quick Access (Ctrl+3) result list does not show duplicate elements anymore. Now, if a search result element is already in the "Previous Choices" category, it is no longer shown in another category.

quick access filter previous choices

Window title configuration

The title window is now simpler and you can configure it from Preferences. By default the title displays workspace name, editor path and product name.

simplified window title

You can now use Preferences > Workspace to choose what to display in the window title: workspace name, perspective name, workspace path, and product name.

improved window title

"Launch Group" launch configuration type

The new Launch Group launch configuration type allows you to launch multiple other launch configurations sequentially, with configurable actions after launching each group member:

  • None: Continue launching the next member right away

  • Wait until terminated: Continue launching the next member only after this member has terminated

  • Delay: Delay launching the next member for a given amount of seconds.

launch groups

New launch groups can be created via the Run > Run Configurations…​ or Run > Debug Configurations…​ dialogs.

Consistent heap status colors under Linux

The heap status had poor contrast on Linux since GTK3.04. This has been resolved for the heap status to look consistent across all platforms.

heapstatusfix

Fixed Progress view colors for the dark theme

The Progress view has been adjusted for the Eclipse dark theme.

Before:

old progress view

After:

new progress view

Breakpoints view: Sort By > Creation Time

In the Breakpoints view’s view menu, a new Sort By option has been added. This allows sorting by two ways:

  • Name: Current default order, sorts by the displayed name

  • Creation Time: Newly created breakpoints will be shown on top

breakpoints sort by

Wildcards in Quick Access

You can now use * and ? as wildcards to filter Quick Access (Ctrl+3) items. The match ranges are displayed in bold.

quick access wildcard filter

Show/hide Status Bar

You can now hide and show the bottom status bar via menu: Window > Appearance > Hide (Show) Status Bar.

toggle status bar from menu

In Quick Access, the command is called Toggle Statusbar.

Improved Launch Groups

The UI for the new Launch Groups feature in the Run/Debug Configurations…​ dialog has been reworked to be more intuitive and user friendly. Also, additional configuration possibilities have been added:

  • &aposWait for console output (regexp)&apos post launch action: Allows to delay further processing of launch group elements until a certain output (matching a regular expression) appears on the console of the given group element.

  • &aposAdopt launch if already running&apos: Allows to control the behaviour of the group when the launch configuration referenced by the launch group element is already running (no matter who launched it). If checked, the launch configuration will not be launched again if it is running already. The existing launch will be adopted by the group (i.e. terminating the group will also terminate this launch). Any configured post launch action will still be executed!

improved launch groups

Content Assist for Feature Name in Model Editor

You can now use Ctrl+Space to trigger content assist when selecting the Feature Name in the Model Editor.

content assist model editor

Model Editor improvements

The elements proposed in the Add child menu are now filtered to a minimal list containing allowed elements only.

filter suggested elements

Generic editor can now read patch and diff files

An extension was provided to the generic editor so that it now can provide syntax highlighting for files with the .patch or .diff extension. Right-click the file and choose Open with > Generic Text Editor to see the editor in action.

patch diff editor

Improved exit and restart dialogs

The exit and restart dialogs now use verbs instead of OK/No/Yes, which makes the dialogs more direct and specific.

confirm exit dialog small
p2 restart dialog small

Support for extending existing CSS preference nodes

CSS definitions for preferences can now use pseudo selectors. This allows that other plug-ins extend preference CSS nodes, instead of overriding them. This makes the default Eclipse dark theme much more consistent and usable.

Example styling with EGit installed before this development:

code completion dark theme old
old search result hightlight color

Example styling with EGit installed after this development:

code completion dark theme new
new search result hightlight color

Option to copy your preferences during workspace switch

You can now copy your preferences during a switch to a new or existing workspace.

copy preferences ws switch

Option to disable Problems view decoration on startup

By default, the Problems view icon no longer shows an errors/warnings overlay after startup, unless the Problems view is on top of the view stack. To enable the errors/warnings overlay also if the Problems view is minimized or not on top, a new Show Problems view decorations on startup option has been added to Preferences > General > Startup and Shutdown. By default, this preference is disabled.

problems view startup preference

Ant 1.10.1

Eclipse has adopted Ant version 1.10.1.

Java Developement Tools (JDT)

Show JUnit failure trace in Console view

A new button has been added to the JUnit Failure Trace header to show the stack trace of a failed JUnit test in the Console view. The Console view makes it convenient to view a long and wide stack trace, copy parts of the stack trace and navigate to the classes on the stack trace using hyperlinks.

show junit failure trace in console view

Skip button in Organize Imports dialog

While using the Organize Imports dialog to import multiple unresolved types, you can now skip a type without cancelling the whole operation by using the new Skip button. No import statement is added for the skipped type.

skip button in organize imports dialog

Type name with extension in New Java Type creation wizards

New Java Type creation wizards now accept the .java extension with the type name instead of showing the error message: "Type name must not be qualified". For example, to create a new class com.test.C1<T>.java, you can directly paste this qualified type name with extension in the Name field of the New Java Class wizard.

type name with extension

Method result after step operations

During debugging, the last method result (per return or throw) that was observed during Step Into, Step Over or Step Return, is shown as first line in the Variables view.

step show methodresult

This can be disabled with the new option Preferences > Java > Debug > Show method result after a step operation (if supported by the VM; may be slow)

Triggers for breakpoints

You can now define a set of triggers for the breakpoints in a workspace

trigger breakpoint properties

Any breakpoint can be set as a trigger point by using Breakpoint Properties…​ dialog or the Breakpoints view’s detail pane.

trigger breakpoint view ruler

Triggers will be rendered with an overlay of "T" and the breakpoints suppressed by the triggers will be rendered with an overlay of "T" with a cut. All the other breakpoints that are initially suppressed by triggers will be hit only after any of the trigger points has been hit. All the triggers are disabled after a trigger point is hit and will be re-enabled after the run.

Remote Java Application "Socket Listen" type supports multiple incoming connections

The Remote Java Application debug configuration’s Standard (Socket Listen) connection type now supports incoming connections from multiple VMs. This is useful for debugging distributed systems. The connection limit may be set to a fixed number, or 0 for unlimited connections.

remote java listen conn limit

New option to disable HCR

You can now disable Hot Code Replace (HCR) if it causes any trouble or if you want to avoid code changes in a debug target. HCR is enabled by default but can be disabled in Preferences > Java > Debug.

option disable hcr

Escape text when pasting into a string literal

The Java > Editor > Typing > Escape text when pasting into a string literal preference option is now enabled by default. This will escape the special characters in pasted strings when they are pasted into an existing string literal.

escape text when pasting

To paste without escaping, you can either paste outside of a string literal, or you can disable Edit > Smart Insert Mode.

Set colors for Javadoc

You can use the new color preferences to set the foreground text color and the background color in the Javadoc view and hovers:

javadoc colors

Hide inherited members from java.lang.Object

You can hide all inherited members from java.lang.Object in the Quick Outline (Ctrl+O) by using the new filter from the drop-down menu (Ctrl+F10):

hide inherited object members

New Java index

Eclipse Oxygen contains an experimental new Java index which is enabled by default. If you suspect an index-related problem, you can disable the new index from Preferences > Java:

new java index

Currently, the new index shouldn’t affect your experience. Once the work is finished, we expect big performance improvements for type hierarchies and in scenarios with many JARs.

Consistent Javadoc colors usage under Linux

The Javadoc color usage on Linux was inconsistent since GTK 3.04. This has been resolved and support for Javadoc on the Eclipse Dark Theme has been added.

Before:

javadocbefore

After:

javadocafter

Dark theme support:

javadocdarktheme

Open Implementation of selected Type

The Open Implementation hyperlink and the Navigate > Open Implementation action now open the implementation of the selected interface or class also. In the past, Open Implementation was only available for methods.

open implementation of type

The hyperlink popup shows up when you hold Ctrl (on the Mac: Command), unless you’ve changed the modifier on the Hyperlinking preference page.

Automatically insert Braces at correct position

The Java > Editor > Typing > Automatically insert at correct position > Braces preference option is now enabled by default. This will automatically insert the braces where they are required.

auto insert braces

Quick Fix to move type annotations

The rules for the placement of Java 8 "type annotations" introduced via JSR 308 are sometimes surprising. In case of errors, a new Quick Fix Move type annotation is offered, that moves the type annotation to a location that corresponds to what was probably intended.

quickfix move type annotation

Toggle Tracepoint

A new action Run > Toggle Tracepoint has been added.

toggle trace point run

The action creates a conditional breakpoint using the "systrace" template, which prints the class and method name.

toggle trace point conditional breakpoint

This makes use of another new feature of conditional breakpoints: As long as the condition doesn’t explicitly return a boolean true, the condition is now considered to implicitly return false, and the breakpoint will not suspend execution.

HiDPI JDT icons

Composite icons such as Java element icons with modifier overlays are now rendered in high resolution in environments that support HiDPI images.

jdt composite images hidpi

Warnings for unlikely argument types

Many developers have learned the hard way, that certain uses of Java collections that pass the compiler’s type check, may still contain "type errors", resulting in unexpected runtime behaviour. A new analysis has been added to the Eclipse compiler for Java that will detect the most common bugs in this area.

The common reason behind this problem is the fact that not all methods of those collection types make use of generics in the way one might expect. As a result it is possible to create a Set<Short>, whose add(Short) method will only accept arguments of type Short, yet method remove(Object) will happily accept literally any argument, because the method’s parameter has type Object.

Here is a code snippet that seems to add and remove the same element from the set, but at a closer look the remove call has no effect. What is difficult to see for the naked eye is now flagged by a new warning:

unlikely1 basic

In a simple world, this would be all there is to say, but over time people have developed various code patterns that rely on these overly general signatures. Consider the following use of subtyping:

unlikely2 number allowed

Depending on your coding style this may or may not be accepted as a legitimate short hand for:

if (n instanceof Short) set.remove((Short) n);

To reduce the churn caused by the new analysis, we developed some heuristics that filter out cases where types are "sufficiently similar", so the above goes unwarned.

As with any heuristic, there is no clear line. This implies that the compiler may show "unwanted" warnings, or filter out invocations that are in fact bugs. For the former case, @SuppressWarnings("unlikely-arg-type") will document the exception both for the user and for the compiler. For the latter case, we provide an option to tighten the rules, namely to apply strict type compatibility checks instead of said heuristics. For this extra scrutiny you may enable the sub-option Perform strict analysis against the expected type in Preferences > Java > Compiler > Errors/Warnings > Potential programming problems.

unlikely3 options

Similarly, a check with default severity "Info" is offered for unlikely invocations of java.lang.Object.equals(Object) and java.util.Objects.equals(Object,Object).

unlikely5 equals

Conditional watchpoint

Like for line breakpoints, conditions can now also be added to Watchpoints, where the old value of the field can be used as part of the condition.

watchpoint condition

Code formatter: new way to count comment width

A new option has been added in the code formatter profile editor that makes the formatter count a comment’s width from its starting position instead of the beginning of the line. This allows more space for comments in heavily indented blocks of code and for line comments added to the right of some code, but at the same time keeps comments that start at the beginning of the line from getting too wide and uncomfortable to read. You can change this setting in the Comments section, under the Line width group:

formatter comment width ui
formatter comment width preview

Hide deprecated fields and methods

You can now hide the deprecated fields and methods in Outline view, Members view, Package Explorer view, Project Explorer view, and Quick Outline by using the new filter from their drop-down menu (Ctrl+F10):

hide deprecated fields and methods

Group by Project in Search view

The default grouping of Java search results in the Search view has been changed to Group by Project. Earlier the results were grouped by package.

group by project in search view

Defaults for annotation type elements in Javadoc

The default value of an annotation type element is now shown in the Javadoc view and hover.

defaults for annotation type elements in javadoc

Show Logical Structure enabled by default

In the Variables view, Show Logical Structure is now enabled by default. E.g. collection objects now directly show their contained elements instead of their internal structure.

jdt debug show logical structure by default

The Show Logical Structure context menu lets you choose or edit the representation.

jdt debug edit logical structure context menu

Pass compiler options to annotation processors

You can now pass compiler options to annotation processors using %variable% syntax in Project > Properties > Java Compiler > Annotation Processing.

jdt apt processor option variables

This allows processors to compile Java sources using the Java project’s settings without manually maintaining this information in the processor options.

And more…​

You can find more noteworthy updates in on this page.

What is next?

Having JBoss Tools 4.5 and Developer Studio 11.0 out we are already working on the next maintenance release for Eclipse Oxygen.

Enjoy!

Jeff Maury


by jeffmaury at August 14, 2017 05:04 PM

Potential adware plugin on Eclipse Marketplace - Eclipse Class Decompiler

August 14, 2017 02:40 PM

A listing on Eclipse Marketplace, called Eclipse Class Decompiler, contains binary code that could be used for adware and could potentially download files to Eclipse workspaces.

August 14, 2017 02:40 PM

Goodbye Kat, Welcome Stephanie

by Ian Skerrett at August 14, 2017 12:00 PM

This is the last week Kat Hirsch, the Eclipse Foundation marketing specialist, will be with the Foundation. Kat is moving on to a new opportunity and the next step in her marketing career.  We have been lucky to have Kat at the Foundation and we will certainly miss her dedication and passion.

At the same time, we are lucky to announce Stephanie Swart will be taking on the role of Marketing Specialist. Some Eclipse community members might already know Stephanie in her current role of Program Coordinator for the Foundation. Stephanie has done a great job helping and coordinating Eclipse project leaders and committers through the Eclipse Development Process. I am thrilled she has agreed to join the marketing team and look forward to working with her to raise the awareness of Eclipse projects and the Eclipse Working Groups.

Please join me to welcome Stephanie to the Foundation marketing team.

btw, we are now in the process of looking for a new Program Coordinator so please pass along any potential candidates.



by Ian Skerrett at August 14, 2017 12:00 PM

AWS Joining CNCF

by Chris Aniszczyk at August 14, 2017 09:50 AM

It’s been a little over a year and a half since I started to help build the Cloud Native Computing Foundation (CNCF) from scratch. One of our original goals was to build a modern open source foundation focused on a new form of cloud computing called “cloud native” (essentially think of microservices that run in containers that are orchestrated) and to get all the major cloud providers at the table to adopt this form of computing.

Last week, we were happy to welcome AWS to CNCF as a member and that now brings us to having the top five cloud providers in the world at the table committing to adopting and promoting cloud native computing:

First off, it’s always great to see an original vision of when we started CNCF come into reality, you can read more from Adrian Cockcroft why they decided to join CNCF and support cloud native computing.

Second, I think it’s great to see a company like Amazon expanding its open source efforts as they where one of the last large companies without a formal open source program. They recently started an official open source program office @AWSOpen under the leadership of Adrian Cockroft and Zaheda Borat and it’s been great to have them participate in the TODO Group too!

Anyways, always great to see large and impactful companies increase their commitment to open source. Now it’s interesting to think what large companies out there don’t have an official open source program or strategy (I’ll leave this as an exercise to the reader).


by Chris Aniszczyk at August 14, 2017 09:50 AM

Introducing (another/additional) JavaFX TestFramework

by Tom Schindl at August 13, 2017 07:56 PM

Let me start with the statement that TestFX is somewhat the default JUnit-Testframework for JavaFX application and is what we proposed to use to all our customers and our projects until today where we introduce our own one.

There are 2 different problem vectors we have:

  • A licensing issue we have with it at Eclipse.org: TestFX is licensed under EUPL which to me as a software developer looks ok but it looks like the IP-Department at Eclipse.org is not happy about it and refused me to use it. I don’t blame anyone but need to cope with the situation as is!
  • Implementing JUnit-Tests for OSGi-JavaFX applications: This is a pure technical issue and something we could have solved (although it would have meant to change the way TestFX works) but after having hit the licensing problem my motivation to resolve that problem was not really there

Anyways let’s look at what I’ve started to implement as a replacement for TestFX.

BestSolution FX-Test

First of all we decided for now that we don’t integrate the test-framework into e(fx)clipse but treat it as an independent entity at github and release it under EPL from there.

Writing JUnit-Tests is done by subclassing a base class (current only one available is FXComponentTest) and implementing your JUnit-Tests might look like this:

@Test
public void sample() {
  // Search with a css-selector query
  // and generated a click on the button
  rcontroller().cssFirst(".button").get().click();
}

In contrast to TestFX, tests written with our API can not run directly but you need to decided if you want to:

  • Use a specific runner using @RunWith(FXRunner.class)
  • Use a Rule @FXTest and annotate all UI-Test methods with it

which on the plus-side means that the @Test-methods are executed on the JavaFX-UI-Thread (unlike TestFX where they are executed on another thread most like the main-thread)

For more information that a look at the project README.md.

Let me close this post saying that we are very early in the development and things are still in the flux so we are happy for any feedback we get.



by Tom Schindl at August 13, 2017 07:56 PM

Vert.x 3.5.0.Beta1

by vietj at August 10, 2017 12:00 AM

it’s summer time and we have just released Vert.x 3.5.0.Beta1!

Let’s go RxJava2

First and foremost this release delivers the RxJava2 API with support of its full range of types.

In addition of Single, Rxified APIs expose also theCompletable and Maybe types

// expose Handler<AsyncResult<Void>>
Completable completable = server.rxClose();

completable.subscribe(() -> System.out.println("closed"));

// expose Handler<AsyncResult<String>> where the result can be null
Maybe<String> ipAddress = dnsClient.rxLookup("www.google.com");
ipAddress.subscribe(
  value -> System.out.println("resolved to " + value),
  err -> err.printStackTrace(),
  () -> System.out.println("does not resolve"));

RxJava augments Vert.x streams with a toObservable() method, RxJava2 adds the toFlowable() method:

// Flowable maps to a ReadStream<Buffer>
// back-pressured stream
Flowable flowable = asyncFile.toFlowable();

// but we still can get an Observable<Buffer>
// non back-pressured stream
Observable flowable = asyncFile.toObservable();

What’s so different between Flowable and Observable ? the former handles back-pressure, i.e the subscriber can control the flow of items and the later can not!!!

You can read the documentation in the beta section of the docs or go straight to the examples

MQTT Client

In Vert.x 3.4 we added the MQTT server, 3.5 completes the MQTT story with the MQTT client:

MqttClient mqttClient = MqttClient.create(vertx,
   new MqttClientOptions()
     .setPort(BROKER_PORT)
     .setHost(BROKER_HOST)).connect(ar ->
  if (ar.succeeded()) {
    System.out.println("Connected to a server");

    mqttClient.publish(
      MQTT_TOPIC,
      Buffer.buffer(MQTT_MESSAGE),
      MqttQoS.AT_MOST_ONCE,
      false,
      false,
      s -> mqttClient.disconnect(d -> System.out.println("Disconnected from server")));
  } else {
    System.out.println("Failed to connect to a server");
    ar.cause().printStackTrace();
  }
});

You can find MQTT client and server examples here

Auth handler chaining

There are times when you want to support multiple authN/authZ mechanisms in a single application.

Vert.x Web supports auth handlers chaining

ChainAuthHandler chain = ChainAuthHandler.create();

// add http basic auth handler to the chain
chain.append(BasicAuthHandler.create(provider));

// add form redirect auth handler to the chain
chain.append(RedirectAuthHandler.create(provider));

// secure your route
router.route("/secure/resource").handler(chain);

// your app
router.route("/secure/resource").handler(ctx -> {
  // do something...
});

Finally

this beta also provides

  • Vert.x Config stores for Vault and Consul
  • Upgrade to Hazelcast 3.8.2

Use it!

You can use and consume it in your projects from Maven or Gradle as usual with the version 3.5.0.Beta1 or read

You can also download various binaries from Maven Central:

as usual feedback is very important to us and one goal of this beta release is to let the community provide early feedback!

The final is expected at the beginning of October.

Enjoy


by vietj at August 10, 2017 12:00 AM

Eclipse IoT in London

by Ian Skerrett at August 08, 2017 07:10 PM

Once again we are hosting an Eclipse IoT Day in London on September 11. Like last year, we are co-locating with the awesome Thingmonk event, one of my favourite IoT events of the year. Thingmonk brings together some of the best thinkers in IoT so it is always a great chance to learn and network. If you are serious about IoT, you need to attend this event.

Like last year, we are doing a half-day Eclipse IoT Day as the pre-conference event for Thingmonk. We have put together a pretty awesome set of speakers to showcase what is going on in the Eclipse IoT community. Check out the line-up:

Ian Craggs, from IBM and the Eclipse Paho project, will be laying out the plans to support the new MQTT 5 specification. MQTT 5 is a major up-level of the MQTT spec so the Eclipse Paho plans and this presentation will be relevant for anyone using MQTT.

Michael Hirsch, from Bosch and the Eclipse hawkBit project, will cover a topic I think is critical to IoT Security and the general IoT industry: How to do large-scale software updates for IoT devices. If you can’t update a device, it is not going to be secure. Eclipse hawkBit is technology developed internally in Bosch but now open source at Eclipse hawkBit.

Julien Vermillard, from Sierra Wireless and Eclipse Leshan project, is going to talk about his experience deploying large scale M2M and IoT solutions. Julien has been in the industry before it was called IoT so he brings lots of experience to the event.

Tobiasz Dworak, from GlobalLogic will share his experience using Eclipse IoT technology to build water management systems. It is great to have hands-on practitioners sharing their experiences.

Sebastien Lembour was the winner of our Open IoT Challenge. His InTheModeforLife is a truly inspirational story of using open source technology to manage mood disorders. Sebastien is really using IoT to work on ‘things that matter’. It is a great story.

Finally, I will be talking about open source and industrial IoT. Smart Manufacturing and Industry 4.0 are huge opportunities for IoT but they have specific requirements. I will talking about how Eclipse IoT technology can be used in industrial IoT setting.

A big thank you to Red Hat for helping to sponsor the Eclipse IoT Day. Red Hat continues to be a key contributor to the community. They definitely get the importance of open source for the overall IoT industry.

I hope you will consider attending the Eclipse IoT Day and Thingmonk. It will definitely be worth a trip to London.

 

 

 

 



by Ian Skerrett at August 08, 2017 07:10 PM

Symmetric Sympathy

by Donald Raab at August 08, 2017 12:07 AM

I am a software developer. I’ve programmed in around twenty different programming languages since I was eleven years old. I spent the last seven years of the previous century coding in an amazing language called Smalltalk. I have spent the first seventeen years of this century coding primarily in the Java language, which thankfully continues to improve.

Smalltalk is about big dreams. Java is about little realities.

Big dreams inspire great things. Software development today is becoming incredibly complex. There is still a lot we can learn from how to scale to handle that complexity from Smalltalk.

I am a committer for an open source Java Collections framework called Eclipse Collections which was inspired by my experiences using Smalltalk back in the 90's. Eclipse Collections has been evolving for 12+ years. Symmetry drives a lot of the work in Eclipse Collections. I like to say that symmetry is like gravity. When I see missing or dissimilar patterns, I feel the weight of symmetry. It is work that has yet to be done.

What is Symmetry?

Symmetry is the similarity between different things. In a system with good symmetry, you will see the similarities, and where there is not good symmetry, you will discover the differences.

Scope of Symmetry in Eclipse Collections

The picture above represents the combination of features available in Eclipse Collections. We have an API for filtering, which is called select. When there is good symmetry for select, it will be available across all data structures for eager/lazy behavior, serial/parallel execution, readable/mutable/immutable interfaces, object and primitive versions of each container.

A snapshot of the co-variant forms of the “select” API in the RichIterable hierarchy

In the picture above, you will see the select API defined across several interfaces in the Eclipse Collections type hierarchy. On RichIterable, select returns RichIterable. Each subtype of RichIterable defines a covariant override for select. On ListIterable, select returns ListIterable. On LazyIterable, select returns LazyIterable. MutableList returns MutableList and ImmutableList returns ImmutableList, etc.

There are other forms of symmetry as well. For every data structure, there is usually a corresponding Readable (e.g. ListIterable), Mutable (e.g. MutableList) and Immutable (e.g. ImmutableList) interface. For most types, this will extend across both object and primitive containers (e.g. IntList, MutableIntList, ImmutableIntList, DoubleSet, MutableDoubleSet, ImmutableDoubleSet, etc.).

A large system with good symmetry becomes easier to understand, because you can detect and expect recurring patterns.

Turtles all the way down

“One of these things is not like the others…” — Sesame Street

In Smalltalk, everything is an object. It’s “turtles all the way down”. This makes good symmetry easier to achieve. In Java, everything is not an object. Java has eight primitives (boolean, byte, char, double, int, float, long, short). Primitives and objects behave differently. Primitives are the little realities of Java. Achieving good symmetry across objects and primitives in a collections framework is a challenge.

We face this challenge with grit. Eclipse Collections has support for both object and primitive collections. This can have tremendous benefits (efficiency/performance/fluency) and unfortunate costs (effort/time/code size). We fix missing symmetry when we find it, but only when we know there is a use case for it. Code generation helps reduce the amount of human work significantly, but can create a lot of duplicate code if we’re not careful.

If you are programming in Java today, check out Eclipse Collections. This amazing collections framework makes Java better and more fun to program in. If you start to use it in your projects, you will understand why I have developed a lot of sympathy for symmetry. Symmetry makes learning and using a framework as feature rich and large as Eclipse Collections much easier for developers. In future blogs, I plan to highlight where symmetry is helping to evolve the development of the framework.

“The best way to predict the future is to invent it.” — Alan Kay

I still code in Smalltalk when I can find the time. Smalltalk reminds me of how things once were and how they can be again when we learn from the past and share those lessons with others. I am happy knowing that there are developers out there still working hard on keeping the Smalltalk language and community vibrant and growing. If you don’t know or haven’t used Smalltalk in a while and want to see what you are missing, have a look at Pharo Smalltalk or Dolphin Smalltalk. They are both great open source Smalltalk development environments.


by Donald Raab at August 08, 2017 12:07 AM

Become a Founding Kubernetes Certified Service Provider

by Chris Aniszczyk at August 07, 2017 03:40 PM

In early September, CNCF will be announcing the founding class of Kubernetes Certified Service Providers (KCSPs). If your company provides professional services to support Kubernetes deployments, please consider signing up to become part of the founding class.

The main benefits of becoming a KCSP are:

  • Placement in a new section at the top of https://kubernetes.io/partners/
  • Monthly meetings with cloud native project leaders, TOC members,
    and representatives from the CNCF Governing Board
  • Access to leads from end users looking for support

Requirements are:

  • Three or more engineers who pass the Certified Kubernetes Administrator (CKA) exam
  • Demonstrable activity in the Kubernetes community including active contribution
  • A business model to support enterprise end users, including putting engineers at a customer site

The CKA exam is about to enter early release beta testing prior to the public release in September. It is an online, proctored, performance-based test that requires solving multiple issues from a command line. It takes 3 to 4 hours to complete, and costs $300, though a discount is available for beta testers to $100.

If your company is interested in becoming a KCSP, please do the following 4 things:

  1. Ensure that your company is listed at https://kubernetes.io/partners/
    and if not (or if the listing should be updated), please do so via the link
    at the top of that page.
  2. Have 3 or more of your Kubernetes experts sign up for the beta test at:
    https://docs.google.com/forms/d/e/1FAIpQLSd9-6nL5L3SzWIddCSPoKeuX_Pdq_KHI8C4mQzcUryP-gu0dQ/viewform
    .Please have them use their company email so we can properly associate
    them. Within a week, we will send beta test dates, a discount coupon code, and instructions to register and schedule.
  3. Register your interest in becoming a KCSP at this form: https://docs.google.com/forms/d/e/1FAIpQLSfai-zlNuvP-q0fz3jw89v3v4m_wYaF7tOBmNY0WoKsZgeQUQ/viewform
  4. If you are not already on it, and want to track progress of the certification program over time, please subscribe to the Kubernetes Certification Working Group list: https://lists.cncf.io/mailman/listinfo/cncf-kubernetescertwg.

Questions or issues? Please email cncf-kcsp-support at lists.cncf.io

Thanks!


by Chris Aniszczyk at August 07, 2017 03:40 PM

e(fx)clipse 3.0.0 is released

by Tom Schindl at August 06, 2017 08:48 PM

e(fx)clipse has been released on June 6th but because of the high load of JavaFX projects we are working on I did not have time to write the public release announcement.

In total we have worked on ~100 tickets most of them adding new features. We also moved our dev infrastructure to github.com and while doing that we’ve split the project into 2 repositories:

We believe that moving to github and the upcoming pure maven-build-story we currently work on in an extra branch will make it easier for others to consume our libraries in none OSGi/Eclipse/e4-Projects.

While we are switching our project structure to pure maven you can already consume our libraries from a maven-repository we host ourselves (see http://maven.bestsolution.at/)

Let’s take a short tour through some of the 3.0 highlights.

Support for Java 9

3.0 is the first release who is fully compatible with Java9 and JPMS. Historically we used non-public APIs and even used reflection to eg “hack” DnD in TabFolder. All code that would be broken in Java9 has been reworked to run on Java8 and Java9.

Some of the none public APIs we used in Java8 have been promoted to public API in Java9 and to support both Java 8 and 9 in the same codebase we extracted those into utility class org.eclipse.fx.ui.controls.JavaFXCompatUtil:

Java 8 Java 9 JavaFXCompatUtil
Window#impl_getWindows() Window#getWindows() getAllWindows()
KeyCode#impl_getChar() KeyCode#getChar() getChar(KeyCode)
KeyCode#impl_getCode() KeyCode#getCode() getCode(KeyCode)

Utilities to work with JavaFX Properties

FXBindings

JavaFX has a Bindings class to setup bindings between different Observables but we missed some features we frequently need in our application code hence we added an org.eclipse.fx.core.bindings.FXBindings who eg has:

  • tenaryBinding(ObservableBooleanValue, ObservableValue<T>, ObservableValue<T>) : Binding<T>
    allowing you to defined if-else in a JavaFX binding way
  • concat(ObservableList<? extends A>...) : ListBinding<A>
    to concat the lists to one and keep the target updated when one of the source lists change
  • concat(String, ObservableValue<T>...) : StringBinding
    concat the lists and concat the items with the given delimiter and keep the binding updated
  • bindContent(List<T>, ObservableList<E>, Function<E, T>) : Subscription
    similar to Bindings.bindContent but allows to use a converter function

A very special feature is a BindingStream you can create with bindStream(ObservableValue<T>) who is similar to Bindings.select but is:

  • Typesafe
  • Provide a Property as the leaf

Let’s look at a concrete example.

class Person {
  public ObjectProperty<Address> address();
}

class Address {
  public StringProperty street() { /* ... */ }
}

class UI {

  ObjectProperty<Person> currentPerson = /* ... */;

  TextField street;

  bindUI() {
     street.textProperty().bindBidirectional( 
      FXBindings.bindStream( currentPerson )
        .map( Person::address )
        .collect( 
           FXCollectors.toProperty( Address::street ) 
        )
     );
  }

}

@ContextValue improvements

@ContextValue is IMHO one of the coolest concepts we introduced in e(fx)clipse to make reuseable components. In 3.0 we added a scope-Property who allows you to fix a publishing scope.

As of 3.0 we support:

  • APPLICATION: Publish the value in the IEclipseContext of the application
  • LOCAL: Publish the value in the local IEclipseContext
  • DYNAMIC: Publish the value using IEclipsContext#modify and the application container is responsible to mark the target context

with DYNAMIC as the default.

ThreadSynchronize improvements

Halt program flow

We added a new API to halt the program flow (NOT the event loop) like this:

ThreadSynchronize t = ...;
TextField username = new TextField();

BlockCondition<String> w = new BlockCondition<>();
username.setOnAction( 
  e -> w.release( username.getText() ) );

System.out.println(t.block( w ));

Headless implementation

We at BestSolution use the MVVM-Pattern for our JavaFX applications and there we fetch data from backend-services in none-ui-threads and so we need to synchronize from a Background- to the UI-thread using ThreadSynchronize.

While things work perfectly fine in the real application because the JavaFX Framework is up and running things fall apart when you test your ViewModel in a headless JUnit-Tests. For that purpose there’s now the possibility to create a ThreadSynchronize instance like this:

ThreadSynchronize t = 
  ThreadSynchronize.createBasicThreadSyncronize(
    new EventLoop()
  );


by Tom Schindl at August 06, 2017 08:48 PM

Eclipse Projects: Level Playing Field

by waynebeaton at August 02, 2017 02:36 PM

For many open source organisations, open means the same thing as transparent: open as in open book. At the Eclipse Foundation, we regard being transparent as the practice of making sure that the community can see and understand what the project is doing; and being open as the act of giving up absolute control and welcoming the community to participate as an equal player on a level playing field (i.e. being open to participation by the others).

Screenshot from 2017-07-31 23-22-35

Not really a field, but this is the closest thing that I have to a picture of field-based sporting event. Ice is about as level as you can get.

At the Eclipse Foundation, we take the open part of open source very seriously. It’s codified in the Open Source Rules of Engagement found in the Eclipse Development Process.

Everybody needs to play by the same set of rules. A level playing field doesn’t necessarily mean that a project team needs to accept every single contribution that comes their way. Rather, it means that the project team needs to have a set of rules by which everybody participates; and these rules can’t include things like for whom the contributor works.

Contribution rules can require that contributions fall within the project’s scope and current release plan. The rules can require that all code contributions be accompanied by unit tests and documentation; or that contributions implement a solution for an issue that’s been discussed by the project team in their issue tracker. Some sort of quality bar is a reasonable part of any set of contribution rules.

For most open source projects, these contribution rules aren’t formally captured. However, most of the rules that I’ve listed so far collectively form a pretty reasonable default set of participation rules. A quality bar is (obviously) hard to quantify, but for many project teams it’s enough that any committer feels that the contribution should be accepted (some projects require that two committers sign off on a contribution before it can be accepted).

Note that it’s also perfectly reasonable for a project team to require that significant contributions come with a promise of continued investment in the form of the contributor becoming a member of the project team.

Regardless of the rules that define the level playing field for any particular project, any content destined for the project’s code base should have some public record of contribution. Otherwise, the project would be operating (at least in part) hidden from community involvement and so counter to the open source rules of engagement. That public record can take the form of a Gerrit review, GitHub pull request, or (if you’re in a pinch) an attachment on a Bugzilla or GitHub Issue record.

Regardless of how a contribution is presented, the contributor must be listed as the author in the Git commit record and must complete the Eclipse Contributor Agreement before any contribution can be accepted.

The best way to get involved with an open source project is connect with the project team. All Eclipse project repositories should have a contribution guide in the root of every Git repository with this contact information and more. You can also search for project information on the Eclipse Projects website.



by waynebeaton at August 02, 2017 02:36 PM