Index: /applications/editors/josm/plugins/geotools/.project
===================================================================
--- /applications/editors/josm/plugins/geotools/.project	(revision 30733)
+++ /applications/editors/josm/plugins/geotools/.project	(revision 30734)
@@ -13,4 +13,5 @@
 	</buildSpec>
 	<natures>
+		<nature>org.sonar.ide.eclipse.core.sonarNature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
Index: /applications/editors/josm/plugins/geotools/.settings/org.sonar.ide.eclipse.core.prefs
===================================================================
--- /applications/editors/josm/plugins/geotools/.settings/org.sonar.ide.eclipse.core.prefs	(revision 30734)
+++ /applications/editors/josm/plugins/geotools/.settings/org.sonar.ide.eclipse.core.prefs	(revision 30734)
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+extraProperties=
+lastAnalysisDate=1413643667683
+projectKey=josm-plugins
+serverUrl=http\://donvip.fr/sonar
+version=2
Index: /applications/editors/josm/plugins/geotools/build.xml
===================================================================
--- /applications/editors/josm/plugins/geotools/build.xml	(revision 30733)
+++ /applications/editors/josm/plugins/geotools/build.xml	(revision 30734)
@@ -5,5 +5,5 @@
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="7001"/>
-	
+    
     <property name="plugin.author" value="Don-vip"/>
     <property name="plugin.class" value="org.openstreetmap.josm.plugins.geotools.GeoToolsPlugin"/>
@@ -17,5 +17,5 @@
     <!-- ** include targets that all plugins have in common ** -->
     <import file="../build-common.xml"/>
-	
+    
     <!--
     **********************************************************
@@ -24,19 +24,19 @@
     -->
     <target name="post-dist">
-    	<move file="${plugin.jar}" todir="${plugin.build.dir}" />
-    	<jar destfile="${plugin.jar}" filesetmanifest="merge">
+        <move file="${plugin.jar}" todir="${plugin.build.dir}" />
+        <jar destfile="${plugin.jar}" filesetmanifest="merge">
             <fileset dir="jar"/>
-    		<zipfileset src="${plugin.build.dir}/${ant.project.name}.jar">
+            <zipfileset src="${plugin.build.dir}/${ant.project.name}.jar">
                 <exclude name="*.class"/>
-    			<exclude name="*.html"/>
+                <exclude name="*.html"/>
                 <exclude name="META-INF/**/*"/>
                 <exclude name="javax/*.txt"/>
-    		</zipfileset>
-    	    <zipfileset src="${plugin.build.dir}/${ant.project.name}.jar">
-    	        <include name="META-INF/MANIFEST.MF"/>
-    	        <include name="META-INF/*.jai"/>
-    	    </zipfileset>
-    	</jar>
-    	<delete file="${plugin.build.dir}/${ant.project.name}.jar" />
+            </zipfileset>
+            <zipfileset src="${plugin.build.dir}/${ant.project.name}.jar">
+                <include name="META-INF/MANIFEST.MF"/>
+                <include name="META-INF/*.jai"/>
+            </zipfileset>
+        </jar>
+        <delete file="${plugin.build.dir}/${ant.project.name}.jar" />
     </target>
 </project>
Index: /applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java
===================================================================
--- /applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java	(revision 30733)
+++ /applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java	(revision 30734)
@@ -17,5 +17,13 @@
 import com.sun.media.jai.imageioimpl.ImageReadWriteSpi;
 
+/**
+ * GeoTools plugin, bringing this library to other JOSM plugins.
+ */
 public class GeoToolsPlugin extends Plugin {
+
+    /**
+     * Constructs a new {@code GeoToolsPlugin}.
+     * @param info plugin information
+     */
     public GeoToolsPlugin(PluginInformation info) {
         super(info);
@@ -29,5 +37,5 @@
         // See https://www.java.net/node/666373
         System.setProperty("com.sun.media.jai.disableMediaLib", "true");
-                
+
         // As the JAI jars are bundled in the geotools plugin, JAI initialization does not work,
         // so we need to perform the tasks described here ("Initialization and automatic loading of registry objects"):
@@ -35,34 +43,23 @@
         OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
         if (registry == null) {
-            System.err.println("geotools: error in JAI initialization. Cannot access default operation registry");
+            Main.error("geotools: error in JAI initialization. Cannot access default operation registry");
         } else {
             // Update registry with com.sun.media.jai.imageioimpl.ImageReadWriteSpi (only class listed javax.media.jai.OperationRegistrySpi)
-            // it would be safer to parse this file instead, but a JAI update is very unlikely as it has not been modified since 2005 
+            // it would be safer to parse this file instead, but a JAI update is very unlikely as it has not been modified since 2005
             new ImageReadWriteSpi().updateRegistry(registry);
 
-            // Update registry with GeoTools registry file 
-            InputStream in = GeoToolsPlugin.class.getResourceAsStream("/META-INF/registryFile.jai");
-            if (in == null) {
-                System.err.println("geotools: error in JAI initialization. Cannot access META-INF/registryFile.jai");
-            } else {
-                try {
+            // Update registry with GeoTools registry file
+            try (InputStream in = GeoToolsPlugin.class.getResourceAsStream("/META-INF/registryFile.jai")) {
+                if (in == null) {
+                    Main.error("geotools: error in JAI initialization. Cannot access META-INF/registryFile.jai");
+                } else {
                     registry.updateFromStream(in);
-                } catch (IOException e) {
-                    System.err.println("geotools: error in JAI initialization. Cannot update default operation registry");
                 }
-                try {
-                    in.close();
-                } catch (IOException e) {
-                    System.err.println("geotools: error in JAI initialization. Cannot close input stream");
-                }
+            } catch (IOException e) {
+                Main.error("geotools: error in JAI initialization: "+e.getMessage());
             }
-            
-            // Print JAI registry contents
-            //for (String mode : RegistryMode.getModeNames()) {
-            //    System.out.println("geotools: JAI mode "+mode+": "+Arrays.toString(registry.getDescriptorNames(mode)));
-            //}
         }
     }
-    
+
     private void initGeoTools() {
         // Force Axis order. Fix #8248
