Index: applications/editors/josm/plugins/turnrestrictions/build.xml
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/build.xml	(revision 24124)
+++ applications/editors/josm/plugins/turnrestrictions/build.xml	(revision 24125)
@@ -31,5 +31,5 @@
 
 	<!-- enter the SVN commit message -->
-	<property name="commit.message" value="Migration to Java6 -  making use of JTable::setFillsViewportHeight()" />
+	<property name="commit.message" value="Fixing #5614 - JOSM Plugin turn Restrictions" />
 	<!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
 	<property name="plugin.main.version" value="3518" />
@@ -267,4 +267,11 @@
 		<pathelement location="${eclipse.plugin.dir}/org.junit_4.8.1.v4_8_1_v20100427-1100\junit.jar" />
 	</path>
+	
+	<path id="fest.library.path">
+		<fileset dir="test/lib">
+			<include name="fest-*.jar" />
+			<include name="jcp-*.jar" />
+		</fileset>
+    </path>
 
 	<path id="test.class.path">
@@ -273,4 +280,5 @@
 		<path refid="groovy.path" />
 		<path refid="junit.path" />
+		<path refid="fest.library.path" />
 	</path>
 
@@ -278,4 +286,5 @@
 		<path refid="junit.path" />
 		<path refid="groovy.path" />
+		<path refid="fest.library.path" />
 		<pathelement location="${josm}" />
 		<pathelement location="${test.build.dir}" />
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java	(revision 24124)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java	(revision 24125)
@@ -1,7 +1,3 @@
 package org.openstreetmap.josm.plugins.turnrestrictions;
-
-import static org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder.determineWayJoinOrientation;
-import static org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder.isEndNode;
-import static org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder.isStartNode;
 
 import java.util.ArrayList;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 24124)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 24125)
@@ -87,6 +87,4 @@
     private JosmSelectionPanel pnlJosmSelection;
     private BasicEditorPanel pnlBasicEditor;
-    private AdvancedEditorPanel pnlAdvancedEditor;
-    private IssuesView pnlIssuesView;
     private TurnRestrictionEditorModel editorModel;
     private JTabbedPane tpEditors;
@@ -102,8 +100,11 @@
         pnl.setLayout(new FlowLayout(FlowLayout.CENTER));
 
-        pnl.add(new SideButton(new OKAction()));
-        pnl.add(new SideButton(new CancelAction()));
-        
-        pnl.add(new SideButton(new ContextSensitiveHelpAction(ht("/Plugins/turnrestrictions#TurnRestrictionEditor"))));
+        SideButton b;
+        pnl.add(b = new SideButton(new OKAction()));
+        b.setName("btnOK");
+        pnl.add(b = new SideButton(new CancelAction()));
+        b.setName("btnCancel");
+        pnl.add(b = new SideButton(new ContextSensitiveHelpAction(ht("/Plugins/turnrestrictions#TurnRestrictionEditor"))));
+        b.setName("btnHelp");
         return pnl;
     }
@@ -134,9 +135,9 @@
         tpEditors.setToolTipTextAt(0, tr("Edit basic attributes of a turn restriction"));
         
-        tpEditors.add(pnlAdvancedEditor = new AdvancedEditorPanel(editorModel));
+        tpEditors.add(new AdvancedEditorPanel(editorModel));
         tpEditors.setTitleAt(1, tr("Advanced"));
         tpEditors.setToolTipTextAt(1, tr("Edit the raw tags and members of this turn restriction"));
         
-        tpEditors.add(pnlIssuesView = new IssuesView(editorModel.getIssuesModel()));
+        tpEditors.add(new IssuesView(editorModel.getIssuesModel()));
         tpEditors.setTitleAt(2, tr("Errors/Warnings"));
         tpEditors.setToolTipTextAt(2, tr("Show errors and warnings related to this turn restriction"));
@@ -650,5 +651,5 @@
                 return;
             }
-            if (getTurnRestriction() == null) {
+            if (getTurnRestriction() == null || getTurnRestriction().getDataSet() == null) {
                 applyNewTurnRestriction();
                 return;
@@ -693,5 +694,5 @@
                 return;
             }
-            if (getTurnRestriction() == null) {
+            if (getTurnRestriction() == null || getTurnRestriction().getDataSet() == null) {
                 // it's a new turn restriction. Try to save it and close the dialog
                 if (applyNewTurnRestriction()) {
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java	(revision 24124)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java	(revision 24125)
@@ -220,5 +220,4 @@
         CheckParameterUtil.ensureParameterNotNull(turnRestriction, "turnRestriction");      
         TagCollection tags = tagEditorModel.getTagCollection();
-        logger.info(tags.toString());
         turnRestriction.removeAll();
         tags.applyTo(turnRestriction);
