diff --git a/src/java/davmail/DavGateway.java b/src/java/davmail/DavGateway.java index ca415bce..8f21a846 100644 --- a/src/java/davmail/DavGateway.java +++ b/src/java/davmail/DavGateway.java @@ -113,8 +113,8 @@ public class DavGateway { versionReader = new BufferedReader(new InputStreamReader(getMethod.getResponseBodyAsStream())); version = versionReader.readLine(); } - } catch (Exception e) { - // ignore + } catch (IOException e) { + DavGatewayTray.debug("Exception getting released version",e); } finally { if (versionReader != null) { try { diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index db5f6dfb..0c60e821 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -798,10 +798,10 @@ public class ExchangeSession { public List getAllEvents() throws IOException { int caldavPastDelay = Settings.getIntProperty("davmail.caldavPastDelay", 90); String dateCondition = ""; - if(caldavPastDelay != 0) { + if (caldavPastDelay != 0) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DAY_OF_MONTH, -caldavPastDelay); - dateCondition = " AND \"urn:schemas:calendar:dtstart\" > '"+dateFormatter.format(cal.getTime())+"'\n"; + dateCondition = " AND \"urn:schemas:calendar:dtstart\" > '" + dateFormatter.format(cal.getTime()) + "'\n"; } List events = new ArrayList(); @@ -992,11 +992,13 @@ public class ExchangeSession { /** * Search users in global address book * - * @param searchValue + * @param searchAttribute exchange search attribute + * @param searchValue search value * @return List of users + * @throws java.io.IOException on error */ public Map> galFind(String searchAttribute, String searchValue) throws IOException { - Map> results = new HashMap>(); + Map> results; GetMethod getMethod = new GetMethod(URIUtil.encodePathQuery("/public/?Cmd=galfind&" + searchAttribute + "=" + searchValue)); try { int status = wdr.retrieveSessionInstance().executeMethod(getMethod); diff --git a/src/java/davmail/exchange/ExchangeSessionFactory.java b/src/java/davmail/exchange/ExchangeSessionFactory.java index 5f95efe9..7011b8b1 100644 --- a/src/java/davmail/exchange/ExchangeSessionFactory.java +++ b/src/java/davmail/exchange/ExchangeSessionFactory.java @@ -74,6 +74,9 @@ public class ExchangeSessionFactory { } } + private ExchangeSessionFactory() { + } + /** * Create authenticated Exchange session * diff --git a/src/java/davmail/exchange/XMLStreamUtil.java b/src/java/davmail/exchange/XMLStreamUtil.java index b11d9d4e..a4f74e11 100644 --- a/src/java/davmail/exchange/XMLStreamUtil.java +++ b/src/java/davmail/exchange/XMLStreamUtil.java @@ -6,15 +6,13 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import java.io.IOException; import java.io.InputStream; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; import java.util.HashMap; +import java.util.Map; /** * XmlStreamReader utility methods */ -public class XMLStreamUtil { +public final class XMLStreamUtil { private XMLStreamUtil() { } diff --git a/src/java/davmail/tray/SwtGatewayTray.java b/src/java/davmail/tray/SwtGatewayTray.java index 5c971834..44856ded 100644 --- a/src/java/davmail/tray/SwtGatewayTray.java +++ b/src/java/davmail/tray/SwtGatewayTray.java @@ -31,6 +31,7 @@ public class SwtGatewayTray implements DavGatewayTrayInterface { private static Display display; private static Shell shell; private boolean isActive = true; + private boolean isReady = false; public java.awt.Image getFrameIcon() { return awtImage; @@ -257,6 +258,7 @@ public class SwtGatewayTray implements DavGatewayTrayInterface { settingsFrame.setVisible(true); } // ready + isReady = true; synchronized (mainThread) { mainThread.notify(); } @@ -277,13 +279,15 @@ public class SwtGatewayTray implements DavGatewayTrayInterface { } } }.start(); - // wait for SWT init - try { - synchronized (mainThread) { - mainThread.wait(); + while (!isReady) { + // wait for SWT init + try { + synchronized (mainThread) { + mainThread.wait(1000); + } + } catch (InterruptedException e) { + DavGatewayTray.error("Error waiting for SWT init", e); } - } catch (InterruptedException e) { - DavGatewayTray.error("Error waiting for SWT init",e); } } diff --git a/src/site/xdoc/thunderbirdcalendarsetup.xml b/src/site/xdoc/thunderbirdcalendarsetup.xml index 157d4823..d4e46bc3 100644 --- a/src/site/xdoc/thunderbirdcalendarsetup.xml +++ b/src/site/xdoc/thunderbirdcalendarsetup.xml @@ -48,7 +48,7 @@ -

Proceeed to Thunderbird calendar setup

+

Proceeed to Thunderbird directory setup