From 1c67d853306347d0e78a3e4a3c8a018b681454ba Mon Sep 17 00:00:00 2001 From: mguessan Date: Mon, 2 Nov 2009 09:53:42 +0000 Subject: [PATCH] Fix from audit git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@811 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 9 +++++---- src/java/davmail/ui/OSXAdapter.java | 11 ++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index f77220be..3be9a8a9 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -1094,8 +1094,9 @@ public class ExchangeSession { * @param currentFolder current folder * @return current folder or new refreshed folder * @throws IOException on error - * @Deprecated no longer used: breaks Outlook IMAP + * @deprecated no longer used: breaks Outlook IMAP */ + @Deprecated public Folder refreshFolder(Folder currentFolder) throws IOException { Folder newFolder = getFolder(currentFolder.folderName); if (currentFolder.contenttag == null || !currentFolder.contenttag.equals(newFolder.contenttag)) { @@ -1331,7 +1332,7 @@ public class ExchangeSession { /** * Exchange message. */ - public class Message implements Comparable { + public class Message implements Comparable { protected String messageUrl; /** * Message uid. @@ -1549,8 +1550,8 @@ public class ExchangeSession { * @param message other message * @return imapUid comparison result */ - public int compareTo(Object message) { - long compareValue = (imapUid - ((Message) message).imapUid); + public int compareTo(Message message) { + long compareValue = (imapUid - message.imapUid); if (compareValue > 0) { return 1; } else if (compareValue < 0) { diff --git a/src/java/davmail/ui/OSXAdapter.java b/src/java/davmail/ui/OSXAdapter.java index ea22cba6..f04a2579 100644 --- a/src/java/davmail/ui/OSXAdapter.java +++ b/src/java/davmail/ui/OSXAdapter.java @@ -18,10 +18,7 @@ */ package davmail.ui; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Proxy; +import java.lang.reflect.*; /** * Reflection based MacOS handler @@ -32,7 +29,7 @@ public class OSXAdapter implements InvocationHandler { protected final Method targetMethod; protected final String proxySignature; - static Object macOSXApplication; + static Constructor macOSXApplication; /** * Pass this method an Object and Method equipped to perform application shutdown logic. @@ -136,9 +133,9 @@ public class OSXAdapter implements InvocationHandler { * @throws IllegalAccessException on error */ public static void setHandler(OSXAdapter adapter) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException { - Class applicationClass = Class.forName("com.apple.eawt.Application"); + Class applicationClass = Class.forName("com.apple.eawt.Application"); if (macOSXApplication == null) { - macOSXApplication = applicationClass.getConstructor((Class[]) null).newInstance((Object[]) null); + macOSXApplication = (Constructor) applicationClass.getConstructor((Class[]) null).newInstance((Object[]) null); } Class applicationListenerClass = Class.forName("com.apple.eawt.ApplicationListener"); Method addListenerMethod = applicationClass.getDeclaredMethod("addApplicationListener", new Class[]{applicationListenerClass});