diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java index 39474edf..8dd352bd 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java @@ -63,10 +63,10 @@ public class FreemindExporter export(map.getUnzipXml(), outputStream); } - public void export(byte[] xml, @NotNull OutputStream outputStream) throws ExportException { + public void export(@NotNull byte[] xml, @NotNull OutputStream outputStream) throws ExportException { objectFactory = new com.wisemapping.jaxb.freemind.ObjectFactory(); - nodesMap = new HashMap(); + nodesMap = new HashMap<>(); final com.wisemapping.jaxb.wisemap.Map mindmapMap; try { @@ -124,15 +124,7 @@ public class FreemindExporter } JAXBUtils.saveMap(freemindMap, outputStream); - } catch (JAXBException e) { - throw new ExportException(e); - } catch (UnsupportedEncodingException e) { - throw new ExportException(e); - } catch (SAXException e) { - throw new ExportException(e); - } catch (ParserConfigurationException e) { - throw new ExportException(e); - } catch (IOException e) { + } catch (JAXBException | SAXException | IOException | ParserConfigurationException e) { throw new ExportException(e); } } diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java b/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java index e935b577..be7fc416 100644 --- a/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java +++ b/wise-webapp/src/main/java/com/wisemapping/mail/Mailer.java @@ -53,21 +53,16 @@ public final class Mailer { public void sendEmail(final String from, final String to, final String subject, final Map model, @NotNull final String templateMail) { - final MimeMessagePreparator preparator = - new MimeMessagePreparator() { - public void prepare(MimeMessage mimeMessage) - throws Exception { - final MimeMessageHelper message = new MimeMessageHelper(mimeMessage); - message.setTo(to); - message.setFrom(from); - message.setSubject(subject); - final String messageBody = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "/mail/" + templateMail, model); - message.setText(messageBody, true); - } - }; + this.mailSender.send(mimeMessage -> { + final MimeMessageHelper message = new MimeMessageHelper(mimeMessage); + message.setTo(to); + message.setFrom(from); + message.setSubject(subject); - this.mailSender.send(preparator); + final String messageBody = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "/mail/" + templateMail, model); + message.setText(messageBody, true); + }); } public void setMailSender(JavaMailSender mailer) { diff --git a/wise-webapp/src/main/java/com/wisemapping/model/MindmapIcons.java b/wise-webapp/src/main/java/com/wisemapping/model/MindmapIcons.java index 6284c7b2..734f141c 100755 --- a/wise-webapp/src/main/java/com/wisemapping/model/MindmapIcons.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/MindmapIcons.java @@ -215,7 +215,7 @@ public class MindmapIcons { private static void load() { try { if (iconsByFamily == null) { - iconsByFamily = new TreeMap>(); + iconsByFamily = new TreeMap<>(); Field[] fields = MindmapIcons.class.getDeclaredFields(); for (Field field : fields) {