Index: applications/editors/josm/plugins/trustosm/build.xml
===================================================================
--- applications/editors/josm/plugins/trustosm/build.xml	(revision 36343)
+++ applications/editors/josm/plugins/trustosm/build.xml	(revision 36349)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="trustosm: recompile for compatibility with JOSM r17896" />
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="18494"/>
+    <property name="plugin.main.version" value="19044"/>
     <property name="plugin.author" value="Christoph Wagner" />
     <property name="plugin.class" value="org.openstreetmap.josm.plugins.trustosm.TrustOSMplugin" />
@@ -22,86 +22,7 @@
         <include name="plastic_laf.jar"/>
     </fileset>
-    <!-- create a property containing all .jar files, prefix lib/, and seperated with a space -->
-    <pathconvert property="libs.project" pathsep=" ">
-        <mapper>
-            <chainedmapper>
-                <!-- remove absolute path -->
-                <flattenmapper/>
-                <!-- add lib/ prefix -->
-                <globmapper from="*" to="${ant.project.name}/lib/*"/>
-            </chainedmapper>
-        </mapper>
-        <path>
-            <!-- plugin.lib.dir contains all jar files -->
-            <fileset dir="${plugin.lib.dir}">
-                <include name="**/*.jar"/>
-                <exclude name="**/*-sources.jar"/>
-                <exclude name="**/*-javadoc.jar"/>
-            </fileset>
-        </path>
-    </pathconvert>
-    <!-- additional entry in manifest -->
-    <target name="additional-manifest">
-        <manifest file="MANIFEST" mode="update">
-            <attribute name="Class-Path" value="${libs.project}"/>
-        </manifest>
-    </target>
-    <!--
-    **********************************************************
-    ** setup-dist - copies files for distribution
-    **********************************************************
-    -->
-    <target name="setup-dist">
-        <antcall target="setup-dist-default" />
-        <copy todir="${plugin.build.dir}/lib">
-            <fileset dir="${plugin.lib.dir}"/>
-        </copy>
-    </target>
-    <!--
-    **********************************************************
-    ** dist - creates the plugin jar
-    **********************************************************
-    -->
-    <target name="dist" depends="compile,revision">
-        <echo message="creating ${ant.project.name}.jar ... "/>
-        <antcall target="setup-dist" />
-        <delete file="MANIFEST" failonerror="no"/>
-        <manifest file="MANIFEST" mode="update">
-            <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
-            <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
-            <attribute name="Plugin-Class" value="${plugin.class}" />
-            <attribute name="Plugin-Description" value="${plugin.description}" />
-            <attribute name="Plugin-Date" value="${version.entry.commit.date}" />
-            <attribute name="Author" value="${plugin.author}"/>
-        </manifest>
-        <antcall target="add-manifest-attribute">
-            <param name="manifest.attribute" value="Plugin-Link"/>
-            <param name="property.name" value="plugin.link"/>
-            <param name="property.value" value="${plugin.link}"/>
-        </antcall>
-        <antcall target="add-manifest-attribute">
-            <param name="manifest.attribute" value="Plugin-Icon"/>
-            <param name="property.name" value="plugin.icon"/>
-            <param name="property.value" value="${plugin.icon}"/>
-        </antcall>
-        <antcall target="add-manifest-attribute">
-            <param name="manifest.attribute" value="Plugin-Early"/>
-            <param name="property.name" value="plugin.early"/>
-            <param name="property.value" value="${plugin.early}"/>
-        </antcall>
-        <antcall target="add-manifest-attribute">
-            <param name="manifest.attribute" value="Plugin-Requires"/>
-            <param name="property.name" value="plugin.requires"/>
-            <param name="property.value" value="${plugin.requires}"/>
-        </antcall>
-        <antcall target="add-manifest-attribute">
-            <param name="manifest.attribute" value="Plugin-Stage"/>
-            <param name="property.name" value="plugin.stage"/>
-            <param name="property.value" value="${plugin.stage}"/>
-        </antcall>
-        <antcall target="additional-manifest" />
-        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest="MANIFEST" manifestencoding="UTF-8"/>
-        <delete file="MANIFEST" failonerror="no"/>
-        <antcall target="post-dist" />
+
+    <target name="pre-compile" depends="fetch_dependencies">
+        <!-- include fetch_dependencies task -->
     </target>
 </project>
Index: applications/editors/josm/plugins/trustosm/pom.xml
===================================================================
--- applications/editors/josm/plugins/trustosm/pom.xml	(revision 36343)
+++ applications/editors/josm/plugins/trustosm/pom.xml	(revision 36349)
@@ -16,5 +16,5 @@
     <properties>
         <plugin.src.dir>src</plugin.src.dir>
-        <plugin.main.version>18494</plugin.main.version>
+        <plugin.main.version>19044</plugin.main.version>
         <plugin.author>Christoph Wagner</plugin.author>
         <plugin.class>org.openstreetmap.josm.plugins.trustosm.TrustOSMplugin</plugin.class>
@@ -27,6 +27,6 @@
         <dependency>
             <groupId>org.bouncycastle</groupId>
-            <artifactId>bcpg-jdk15on</artifactId>
-            <version>1.51</version>
+            <artifactId>bcpg-jdk18on</artifactId>
+            <version>1.78.1</version>
         </dependency>
         <dependency>
Index: applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustGPG.java
===================================================================
--- applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustGPG.java	(revision 36343)
+++ applications/editors/josm/plugins/trustosm/src/org/openstreetmap/josm/plugins/trustosm/util/TrustGPG.java	(revision 36349)
@@ -7,6 +7,4 @@
 import java.awt.Dimension;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.ComponentAdapter;
 import java.awt.event.ComponentEvent;
@@ -15,5 +13,4 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.security.KeyPair;
@@ -106,5 +103,5 @@
     private PGPSecretKeyRingCollection pgpSec;
     private PGPPublicKeyRingCollection pgpPub;
-    private static int digest = PGPUtil.SHA1;
+    private static final int digest = PGPUtil.SHA1;
     private PGPSecretKey pgpSecKey;
     public boolean keepkey = false;
@@ -122,12 +119,8 @@
 
     public PGPPublicKey getPublicKeyFromRing(long keyID) {
-        try {
-            if (pgpPub.contains(keyID))
-                return pgpPub.getPublicKey(keyID);
-            else if (pgpSec.contains(keyID))
-                return pgpSec.getSecretKey(keyID).getPublicKey();
-        } catch (PGPException e) {
-            System.err.println("Could not read a PGPPublic key from your KeyRingCollectionFile. Stacktrace:");
-            e.printStackTrace();
+        if (pgpPub.contains(keyID)) {
+            return pgpPub.getPublicKey(keyID);
+        } else if (pgpSec.contains(keyID)) {
+            return pgpSec.getSecretKey(keyID).getPublicKey();
         }
         return null;
@@ -216,10 +209,8 @@
         JButton detailsButton = new JButton(tr("Details"), ImageProvider.get("keydetails"));
         detailsButton.setAlignmentX(Component.LEFT_ALIGNMENT);
-        detailsButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent arg0) {
-                PGPSecretKey sk = sigKeys.get(keyBox.getSelectedIndex());
-                showKeyDetails(getPublicKeyFromRing(sk.getKeyID()));
-            } });
+        detailsButton.addActionListener(arg0 -> {
+            PGPSecretKey sk = sigKeys.get(keyBox.getSelectedIndex());
+            showKeyDetails(getPublicKeyFromRing(sk.getKeyID()));
+        });
         p.add(detailsButton);
 
@@ -232,18 +223,15 @@
         JButton createButton = new JButton(tr("Create new Key"), ImageProvider.get("key"));
         createButton.setAlignmentX(Component.LEFT_ALIGNMENT);
-        createButton.addActionListener(new ActionListener() {
-
-            @Override
-            public void actionPerformed(ActionEvent arg0) {
-                try {
-                    PGPSecretKey secKey = generateKey();
-                    if (secKey != null) {
-                        keyBox.addItem(secKeytoString(secKey));
-                        sigKeys.add(secKey);
-                    }
-                } catch (NoSuchAlgorithmException | NoSuchProviderException | PGPException | IOException e) {
-                    Logging.error(e);
+        createButton.addActionListener(arg0 -> {
+            try {
+                PGPSecretKey secKey = generateKey();
+                if (secKey != null) {
+                    keyBox.addItem(secKeytoString(secKey));
+                    sigKeys.add(secKey);
                 }
-            } });
+            } catch (NoSuchAlgorithmException | NoSuchProviderException | PGPException | IOException e) {
+                Logging.error(e);
+            }
+        });
         p.add(createButton);
         p.add(Box.createRigidArea(d));
@@ -265,5 +253,5 @@
     }
 
-    public void readGpgFiles() throws PGPException, IOException, NoSuchAlgorithmException, NoSuchProviderException {
+    public void readGpgFiles() throws PGPException, IOException {
         FileInputStream pubIn;
         FileInputStream secIn;
@@ -283,5 +271,5 @@
     }
 
-    public void writeGpgFiles() throws FileNotFoundException, IOException {
+    public void writeGpgFiles() throws IOException {
         String path = Preferences.main().getPluginsDirectory().getPath();
         try (FileOutputStream pubOut = new FileOutputStream(path + "/trustosm/gnupg/pubring.gpg");
@@ -450,5 +438,5 @@
      */
     public static double searchTolerance(PGPSignature sig) {
-        /** Take the first NotationData packet that seems to have Tolerance information */
+        /* Take the first NotationData packet that seems to have Tolerance information */
         for (NotationData nd : sig.getHashedSubPackets().getNotationDataOccurrences()) {
             if (nd.getNotationName().equals(TrustGPG.NOTATION_DATA_KEY)) {
@@ -470,5 +458,5 @@
 
         JFormattedTextField meters = new JFormattedTextField(NumberFormat.getNumberInstance());
-        meters.setValue(Double.valueOf(10));
+        meters.setValue(10.0);
         meters.setColumns(5);
 
@@ -480,5 +468,5 @@
 
         if (n == JOptionPane.OK_OPTION) {
-            spGen.setNotationData(false, true, TrustGPG.NOTATION_DATA_KEY, "Tolerance:"+meters.getValue()+"m");
+            spGen.addNotationData(false, true, TrustGPG.NOTATION_DATA_KEY, "Tolerance:" + meters.getValue() + "m");
             return spGen;
         }
@@ -512,5 +500,5 @@
             if (web.isSelected()) sources += ":web";
             if (trusted.isSelected()) sources += ":trusted";
-            spGen.setNotationData(false, true, TrustGPG.NOTATION_DATA_KEY, sources);
+            spGen.addNotationData(false, true, TrustGPG.NOTATION_DATA_KEY, sources);
             return spGen;
         }
@@ -548,8 +536,8 @@
             Iterator<?> it = pgpSecKey.getPublicKey().getUserIDs();
             if (it.hasNext()) {
-                spGen.setSignerUserID(false, (String) it.next());
+                spGen.addSignerUserID(false, (String) it.next());
             }
             sGen.setHashedSubpackets(spGen.generate());
-            sGen.update(tosign.getBytes(Charset.forName("UTF-8")));
+            sGen.update(tosign.getBytes(StandardCharsets.UTF_8));
             sig = sGen.generate();
             //System.out.println(new String(sGen.generateOnePassVersion(false).getEncoded(),Charset.forName("UTF-8")));
@@ -586,5 +574,5 @@
             PGPContentVerifierBuilderProvider contentVerifierBuilderProvider = new JcaPGPContentVerifierBuilderProvider().setProvider(provider);
             sig.init(contentVerifierBuilderProvider, pgpPub.getPublicKey(sig.getKeyID()));
-            sig.update(sigtext.getBytes(Charset.forName("UTF-8")));
+            sig.update(sigtext.getBytes(StandardCharsets.UTF_8));
             return sig.verify();
         } catch (Exception e) {
@@ -630,5 +618,5 @@
         String keyid = "0x"+Long.toHexString(key.getKeyID()).substring(8).toUpperCase(Locale.ENGLISH);
 
-        String algorithm = "";
+        final String algorithm;
         int algo = key.getAlgorithm();
         switch(algo) {
@@ -637,5 +625,5 @@
         case PGPPublicKey.DSA:
             algorithm = "Digital Signature Algorithm (DSA)"; break;
-        case PGPPublicKey.EC:
+        case PGPPublicKey.ECDH:
             algorithm = "Elliptic Curve (EC)"; break;
         case PGPPublicKey.ECDSA:
@@ -703,5 +691,5 @@
 
     public PGPSecretKey generateKey()
-            throws NoSuchAlgorithmException, NoSuchProviderException, PGPException, FileNotFoundException, IOException {
+            throws NoSuchAlgorithmException, NoSuchProviderException, PGPException, IOException {
 
         JTextField userId = new JTextField();
@@ -738,26 +726,22 @@
         final String[] algos = {"DSA", "RSA"};
         final JComboBox<?> algoBox = new JComboBox<Object>(algos);
-        algoBox.addActionListener(new ActionListener() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                JComboBox<?> cb = (JComboBox<?>) e.getSource();
-                String alg = (String) cb.getSelectedItem();
-                if (alg.equals("DSA")) {
-                    strengthBox.setSelectedItem("1024");
-                    strengthBox.setEnabled(false);
-                } else
-                    strengthBox.setEnabled(true);
-                /*if (alg.equals("ECDSA")) {
-                    curveBox.setEnabled(true);
-                    strengthBox.setModel(new DefaultComboBoxModel(curvesizes));
-                    strengthBox.setSelectedItem(curvesizes[curveBox.getSelectedIndex()]);
-                    strengthBox.setEnabled(false);
-                } else {
-                    curveBox.setEnabled(false);
-                    strengthBox.setModel(new DefaultComboBoxModel(sizes));
-                    strengthBox.setEnabled(true);
-                }*/
-            }
+        algoBox.addActionListener(e -> {
+            JComboBox<?> cb = (JComboBox<?>) e.getSource();
+            String alg = (String) cb.getSelectedItem();
+            if ("DSA".equals(alg)) {
+                strengthBox.setSelectedItem("1024");
+                strengthBox.setEnabled(false);
+            } else
+                strengthBox.setEnabled(true);
+            /*if (alg.equals("ECDSA")) {
+                curveBox.setEnabled(true);
+                strengthBox.setModel(new DefaultComboBoxModel(curvesizes));
+                strengthBox.setSelectedItem(curvesizes[curveBox.getSelectedIndex()]);
+                strengthBox.setEnabled(false);
+            } else {
+                curveBox.setEnabled(false);
+                strengthBox.setModel(new DefaultComboBoxModel(sizes));
+                strengthBox.setEnabled(true);
+            }*/
         });
 
@@ -836,8 +820,7 @@
 
         PGPSignatureSubpacketVector subPck = null;
-        PGPSignatureSubpacketGenerator spGen = null;
         Date expire = cal.getDate();
         if (expire != null && expire.after(now)) {
-            spGen = new PGPSignatureSubpacketGenerator();
+            final PGPSignatureSubpacketGenerator spGen = new PGPSignatureSubpacketGenerator();
             spGen.setKeyExpirationTime(true, (expire.getTime()-now.getTime())/1000);
             subPck = spGen.generate();
