1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 11:42:23 -05:00

Fix from audit

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@811 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-11-02 09:53:42 +00:00
parent 4816707484
commit 1c67d85330
2 changed files with 9 additions and 11 deletions

View File

@ -1094,8 +1094,9 @@ public class ExchangeSession {
* @param currentFolder current folder * @param currentFolder current folder
* @return current folder or new refreshed folder * @return current folder or new refreshed folder
* @throws IOException on error * @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 { public Folder refreshFolder(Folder currentFolder) throws IOException {
Folder newFolder = getFolder(currentFolder.folderName); Folder newFolder = getFolder(currentFolder.folderName);
if (currentFolder.contenttag == null || !currentFolder.contenttag.equals(newFolder.contenttag)) { if (currentFolder.contenttag == null || !currentFolder.contenttag.equals(newFolder.contenttag)) {
@ -1331,7 +1332,7 @@ public class ExchangeSession {
/** /**
* Exchange message. * Exchange message.
*/ */
public class Message implements Comparable { public class Message implements Comparable<Message> {
protected String messageUrl; protected String messageUrl;
/** /**
* Message uid. * Message uid.
@ -1549,8 +1550,8 @@ public class ExchangeSession {
* @param message other message * @param message other message
* @return imapUid comparison result * @return imapUid comparison result
*/ */
public int compareTo(Object message) { public int compareTo(Message message) {
long compareValue = (imapUid - ((Message) message).imapUid); long compareValue = (imapUid - message.imapUid);
if (compareValue > 0) { if (compareValue > 0) {
return 1; return 1;
} else if (compareValue < 0) { } else if (compareValue < 0) {

View File

@ -18,10 +18,7 @@
*/ */
package davmail.ui; package davmail.ui;
import java.lang.reflect.InvocationHandler; import java.lang.reflect.*;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
/** /**
* Reflection based MacOS handler * Reflection based MacOS handler
@ -32,7 +29,7 @@ public class OSXAdapter implements InvocationHandler {
protected final Method targetMethod; protected final Method targetMethod;
protected final String proxySignature; protected final String proxySignature;
static Object macOSXApplication; static Constructor<?> macOSXApplication;
/** /**
* Pass this method an Object and Method equipped to perform application shutdown logic. * 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 * @throws IllegalAccessException on error
*/ */
public static void setHandler(OSXAdapter adapter) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException { 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) { 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"); Class applicationListenerClass = Class.forName("com.apple.eawt.ApplicationListener");
Method addListenerMethod = applicationClass.getDeclaredMethod("addApplicationListener", new Class[]{applicationListenerClass}); Method addListenerMethod = applicationClass.getDeclaredMethod("addApplicationListener", new Class[]{applicationListenerClass});