Dealing with Technical Debt with Sonarqube: a case study with Xsemantics

by Lorenzo Bettini at September 18, 2014 05:36 PM

I only recently started to play with Sonarqube to reduce “technical debt” and hopefully improve code quality. I’d like to report on my experiences about using Sonarqube to analyze Xsemantics, a DSL for writing rule systems (e.g., type systems) for Xtext languages.

I was already using the Jenkins Continuous Integration server, and while building I was already using Findbugs and Jacoco, thus, I was already analyzing such software, but Sonarqube brings new analysis rules for Java programs and it also integrates results from Findbugs and Jacoco, aggregating all the code quality results in a web site.

In spite of the Jenkins builds Sonarqube detected some issues when I started

xsemantics sonarqube 1

First of all, I had to exclude the src-gen and emf-gen directories (the former is where Xtext generates all its artifacts, and the latter is where Xcore generates the EMF model files); since these are generated files and I did not want to make them part of the analysis. I’ve done such exclusion with a property in the main pom.xml (for readability I split it into lines):

<sonar.exclusions>
file:**/src-gen/**,
file:**/emf-gen/**,
file:**/example/**,
file:**/tests/**,
**/*RuntimeModule.java,
**/*UiModule.java,
**/*XcoreReader.java,
**/*UiExamples.java,
**/*TypeSystemGen*.java,
**/*StandaloneSetup*.java
</sonar.exclusions>

Note that for the moment I’m also excluding tests from the analysis… it is considered best practice to analyse tests as well (and I have many of them), but I wanted to concentrate on the code first. I also excluded other Java files for which issues are reported, like the Xtext Guice modules, due to the wildcards in the method signatures… I have to live with them anyway :)

After that the number of issues reduced a little bit, but there were still some issues to fix; most of them were easy, basically due to Java conventions I hadn’t use (e.g., name of fields and methods or even names of type parameters).

One of the major ones was due to the wrong implementation of the clone method (“super.clone() should be called when overriding Object.clone()” (https://github.com/LorenzoBettini/xsemantics/issues/34).

Another thing that I had never considered was dependency cycles among Java packages and files. Sonarqube reports them. Luckily there were only few of them in Xsemantics, and the hardest part was to read the Dependency Structure Matrix, but in the end I managed to remove them (there must be nothing in the upper triangle to have no cycle):

xsemantics sonarqube 2

To solve the cycles I had to change something in the runtime API (http://xsemantics.sourceforge.net/snapshots-for-xsemantics-1-6-for-xtext-2-7/) but it was basically a matter of moving Java classes into different packages.

Then came the last major issue: Duplicated Code!!! All by itself this issue was estimated with 13 days of technical debt! And most of the duplicated code was in the model inferrer (a concept from Xbase). Moreover, such inferrer is written in Xtend, a cleaner Java, and the Xtend compiler then generates Java code. Thus, Sonarqube analyses the generated Java code, and the detected duplicate code blocks are on the Java code. This means that it takes some time to understand the corresponding original Xtend code. That’s not impossible since Xtend generates clean Java code, but it surely adds some work :)

Before starting to remove duplicated code (around 80 blocks in the generated Java code) the Xtend inferrer was around 1090 lines long (many parts are related to string templates for code generation) corresponding to around 2500 lines of generated Java code! After the refactoring the Xtend inferrer was around 1045 lines long, and the generated Java code reduced to around 2000 lines.

That explains also the reduction of lines of code and complexity:

xsemantics sonarqube 3

But now technical debt is 0 :)

xsemantics sonarqube 4

And it’s nice to look at this dashboard :)

xsemantics sonarqube 5

By the way, I also had to disable some issues I did not agree on (tabulation characters) and avoid reported issues on method name conventions on a specific file (because methods that start with the underline characters _ have a specific meaning in Xtext/Xtend). Instead of disabling them on the Sonarqube web interface, I preferred to disable them using properties in the pom file so that it works across different Sonarqube installations (e.g., I also have a local Sonarqube instance on my machine to do some quick experiments). Such multi properties are not officially supported in the Sonar invocation (e.g., through the sonar runner or via Maven), but I found a workaround: http://stackoverflow.com/questions/21825469/configure-sonar-sonar-issue-ignore-multicriteria-through-maven (but, be careful, it is considered a hack as reported in the mailing list: http://sonarqube.15.x6.nabble.com/sonar-issue-ignore-multicriteria-td5021722.html):

<!-- see http://sonarqube.15.x6.nabble.com/sonar-issue-ignore-multicriteria-td5021722.html and
 http://stackoverflow.com/questions/21825469/configure-sonar-sonar-issue-ignore-multicriteria-through-maven
 for the multicriteria property -->
<sonar.issue.ignore.multicriteria>e1,e2</sonar.issue.ignore.multicriteria>

<!-- standard convention for method names: in the outline tree provider we
 must use methods that start with _ and they'd violate the rule squid:S00100 -->
<sonar.issue.ignore.multicriteria.e1.ruleKey>squid:S00100</sonar.issue.ignore.multicriteria.e1.ruleKey>
<sonar.issue.ignore.multicriteria.e1.resourceKey>**/*OutlineTreeProvider.java</sonar.issue.ignore.multicriteria.e1.resourceKey>

<!-- "Tabulation characters should not be used"
 sorry... I don't agree :) -->
<sonar.issue.ignore.multicriteria.e2.ruleKey>squid:S00105</sonar.issue.ignore.multicriteria.e2.ruleKey>
<sonar.issue.ignore.multicriteria.e2.resourceKey>**/*.java</sonar.issue.ignore.multicriteria.e2.resourceKey>

That’s all! I strongly suggest to give Sonarqube a try! :)

Be Sociable, Share!

by Lorenzo Bettini at September 18, 2014 05:36 PM

EclipseCon Europe 2014 - Program Released

September 18, 2014 12:58 PM

We have three great days of talks, tutorials, keynotes, theme days and events planned. Register by Oct. 1 for early rates.

September 18, 2014 12:58 PM

EMF Client Platform and EMF Forms 1.4.0 released!

by Jonas Helming at September 18, 2014 09:45 AM

We are happy to announce that we have just released EMF Client Platform and EMF Forms 1.4.0! Both will be part of Eclipse Modeling Tools Luna SR1, but you can already find the new release on our download pages:

EMF Client Platform is a framework to support the development of applications based on an EMF data model. EMF Forms is a stand-alone component in EMF Client Platform focused on the creation of form-based UIs.

Since release 1.3.0, we have implemented a bunch of new features, improved the usability and fixed existing bugs. A complete list of implemented features and bug fixes is available here. In general, we focused on EMF Forms in this release. I will describe the five most notable new features in a small blog post series starting this week. Please refer to this tutorial for a introduction of EMF Forms.

image01 EMF Client Platform and EMF Forms 1.4.0 released!


TwitterGoogle+LinkedInFacebook

Leave a Comment. Tagged with eclipse, emf, eclipse, emf


by Jonas Helming at September 18, 2014 09:45 AM

Concluding the Spanish OSGi Events for September

by Mike Francis (noreply@blogger.com) at September 18, 2014 08:29 AM

The Barcelona JUG is hosting two more events about OSGi on September 26 and 27. Peter Kriens will be presenting "OSGi made easy with enRoute". The session on September 26 is a introductory presentation in the evening and the session on September 27 is a half day workshop. Both of these events are free to attend. You can find out more details and register for these events as follows:

by Mike Francis (noreply@blogger.com) at September 18, 2014 08:29 AM

Little Known Things about the Eclipse Infocenter: Deep Linking (2/5)

by howlger at September 17, 2014 07:04 PM

The Eclipse Infocenter is the Eclipse help system launched as a stand-alone web application. Five well-hidden features about the Infocenter will be presented one after the other here. Basic and Bot Mode have already been presented and here comes the second little known thing: deep linking.

The Infocenter does not yet support deep linking: When you browse inside the Infocenter the URL does not change. If you want to bookmark a topic you will have to copy the topic link via right-click menu from the table of contents, paste the link into the address bar and bookmark this URL.

Deep Linking

VMware has already implemented deep linking without contributing it back to Eclipse. This is not the only adaption VMware made. Unfortunately, one of these additional adaptions does not work with Internet Explorer 8 (in contrast to Firefox, Google Chrome and Internet Explorer 11), so that the table of contents does not show up. There are no such problems with the plain Eclipse Infocenter. This is why contributing back makes sense. ;-)

However, deep linking has not yet been implemented in the plain Eclipse Infocenter and you have to copy manually the link from the table of contents. This link is redirected to the version with HTML frames. If you want to see the topic framelessly without the table of contents, search field, etc. you will have to append ?noframes=true to the link. Alternatively, in the URL you could replace /topic/ with /nftopic/ or – if you want to have the navigation breadcrumb at the top – with /ntopic/.

With the resultof parameter you can highlight text. The topic is automatically scrolled to the first hit. This can be used to link to a specific section inside a topic. For example, if you want to link to the “Dark theme” inside the “What’s New in Luna” topic you will have to append ?resultof=”Dark theme” to the link. The phrase to be highlighted has to be enclosed in parentheses. Two or more phrases have to be concatenated without delimiters as you can see in the following example:

Highlighting via 'resultof'

To combine both frames and highlighting is a little bit tricky. First you have to open the topic link which redirects you to index.jsp?topic=…; then you have to append ?resultof=… to the redirected URL. The ?topic=…?resultof=… instead of ?topic=…&resultof=… is probably a work-a-round for an error waiting to be fixed. ;-)

The next little known things about the Eclipse Infocenter on my list are Search Links, Language Switching and Debugging Information. Stay tuned!

Flattr this



by howlger at September 17, 2014 07:04 PM

JavaOne 2014 – Visualize your DSL – Building 3d Lego models with Xtext and JavaFX

by Tom Schindl at September 17, 2014 02:08 PM

JavaOne 2014 is not too far ahead and because I’m doing 2 session:

I’ve been busy working on show cases and the demo application. The demo application visualizes 3d objects of any kind, I thought a nice and not too complex example are structures built from lego bricks. Naturally one can create Lego 3d models using any 3d modeling software but for someone like me who is not using them on a daily base this is a bit cumbersome and I’m faster using a DSL who allows me to those in a textual editor inside my IDE and so I defined a DSL who allows me to define lego bricks and mix and match them to create bigger structures.

Definition Lego DuploTm Bricks:
lego_bricks

Definition of a Lego DuploTm structure:
lego_assembly

The reality:
Foto

The really interesting thing in this regard is that to create a visual representation of the editor content (the editors are on the left hand side of the Eclipse IDE screenshots) is that all that needs to be done is to contribute an adapter into your IDE which adapts your editor (must not be xtext based) and provide an FXML representation of the editors content.

For the above editors this looks like this:

The adapter for the xtext-editor:

package at.bestsolution.lego.ui.preview;

import java.net.URL;
import java.util.Collections;
import java.util.List;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.URI;
import org.eclipse.fx.ide.ui.editor.IFXMLProviderAdapter;
import org.eclipse.ui.IEditorPart;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.ui.editor.XtextEditor;
import org.eclipse.xtext.util.concurrent.IUnitOfWork;

import at.bestsolution.lego.lego.Model;
import at.bestsolution.lego.ui.internal.LegoActivator;

import com.google.inject.Injector;

public class FXMLProviderAdapter implements IFXMLProviderAdapter {
	private XtextEditor editor;
	
	public FXMLProviderAdapter(XtextEditor editor) {
		this.editor = editor;
	}

	@Override
	public IEditorPart getEditorPart() {
		return editor;
	}
	
	@Override
	public String getPreviewFXML() {
		return editor.getDocument().readOnly(new IUnitOfWork<String, XtextResource>() {

			@Override
			public String exec(XtextResource resource) throws Exception {
				Injector injector = LegoActivator.getInstance().getInjector("at.bestsolution.lego.Lego");
				PreviewGenerator generator = injector.getInstance(PreviewGenerator.class);
				return generator.generatePreview((Model) resource.getContents().get(0)).toString();
			}
			 
		});
	}
		
	@Override
	public String getPreviewSceneFXML() {
		return null;
	}

	@Override
	public List<String> getPreviewCSSFiles() {
		return Collections.emptyList();
	}

	@Override
	public String getPreviewResourceBundle() {
		return null;
	}

	@Override
	public List<URL> getPreviewClasspath() {
		return Collections.emptyList();
	}

	@Override
	public IFile getFile() {
		return editor.getDocument().readOnly(new IUnitOfWork<IFile, XtextResource>() {

			@Override
			public IFile exec(XtextResource resource) throws Exception {
				URI uri = resource.getURI();
				Path structureFilePath = new Path(uri.toPlatformString(true));
				IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(structureFilePath);
				if( f.exists() ) {
					return f;
				}
				return null;
			}
			
		});
	}
}

The adapter factory registered inside the Eclipse IDE:

package at.bestsolution.lego.ui.preview;

import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.fx.ide.ui.editor.IFXMLProviderAdapter;
import org.eclipse.fx.ide.ui.editor.IFXPreviewAdapter;
import org.eclipse.xtext.ui.editor.XtextEditor;

public class FXMLAdapterFactory implements IAdapterFactory {

	@Override
	public Object getAdapter(Object adaptableObject, Class adapterType) {
		if((adapterType == IFXMLProviderAdapter.class || adapterType == IFXPreviewAdapter.class) && adaptableObject instanceof XtextEditor ) {
			XtextEditor editor = (XtextEditor) adaptableObject;
			if( "at.bestsolution.lego.Lego".equals(editor.getLanguageName()) ) {
				return new FXMLProviderAdapter(editor);
			}
		}
		return null;
	}

	@Override
	public Class[] getAdapterList() {
		return new Class[]{IFXMLProviderAdapter.class, IFXPreviewAdapter.class};
	}

}
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
  <!-- .... -->
  <extension
        point="org.eclipse.core.runtime.adapters">
     <factory
            adaptableType="org.eclipse.xtext.ui.editor.XtextEditor"
            class="at.bestsolution.lego.ui.preview.FXMLAdapterFactory">
         <adapter
               type="org.eclipse.fx.ide.ui.editor.IFXPreviewAdapter">
         </adapter>
         <adapter
               type="org.eclipse.fx.ide.ui.editor.IFXMLProviderAdapter">
         </adapter>
      </factory>
  </extension>
  <!-- .... -->
</plugin>


by Tom Schindl at September 17, 2014 02:08 PM

Mozilla Releng: The ice cream

by Kim Moir (noreply@blogger.com) at September 17, 2014 01:43 PM

A week or so ago, I was commenting in IRC that I was really impressed that our interns had such amazing communication and presentation skills.  One of the interns, John Zeller said something like "The cream rises to the top", to which I replied "Releng: the ice cream of CS".  From there, the conversation went on to discuss what would be the best ice cream flavour to make that would capture the spirit of Mozilla releng.  The consensus at the end was was that Irish Coffee (coffee with whisky) with cookie dough chunks was the favourite.  Because a lot of people like on the team like coffee, whisky makes it better and who doesn't like cookie dough?

I made this recipe over the weekend with some modifications.  I used the coffee recipe from the Perfect Scoop.  After it was done churning in the ice cream maker,  instead of whisky, which I didn't have on hand, I added Kahlua for more coffee flavour.  I don't really like cookie dough in ice cream but cooked chocolate chip cookies cut up with a liberal sprinkling of Kahlua are tasty.

Diced cookies sprinkled with Kahlua

Ice cream ready to put in freezer

Finished product
I have to say, it's quite delicious :-) If I open source ever stops being fun, I'm going to start a dairy empire.  Not really. Now back to bugzilla...

by Kim Moir (noreply@blogger.com) at September 17, 2014 01:43 PM

Changes

September 17, 2014 07:46 AM

imageHi everyone,

This is kind of a special time for me, as I’m about to leave Obeo at the end of the month.
A little bit more than 4 years ago, I was a young student discovering the enterprise world in a start-up focused on model driven engineering & eclipse technologies.
I knew nothing.
Since then, a lot has happened in my work life, and I can only thank the Obeo guys for that. I have so many good memories that I don’t even know where to start… The blazing discussions we had during our “Geekussions” meetings, sitting between Ed Merks and Eike Stepper at my first eclipsecon, the first time I delivered a software on my own, feeling part of an awesome developpers team, when the eclipse project I lead joined the Release train, the stress and then the pride of my first talk…

But why am I leaving then, you may ask? This has not been an easy choice… I think I had a declic while giving a Sirius training: I really felt as if I was skilled in my field. As a fan of Bret Victor, I knew that feeling competent was the worst thing that can happen to the young software developer I am. I know not much, and I want to learn new languages, meet new challenges, discover other application fields with new people and ways of working.

image

I have the incredible opportunity to join another startup, iRealite, as a CTO. Our challenge is simple: take brand new disruptive technologies (Brain-Computer Interface, Leap motion…) and find usages to improve the day-to-day life. You can subscribe to my new blog to discover new technologies & the APIs to manipulate them. I may also talk about team management & the day-to-day life in a startup.

I’d like to finish by thanking all the Obeo & Eclipse guys I’ve had the chance to work with. I hope one day I’ll be able to learn to others as much as I’ve learned from you.

image


September 17, 2014 07:46 AM

Building the Internet of Things with the Eclipse IoT stack: a practical example

by Eclipse Foundation at September 16, 2014 03:50 PM

It may seem hard to get started with the Internet of Things (IoT) with so many technologies, protocols, hardware platforms, … involved. In this session, Benjamin Cabé from the Eclipse Foundation will cover all you need to know to start building IoT solutions using Java and open technologies like MQTT, CoAP, OSGi, or LWM2M. A real-life application (smart greenhouse) will be used as an example and you will most likely leave the session craving for building a very similar application yourself!

by Eclipse Foundation at September 16, 2014 03:50 PM

Eclipse PDE Mind Map

by Its_Me_Malai (noreply@blogger.com) at September 16, 2014 01:58 PM

Hey Guys

I always keep drawing a lot of stuff, as i believe like anyone else pictures carry way more than just words.
This time i decided to sketch up an Eclipse PDE Mind Map. I was half done with it and thot y not just put it online for people to review it.

The JPEG Version of the Mind Map. Please do comment on the Mind Map and interested in contributing and adding further on it, ping me on annamalai@ancitconsulting.com and we can collaborate on the mm on github :)

 Comments are always welcome :)

by Its_Me_Malai (noreply@blogger.com) at September 16, 2014 01:58 PM

Orion 7.0 – GitHub and Google+ Authentication

by Aidan Redpath at September 15, 2014 03:03 PM

Orion 7.0, coming in late October 2014, will have significant improvements to its authentication infrastructure. Orion will now support OAuth 2.0 providers for authentication, in place of the OpenID and Mozilla Persona authentication methods. Orion 7.0 stable builds can be downloaded now on the Orion download page.

New Authentication Changes

Orion 7.0 allows you to authenticate using your existing OAuth 2.0 accounts. This means if you have an existing Google or GitHub account you will be able to log into Orion 7.0 securely and easily. This gives you multiple options for authentication.

With this update we also removed Mozilla Persona support. For more information on Mozilla Persona visit: https://login.persona.org/

This changes our home page slightly to display 3 methods of authentication:

  • Orion
  • Google+
  • GitHub

Auth Logos

Google Migration

With this update we are also updating the old Google OpenID authentication to the new Google OpenID Connect, based on OAuth 2.0. Soon Google will no longer support the old version so all systems need to updated accordingly. If you have already linked your account with your Google account you will need to update it to the new OAuth 2.0 authentication. Luckily this is quite simple.

All you need to do is try to authenticate to Orion using the Google icon. Then Google will prompt you to accept the new permissions.

Authorize App

That’s it! You will now be in Orion 7.0 and your account will already be updated.

For more information on Google’s authentication migration visit: https://developers.google.com/+/api/auth-migration#timetable

Create a Linked Account

Creating a linked account used to be difficult but we have now changed this to make it relatively painless. There are two ways to create a linked account:

  • Create a new account
  • Link an existing account

New Account

To create a new linked account, simply try to authenticate with the OAuth provider of your choice (GitHub or Google).

If the account does not exist you will be sent to an account creation page.

Create Account

The account you create will automatically be linked to your OAuth account.

Existing Account

To link an existing account to your OAuth account is the same as it used to be. First log into your Orion the account you wish to link. Then go to the Settings Page → User Profile.

Link Account

At the bottom of the page is the Linked Accounts section. Here you can either add/remove your OAuth accounts. You can also remove your old Google OpenID and Mozilla Persona accounts.

What’s Next?

We plan to redo our landing page to make it more inviting and informative for new and existing users. This will explain the basics of what Orion is and how to use it.

We also plan to have more integration with your GitHub account so that if you link your account you no longer need to authenticate again to perform git operations.


by Aidan Redpath at September 15, 2014 03:03 PM

How to Safely Use SWT’s Display asyncExec

by Rüdiger Herrmann at September 15, 2014 08:00 AM

Written by

Most user interface (UI) toolkits are single-threaded and SWT is no exception. This means that UI objects must be accessed exclusively from a single thread, the so-called UI thread. On the other hand, long running tasks should be executed in background threads in order to keep the UI responsive. This makes it necessary for the background threads to enqueue updates to be executed on the UI thread instead of accessing UI objects directly.

To schedule code for execution on the UI thread, SWT offers the Display asyncE‌xec() and syncE‌xec() methods.


Display asyncE‌xec vs syncE‌xec
While both methods enqueue the argument for execution on the UI thread, they differ in what they do afterwards (or don’t). As the name suggests, asyncE‌xec() works asynchronously. It returns right after the runnable was enqueued and does not wait for its execution. Whereas syncE‌xec() is blocking and thus does wait until the code has been executed.

As a rule of thumb, use asyncE‌xec() as long as you don’t depend on the result of the scheduled code, e.g. just updating widgets to report progress. If the scheduled code returns something relevant for the further control flow – e.g. prompts for an input in a blocking dialog – then I would opt for syncE‌xec().

If, for example, a background thread wants to report progress about the work done, the simplest form might look like this:

progressBar.getDisplay().asyncE‌xec( new Runnable() {
  public void r‌un() {
    progressBar.setSelection( ticksWorked );
  }
} );

asyncE‌xec() schedules the runnable to be executed on the UI thread ‘at the next reasonable opportunity’ (as the JavaDoc puts it).

Unfortunately, the above code will likely fail now and then with a widget disposed exception, or more precisely with an SWTException with code == SWT.ERROR_WIDGET_DISPOSED.

The reason therefore is, that the progress bar might not exist any more when it is accessed (i.e. setSelection() is called). Though we still hold a reference to the widget it isn’t of much use since the widget itself is disposed. The solution is obvious: the code must first test if the widget still exists before operating on it:

progressBar.getDisplay().asyncE‌xec( new Runnable() {
  public void r‌un() {
    if( !progressBar.isDisposed() ) {
      progressBar.setSelection( workDone );
    }
  }
} );

As obvious as it may seem, as tedious it is to implement such a check again and again. You may want to search the Eclipse bugzilla for ‘widget disposed’ to get an idea of how frequent this issue is. Therefore we extracted a helper class that encapsulates the check

  new UIThreadSynchronizer().asyncE‌xec( progressBar, new Runnable() {
    public void r‌un() {
      progressBar.setSelection( workDone );
    }
  } );

The UIThreadSynchronizers asyncE‌xec() method expects a widget as its first parameter that serves as a context. The context widget is meant to be the widget that would be affected by the runnable or a suitable parent widget if more than one widget are affected. Right before the runnable is executed, the context widget is checked. If is is still alive (i.e. not disposed), the code will be executed, otherwise, the code will be silently dropped. Though the behavior to ignore code for disposed widgets may appear careless, it worked for all situations we encoutered so far.

Unit testing code that does inter-thread communication is particularly hard to test. Therefore the UIThreadSynchronizer – though it is stateless – must be instantiated to be replacable through a test double.

The source code with corresponding tests can be found here:

https://gist.github.com/rherrmann/7324823630a089217f46

While the examples use asncE‌xec(), the UIThreadSynchronizer also supports syncE‌xec(). And, of course, the helper class is also compatible with RAP/RWT.

If you read the source code arefully you might have noticed that there is a possible race condition. Because none of the methods of class Widget is meant to be thread-safe, the value returned by isDisposed() or getDisplay() may be stale (see line 51 and line 60). This is deliberately ignored at that point in time – read: I haven’t found any better solution. Though the runnable could be enqueued mistakenly, the isDisposed()-check (which is executed on the UI thread) would eventually prevent the code from being executed.

And there is another (admittedly small) chance for a threading issue left: right before (a)syncE‌xec() is called the display is checked for disposal in order to not run into a widget disposed exception. But exactly that may happen if the display gets disposed in between the check and the invocation of (a)syncE‌xec(). While this could be solved for asyncE‌xec() by wrapping the call into a try-catch block that ignores widget disposed exceptions, the same approach fails for syncE‌xec(). The SWTExceptions thrown by the runnable cannot be distinguished from those thrown by syncE‌xec() with reasonable effort.

Give it a try and let me know what you think. If you have comments, please leave a message here. Do not comment on the gist if you expect a reply in a timely manner. Unfortunately, comments on gists do not trigger notifications.

The post How to Safely Use SWT’s Display asyncExec appeared first on Code Affine.


by Rüdiger Herrmann at September 15, 2014 08:00 AM

More OSGi events in Spain this month.....

by Mike Francis (noreply@blogger.com) at September 12, 2014 10:09 PM

So it looks like September is turning in to OSGi month in Spain.... *** Update - Live Stream for tonight available from 19.00hrs CEST on You Tube *** Hot on the heels of the Peter Kriens presentation about enRoute to the Madrid JUG on Sept 10, there is an event from Barcelona JUG this Friday and Saturday (Sept 12 and 13) by Jean-Baptiste Onofré. This is then followed by another event from

by Mike Francis (noreply@blogger.com) at September 12, 2014 10:09 PM

Looking at High Availablility with Eclipse Orion

by paulweb515 (noreply@blogger.com) at September 12, 2014 08:40 PM

I've had the opportunity to do some work on Eclipse Orion lately, and I'm really enjoying it.  There are opportunities to learn about technology on both the server (Java and/or Nodejs) and the client side (HTML, CSS, and JS).  It's a lot to learn :-)

One of the things I've been looking at is High Availability in Orion 7.0.  If we use horizontal scaling, we can upgrade one server while leaving another server to continue to provide service (we're working with some kind of proxy in front of the servers, like NGINX, to direct traffic).

Anthony has been working on consolidating Orion metastore/metadata, on distributing upgrades on user access or background processes, and on a policy to cover how we add/upgrade new metadata properties so that older servers could still function against the new metadata.

I've been focused on allowing multiple servers to access the same user content and search indices at the same time.

By default, there's only one small change in Orion 7.0.  The search indices which used to reside in osgi.instance.area/.plugins/org.eclipse.orion.server.core.search will now reside in osgi.instance.area/.plugins/org.eclipse.orion.server.core.search/<version> (where the current version is v16).

You can use properties (See web-ide.conf) to activate the new configuration, where the user content and the search indices are in a common location but each server still has its own local osgi.instance.area.

For example, if I had 2 servers that had their local OSGi instance areas at /opt/orion/workspace (not shared between servers) and a common NFS mount at /home/data, I could set up the orion configuration on each server to serve up the same content using:

  • orion.file.content.location=/home/data/orion/content
  • orion.search.index.location=/home/data/orion/search
  • orion.file.content.locking=true
The search indices and user content should not point to the same directory.  The file content locking uses file system (per process) locks to protect read-writes of user metadata and instructs only one process to run the search indexing jobs at a time.

We've done some preliminary testing, but we always welcome more testing and feedback.  If you get a chance to use this, please let me know :-)


by paulweb515 (noreply@blogger.com) at September 12, 2014 08:40 PM

EMFStore 1.4.0 Released

by Maximilian Koegel at September 12, 2014 01:20 PM

We just released EMFStore 1.4.0. You can find the new release on our download page. A list of implemented features and bug fixes is available here.

The most notable new feature is an improved Admin UI to configure Users, Groups and their access privileges on projects on the EMFStore server. We believe the Admin UI is now more usable and more responsive.

Furthermore we have implemented a security feature which allows you to configure the SSL cipher suites accepted by the server for SSL connections. This can be used to exclude ciphers which are no longer considered secure.

Also we added more API for ModelElementIDs which are used in EMFStore to uniquely identify EObjects stored within EMFStore. This is useful if you need to allocate custom IDs with your EObjects.

To improve out-of-the-box Ecore support we added the Ecore feature to the SDK as a default. This allows to store the contents of Ecore files (e.g. EPackages and EClasses) in EMFStore without explicitly installing this feature additionally to the SDK.

Finally, we fixed a number of minor bugs.

Enjoy!

client server2 EMFStore 1.4.0 Released


TwitterGoogle+LinkedInFacebook

Leave a Comment. Tagged with emf, EMFStore, emf, EMFStore


by Maximilian Koegel at September 12, 2014 01:20 PM

Little Known Things about the Eclipse Infocenter: Basic and Bot Mode (1/5)

by howlger at September 12, 2014 12:28 PM

The Eclipse help system can also be launched as a stand-alone web application, the so-called Infocenter. The Eclipse Infocenter is widely used by several companies and organizations, with and without adaptions. Although many of you will be familiar with help.eclipse.org or one of these websites, hardly anyone will know all of the five well-hidden features of the Infocenter that might be useful to you. They will be presented individually here. And here comes number one: the basic and the bot mode.

When you visit the Infocenter with a very, very, very old web browser such as the Internet Explorer 5.5 or Netscape Navigator 4.8 the website looks different than with any web browser that was released in the last twelve years. This so-called basic mode (in contrast to the advanced mode for current browsers) exists mainly because these old browsers do not support JavaScript callbacks. For instance, if you click on a book in the table of contents, the table of contents HTML frame will be replaced by a new HTML page in which the whole subtree of the clicked book is expanded. This is realized simply by HTML links. In the normal advanced mode the chapters of the next level are asynchronously loaded via JavaScript without leaving the page.

Eclipse Luna Help in Basic Mode

The basic mode can also be useful with a current browser. For example, if you need the whole table of contents of a book then it can be easily extracted (and copied) from /basic/tocView.jsp. This saves you manually expanding every individual chapter.

In the Infocenter, the browser detection to switch between basic and advanced mode is done via the User-Agent HTTP header field. The User-Agent field is also used to present the website without HTML frames to web crawlers in a third mode, the bot mode. For the Google Search Bot the Luna Help with its 17,875 topics looks like this:

Eclipse Luna Help in Bot Mode

The next little known things about the Eclipse Infocenter on my list are Deep Linking, Search Links, Language Switching and Debugging Information. Stay tuned!

Flattr this



by howlger at September 12, 2014 12:28 PM

Open IoT hangout #10

by Eclipse Foundation at September 11, 2014 03:31 PM

Join Benjamin, Ian and their guest +Sandro Kock to learn more about MQTTlens and discuss the latest news in the IoT space

by Eclipse Foundation at September 11, 2014 03:31 PM

Live Streaming of Peter Kriens presenting enRoute Today @ Madrid JUG

by Mike Francis (noreply@blogger.com) at September 11, 2014 08:14 AM

Peter Kriens is presenting at Madrid JUG this evening (Sept 10) about OSGi enRoute. The presentation will be in English. Our friends at the Madrid JUG have kindly arranged to stream the session. You can also follow the event and ask questions on twitter using the hashtag #mjugOSGi. Its taking place at 19.00hrs CEST/ 18.00hrs BST/ 13.00 EDT / 10.00hrs PDT /  02.00hrs on Sept 11 (JST) (apologies

by Mike Francis (noreply@blogger.com) at September 11, 2014 08:14 AM

Mozilla pushes - August 2014

by Kim Moir (noreply@blogger.com) at September 10, 2014 02:09 PM

Here's August 2014's monthly analysis of the pushes to our Mozilla development trees.  You can load the data as an HTML page or as a json file.



Trends
It was another record breaking month.  No surprise here!

Highlights
  • 13090 pushes
    • new record
  • 422 pushes/day (average)
    • new record
  • Highest number of pushes/day: 690 pushes on August 20.  This same day corresponded with our first day where we ran over 100,000 test jobs.
    • new record
  • 23.12 pushes/hour (average)

General Remarks
Both Try and Gaia-Try have about 36% each of the pushes.  The three integration repositories (fx-team, mozilla-inbound and b2g-inbound) account around 21% of all the pushes.


Records
August 2014 was the month with most pushes (13,090  pushes)
August 2014 has the highest pushes/day average with 620 pushes/day
July 2014 has the highest average of "pushes-per-hour" with 23.51 pushes/hour
August 20, 2014 had the highest number of pushes in one day with 690 pushes







by Kim Moir (noreply@blogger.com) at September 10, 2014 02:09 PM

Call for Submissions: Modeling Symposium ECE 2014

by Jonas Helming at September 10, 2014 09:54 AM

I am happy to announce that Philip, Ed and I are organizing the Modeling Symposium for EclipseCon Europe 2014. It is scheduled for the first day of the conference, i.e., Tuesday, October 28th. 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 technology and features. We are mainly targeting projects that are not otherwise represented in the conference program.

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

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 the topic is relevant.

Don’t bore us! Get to the point quickly. You don’t have to use all your allocated time. 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, and focus on the most important aspects. The conference offers the 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!

ECE%20Friends%20600x125 0 Call for Submissions: Modeling Symposium ECE 2014


TwitterGoogle+LinkedInFacebook

Leave a Comment. Tagged with eclipse, eclipsecon, emf, eclipse, eclipsecon, emf


by Jonas Helming at September 10, 2014 09:54 AM