Index: /applications/editors/josm/plugins/tag2link/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /applications/editors/josm/plugins/tag2link/.settings/org.eclipse.jdt.core.prefs	(revision 30716)
+++ /applications/editors/josm/plugins/tag2link/.settings/org.eclipse.jdt.core.prefs	(revision 30717)
@@ -1,4 +1,11 @@
 eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -7,6 +14,88 @@
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
 org.eclipse.jdt.core.compiler.source=1.7
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
Index: /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkRuleChecker.java
===================================================================
--- /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkRuleChecker.java	(revision 30716)
+++ /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkRuleChecker.java	(revision 30717)
@@ -44,5 +44,5 @@
 public class Tag2LinkRuleChecker implements Tag2LinkConstants {
 
-    private static Collection<Source> sources = new ArrayList<Source>();
+    private static Collection<Source> sources = new ArrayList<>();
     
     private static boolean initialized = false;
@@ -149,5 +149,5 @@
     
     private static Collection<Link> processEval(EvalResult eval, Rule rule, Source source) {
-        Collection<Link> result = new ArrayList<Link>();
+        Collection<Link> result = new ArrayList<>();
         if (eval.matches()) {
             for (Link link : rule.links) {
@@ -176,5 +176,5 @@
      */
     public static Collection<Link> getLinks(IPrimitive p) {
-        Collection<Link> result = new ArrayList<Link>();
+        Collection<Link> result = new ArrayList<>();
         for (Source source : sources) {
             for (Rule rule : source.rules) {
@@ -191,5 +191,5 @@
      */
     public static Collection<Link> getLinks(Tag tag) {
-        Collection<Link> result = new ArrayList<Link>();
+        Collection<Link> result = new ArrayList<>();
         for (Source source : sources) {
             for (Rule rule : source.rules) {
Index: /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/action/OpenLinkAction.java
===================================================================
--- /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/action/OpenLinkAction.java	(revision 30716)
+++ /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/action/OpenLinkAction.java	(revision 30717)
@@ -27,4 +27,5 @@
 import java.net.URL;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.plugins.tag2link.Tag2LinkConstants;
@@ -71,36 +72,35 @@
                     data += param+"="+lp.params.get(param);
                 }
-                OutputStreamWriter osw = new OutputStreamWriter(conn.getOutputStream());
-                osw.write(data);
-                osw.flush();
-                osw.close();
+                try (OutputStreamWriter osw = new OutputStreamWriter(conn.getOutputStream())) {
+                    osw.write(data);
+                    osw.flush();
+                }
                 
                 String filename = "output.pdf";// FIXME: should work for PDF files only (not even tested)
-                FileOutputStream fos = new FileOutputStream(filename);
-                InputStream is = conn.getInputStream();
-                byte[] buffer = new byte[2048];
-                int n = -1;
-                while ((n = is.read(buffer)) > -1) {
-                    fos.write(buffer, 0, n);
+                try (FileOutputStream fos = new FileOutputStream(filename);
+                     InputStream is = conn.getInputStream()) {
+                    byte[] buffer = new byte[2048];
+                    int n = -1;
+                    while ((n = is.read(buffer)) > -1) {
+                        fos.write(buffer, 0, n);
+                    }
                 }
-                is.close();
-                fos.close();
                 
-                System.out.println("Opening "+filename);
+                Main.info("Opening "+filename);
                 String result = OpenBrowser.displayUrl("file://"+filename);
                 if (result != null) {
-                    System.err.println(result);
+                    Main.error(result);
                 }
                 
             } catch (MalformedURLException ex) {
-                ex.printStackTrace();
+                Main.error(ex);
             } catch (IOException ex) {
-                ex.printStackTrace();
+                Main.error(ex);
             }
         } else {
-            System.out.println("Opening "+link.url);
+            Main.info("Opening "+link.url);
             String result = OpenBrowser.displayUrl(link.url);
             if (result != null) {
-                System.err.println(result);
+                Main.error(result);
             }
         }
Index: /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/LinkPost.java
===================================================================
--- /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/LinkPost.java	(revision 30716)
+++ /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/LinkPost.java	(revision 30717)
@@ -26,6 +26,6 @@
     public LinkPost(LinkPost link) {
         this(new String(link.name), new String(link.url), 
-                link.headers == null ? null : new HashMap<String, String>(link.headers), 
-                link.params  == null ? null : new HashMap<String, String>(link.params));
+                link.headers == null ? null : new HashMap<>(link.headers), 
+                link.params  == null ? null : new HashMap<>(link.params));
     }
 
Index: /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/Rule.java
===================================================================
--- /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/Rule.java	(revision 30716)
+++ /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/Rule.java	(revision 30717)
@@ -26,6 +26,6 @@
 
 public class Rule {
-    public final Collection<Condition> conditions = new ArrayList<Condition>();
-    public final Collection<Link> links = new ArrayList<Link>();
+    public final Collection<Condition> conditions = new ArrayList<>();
+    public final Collection<Link> links = new ArrayList<>();
     
     public static class MatchingTag {
@@ -37,5 +37,5 @@
             this.key = key;
             this.value = value;
-            this.params = new HashMap<String, String>();
+            this.params = new HashMap<>();
             this.prefix = prefix;
             addKeyValueParams();
@@ -71,5 +71,5 @@
             this.conditionsNumber = conditionsNumber;
         }
-        public final Collection<MatchingTag> matchingTags = new ArrayList<MatchingTag>();
+        public final Collection<MatchingTag> matchingTags = new ArrayList<>();
         public boolean matches() {
             return conditionsNumber > 0 && matchingTags.size() >= conditionsNumber;
@@ -117,5 +117,5 @@
 
     public EvalResult evaluates(Tag tag) {
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         map.put(tag.getKey(), tag.getValue());
         return evaluates(map);
Index: /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/Source.java
===================================================================
--- /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/Source.java	(revision 30716)
+++ /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/data/Source.java	(revision 30717)
@@ -33,5 +33,5 @@
      * The rules applied against an OSM primitive or tag.
      */
-    public final Collection<Rule> rules = new ArrayList<Rule>();
+    public final Collection<Rule> rules = new ArrayList<>();
 
     /**
Index: /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/io/SourcesReader.java
===================================================================
--- /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/io/SourcesReader.java	(revision 30716)
+++ /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/io/SourcesReader.java	(revision 30717)
@@ -64,5 +64,5 @@
      */
     public static Collection<Source> readSources() {
-        List<Source> result = new ArrayList<Source>();
+        List<Source> result = new ArrayList<>();
 
         try {
@@ -123,5 +123,5 @@
     
     private Collection<Source> parseDoc() throws XMLStreamException {
-        List<Source> result = new ArrayList<Source>();
+        List<Source> result = new ArrayList<>();
         while (parser.hasNext()) {
             int event = parser.next();
@@ -140,5 +140,5 @@
     
     private Collection<Source> parseRoot() throws XMLStreamException {
-        List<Source> result = new ArrayList<Source>();
+        List<Source> result = new ArrayList<>();
         while (parser.hasNext()) {
             int event = parser.next();
@@ -217,10 +217,10 @@
                     if (parser.getLocalName().equals("header")) {
                         if (headers == null) {
-                            headers = new HashMap<String, String>();
+                            headers = new HashMap<>();
                         }
                         headers.put(parser.getAttributeValue(null, "name"), parser.getAttributeValue(null, "value"));
                     } else if (parser.getLocalName().equals("param")) {
                         if (params == null) {
-                            params = new HashMap<String, String>();
+                            params = new HashMap<>();
                         }
                         params.put(parser.getAttributeValue(null, "name"), parser.getAttributeValue(null, "value"));
Index: /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/listeners/AbstractPopupListener.java
===================================================================
--- /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/listeners/AbstractPopupListener.java	(revision 30716)
+++ /applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/listeners/AbstractPopupListener.java	(revision 30717)
@@ -37,5 +37,5 @@
     protected AbstractPopupListener(MapFrame frame) {
         this.frame = frame;
-        this.itemList = new ArrayList<JMenuItem>();
+        this.itemList = new ArrayList<>();
     }
     
