Changeset 551


Ignore:
Timestamp:
11/20/09 23:18:07 (2 years ago)
Author:
octorian
Message:

Warnings cleanup

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LogicMail/src/org/logicprobe/LogicMail/message/MimeMessageContent.java

    r532 r551  
    4646public abstract class MimeMessageContent implements Serializable { 
    4747    private long uniqueId; 
    48         private ContentPart messagePart; 
    49          
    50         /** 
    51         * Instantiates a new message content object 
    52         *  
    53         * @param messagePart the message part 
    54         */ 
    55         protected MimeMessageContent(ContentPart messagePart) { 
     48    private ContentPart messagePart; 
     49 
     50    /** 
     51    * Instantiates a new message content object 
     52    *  
     53    * @param messagePart the message part 
     54    */ 
     55    protected MimeMessageContent(ContentPart messagePart) { 
    5656        this.uniqueId = UniqueIdGenerator.getInstance().getUniqueId(); 
    57                 this.messagePart = messagePart; 
    58         } 
    59          
    60         /** 
    61         * Gets the message part representing the placement of 
    62         * this content within the message structure. 
    63         *  
    64         * @return the message part 
    65         */ 
    66         public ContentPart getMessagePart() { 
    67                 return this.messagePart; 
    68         } 
    69          
     57        this.messagePart = messagePart; 
     58    } 
     59 
     60    /** 
     61    * Gets the message part representing the placement of 
     62    * this content within the message structure. 
     63    *  
     64    * @return the message part 
     65    */ 
     66    public ContentPart getMessagePart() { 
     67        return this.messagePart; 
     68    } 
     69 
    7070    /** 
    7171     * Accept a visitor on this message content. 
    7272     * @param visitor The visitor instance 
    7373     */ 
    74         public abstract void accept(MimeMessageContentVisitor visitor); 
    75          
    76         /** 
    77          * Gets the raw data representing this message content. 
    78          * Necessary for saving the content to a file, or 
    79          * transmitting it to external systems. 
    80          *  
    81          * @return Raw data if available, or null otherwise 
    82          */ 
    83         public abstract byte[] getRawData(); 
     74    public abstract void accept(MimeMessageContentVisitor visitor); 
    8475 
    85         /** 
    86          * Populates the message content object from raw data. 
    87          * Necessary for recreating the object from a serialized 
    88          * form. 
    89          *  
    90          * @param rawData Raw data for the message content 
    91          */ 
    92         protected abstract void putRawData(byte[] rawData); 
    93          
    94         /* (non-Javadoc) 
    95          * @see org.logicprobe.LogicMail.util.Serializable#getUniqueId() 
    96          */ 
    97         public long getUniqueId() { 
    98                 return this.uniqueId; 
    99         } 
     76    /** 
     77     * Gets the raw data representing this message content. 
     78     * Necessary for saving the content to a file, or 
     79     * transmitting it to external systems. 
     80     *  
     81     * @return Raw data if available, or null otherwise 
     82     */ 
     83    public abstract byte[] getRawData(); 
    10084 
    101         /* (non-Javadoc) 
    102          * @see org.logicprobe.LogicMail.util.Serializable#serialize(java.io.DataOutput) 
    103          */ 
    104         public void serialize(DataOutput output) throws IOException { 
    105                 output.writeLong(uniqueId); 
    106                 SerializationUtils.serializeClass(messagePart, output); 
    107                 byte[] data = getRawData(); 
    108                 output.writeInt(data.length); 
    109                 output.write(data); 
    110         } 
    111          
    112         /* (non-Javadoc) 
    113          * @see org.logicprobe.LogicMail.util.Serializable#deserialize(java.io.DataInput) 
    114          */ 
    115         public void deserialize(DataInput input) throws IOException { 
    116                 uniqueId = input.readLong(); 
    117                 messagePart = (ContentPart)SerializationUtils.deserializeClass(input); 
    118                 int len = input.readInt(); 
    119                 byte[] data = new byte[len]; 
    120                 input.readFully(data, 0, len); 
    121                 putRawData(data); 
    122         } 
     85    /** 
     86     * Populates the message content object from raw data. 
     87     * Necessary for recreating the object from a serialized 
     88     * form. 
     89     *  
     90     * @param rawData Raw data for the message content 
     91     */ 
     92    protected abstract void putRawData(byte[] rawData); 
    12393 
    124         /* (non-Javadoc) 
    125          * @see java.lang.Object#hashCode() 
    126          */ 
    127         public int hashCode() { 
    128                 final int prime = 31; 
    129                 int result = 1; 
    130                 result = prime * result + (int) (uniqueId ^ (uniqueId >>> 32)); 
    131                 return result; 
    132         } 
     94    /* (non-Javadoc) 
     95     * @see org.logicprobe.LogicMail.util.Serializable#getUniqueId() 
     96     */ 
     97    public long getUniqueId() { 
     98        return this.uniqueId; 
     99    } 
    133100 
    134         /* (non-Javadoc) 
    135          * @see java.lang.Object#equals(java.lang.Object) 
    136          */ 
    137         public boolean equals(Object obj) { 
    138                 if (this == obj) 
    139                         return true; 
    140                 if (obj == null) 
    141                         return false; 
    142                 if (getClass() != obj.getClass()) 
    143                         return false; 
    144                 MimeMessageContent other = (MimeMessageContent) obj; 
    145                 if (uniqueId != other.uniqueId) 
    146                         return false; 
    147                 return true; 
    148         } 
     101    /* (non-Javadoc) 
     102     * @see org.logicprobe.LogicMail.util.Serializable#serialize(java.io.DataOutput) 
     103     */ 
     104    public void serialize(DataOutput output) throws IOException { 
     105        output.writeLong(uniqueId); 
     106        SerializationUtils.serializeClass(messagePart, output); 
     107        byte[] data = getRawData(); 
     108        output.writeInt(data.length); 
     109        output.write(data); 
     110    } 
     111 
     112    /* (non-Javadoc) 
     113     * @see org.logicprobe.LogicMail.util.Serializable#deserialize(java.io.DataInput) 
     114     */ 
     115    public void deserialize(DataInput input) throws IOException { 
     116        uniqueId = input.readLong(); 
     117        messagePart = (ContentPart)SerializationUtils.deserializeClass(input); 
     118        int len = input.readInt(); 
     119        byte[] data = new byte[len]; 
     120        input.readFully(data, 0, len); 
     121        putRawData(data); 
     122    } 
     123 
     124    /* (non-Javadoc) 
     125     * @see java.lang.Object#hashCode() 
     126     */ 
     127    public int hashCode() { 
     128        int prime = 31; 
     129        int result = 1; 
     130        result = prime * result + (int) (uniqueId ^ (uniqueId >>> 32)); 
     131        return result; 
     132    } 
     133 
     134    /* (non-Javadoc) 
     135     * @see java.lang.Object#equals(java.lang.Object) 
     136     */ 
     137    public boolean equals(Object obj) { 
     138        if (this == obj) 
     139            return true; 
     140        if (obj == null) 
     141            return false; 
     142        if (getClass() != obj.getClass()) 
     143            return false; 
     144        MimeMessageContent other = (MimeMessageContent) obj; 
     145        if (uniqueId != other.uniqueId) 
     146            return false; 
     147        return true; 
     148    } 
    149149} 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/message/MimeMessagePart.java

    r532 r551  
    6565     */ 
    6666    public abstract void accept(MimeMessagePartVisitor visitor); 
    67      
     67 
    6868    /** 
    6969     * Gets the tag used to embed protocol-specific address 
     
    7373     */ 
    7474    public String getTag() { 
    75         return tag; 
     75        return tag; 
    7676    } 
    77      
     77 
    7878    /** 
    7979     * Get the MIME type for this part 
     
    9797     */ 
    9898    public int getSize() { 
    99         return size; 
     99        return size; 
    100100    } 
    101      
     101 
    102102    /** 
    103103     * Set the parent of this part 
     
    107107        this.parent = parent; 
    108108    } 
    109      
     109 
    110110    /** 
    111111     * Get the parent of this part 
     
    117117 
    118118    /* (non-Javadoc) 
    119         * @see org.logicprobe.LogicMail.util.Serializable#getUniqueId() 
    120         */ 
    121         public long getUniqueId() { 
    122                 return this.uniqueId; 
    123         } 
     119    * @see org.logicprobe.LogicMail.util.Serializable#getUniqueId() 
     120    */ 
     121    public long getUniqueId() { 
     122        return this.uniqueId; 
     123    } 
    124124 
    125         /* (non-Javadoc) 
    126          * @see org.logicprobe.LogicMail.util.Serializable#serialize(java.io.DataOutput) 
    127          */ 
    128         public void serialize(DataOutput output) throws IOException { 
    129                 output.writeLong(uniqueId); 
    130                 output.writeUTF(tag); 
    131                 output.writeUTF(mimeType); 
    132                 output.writeUTF(mimeSubtype); 
    133                 output.writeInt(size); 
    134         } 
    135          
    136         /* (non-Javadoc) 
    137          * @see org.logicprobe.LogicMail.util.Serializable#deserialize(java.io.DataInput) 
    138          */ 
    139         public void deserialize(DataInput input) throws IOException { 
    140                 uniqueId = input.readLong(); 
    141                 tag = input.readUTF(); 
    142                 mimeType = input.readUTF(); 
    143                 mimeSubtype = input.readUTF(); 
    144                 size = input.readInt(); 
    145         } 
     125    /* (non-Javadoc) 
     126     * @see org.logicprobe.LogicMail.util.Serializable#serialize(java.io.DataOutput) 
     127     */ 
     128    public void serialize(DataOutput output) throws IOException { 
     129        output.writeLong(uniqueId); 
     130        output.writeUTF(tag); 
     131        output.writeUTF(mimeType); 
     132        output.writeUTF(mimeSubtype); 
     133        output.writeInt(size); 
     134    } 
    146135 
    147         /* (non-Javadoc) 
    148          * @see java.lang.Object#hashCode() 
    149          */ 
    150         public int hashCode() { 
    151                 final int prime = 31; 
    152                 int result = 1; 
    153                 result = prime * result + (int) (uniqueId ^ (uniqueId >>> 32)); 
    154                 return result; 
    155         } 
     136    /* (non-Javadoc) 
     137     * @see org.logicprobe.LogicMail.util.Serializable#deserialize(java.io.DataInput) 
     138     */ 
     139    public void deserialize(DataInput input) throws IOException { 
     140        uniqueId = input.readLong(); 
     141        tag = input.readUTF(); 
     142        mimeType = input.readUTF(); 
     143        mimeSubtype = input.readUTF(); 
     144        size = input.readInt(); 
     145    } 
    156146 
    157         /* (non-Javadoc) 
    158          * @see java.lang.Object#equals(java.lang.Object) 
    159          */ 
    160         public boolean equals(Object obj) { 
    161                 if (this == obj) 
    162                         return true; 
    163                 if (obj == null) 
    164                         return false; 
    165                 if (getClass() != obj.getClass()) 
    166                         return false; 
    167                 MimeMessagePart other = (MimeMessagePart) obj; 
    168                 if (uniqueId != other.uniqueId) 
    169                         return false; 
    170                 return true; 
    171         } 
     147    /* (non-Javadoc) 
     148     * @see java.lang.Object#hashCode() 
     149     */ 
     150    public int hashCode() { 
     151        int prime = 31; 
     152        int result = 1; 
     153        result = prime * result + (int) (uniqueId ^ (uniqueId >>> 32)); 
     154        return result; 
     155    } 
     156 
     157    /* (non-Javadoc) 
     158     * @see java.lang.Object#equals(java.lang.Object) 
     159     */ 
     160    public boolean equals(Object obj) { 
     161        if (this == obj) 
     162            return true; 
     163        if (obj == null) 
     164            return false; 
     165        if (getClass() != obj.getClass()) 
     166            return false; 
     167        MimeMessagePart other = (MimeMessagePart) obj; 
     168        if (uniqueId != other.uniqueId) 
     169            return false; 
     170        return true; 
     171    } 
    172172} 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/model/OutboxMailboxNode.java

    r529 r551  
    215215        } 
    216216         
    217         public int getMessageId() { 
    218                 return messageId; 
    219         } 
    220          
    221                 public boolean containedWithin(FolderTreeItem folderTreeItem) { 
    222                         return folderTreeItem.getPath().equals(folderPath); 
    223                 } 
    224  
    225                 public String getMessageUid() { 
    226                         return Integer.toHexString(messageId).toLowerCase(); 
    227                 } 
    228                  
    229                 public long getUniqueId() { 
    230                         // Empty because this special token is not intended to be serialized 
    231                         return 0; 
    232                 } 
    233  
    234                 public void serialize(DataOutput output) throws IOException { 
    235                         // Empty because this special token is not intended to be serialized 
    236                 } 
    237          
    238                 public void deserialize(DataInput input) throws IOException { 
    239                         // Empty because this special token is not intended to be serialized 
    240                 } 
     217        public boolean containedWithin(FolderTreeItem folderTreeItem) { 
     218            return folderTreeItem.getPath().equals(folderPath); 
     219        } 
     220     
     221        public String getMessageUid() { 
     222            return Integer.toHexString(messageId).toLowerCase(); 
     223        } 
     224                 
     225        public long getUniqueId() { 
     226            // Empty because this special token is not intended to be serialized 
     227            return 0; 
     228        } 
     229     
     230        public void serialize(DataOutput output) throws IOException { 
     231            // Empty because this special token is not intended to be serialized 
     232        } 
     233                 
     234        public void deserialize(DataInput input) throws IOException { 
     235            // Empty because this special token is not intended to be serialized 
     236        } 
    241237    } 
    242238} 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/MailboxScreen.java

    r549 r551  
    5454import org.logicprobe.LogicMail.model.MessageNodeEvent; 
    5555import org.logicprobe.LogicMail.model.MessageNodeListener; 
    56 import org.logicprobe.LogicMail.ui.ScreenProvider.ShortcutItem; 
    5756import org.logicprobe.LogicMail.util.EventObjectRunnable; 
    5857 
  • trunk/LogicMailTests/src/org/logicprobe/LogicMail/mail/NetworkMailStoreTest.java

    r538 r551  
    324324                public FolderTreeItem activeFolder; 
    325325                public FolderTreeItem inboxFolder; 
    326                 public int firstIndex; 
    327                 public int lastIndex; 
    328326                public FolderMessage[] folderMessages; 
    329327                public FolderTreeItem folderTree; 
    330328                public Message message; 
    331329                public MessageToken messageToken; 
    332                 public MessageFlags messageFlags; 
    333330                public int refreshedMsgCount; 
    334331                 
     
    348345                public FolderTreeItem getActiveFolder() { return activeFolder; } 
    349346                public FolderMessage[] getFolderMessages(int firstIndex, int lastIndex, MailProgressHandler progressHandler) 
    350                                 throws IOException, MailException { this.firstIndex = firstIndex; this.lastIndex = lastIndex; return this.folderMessages; } 
     347                                throws IOException, MailException { return this.folderMessages; } 
    351348                public FolderMessage[] getFolderMessages(MessageToken[] messageTokens, MailProgressHandler progressHandler) 
    352349                                throws IOException, MailException { return null; } 
  • trunk/LogicMailTests/src/org/logicprobe/LogicMail/model/AccountNodeTest.java

    r538 r551  
    207207        public FolderTreeItem rootFolder = null; 
    208208        public FolderTreeItem statusUpdatedRootFolder = null; 
    209         public boolean folderTreeRequested = false; 
    210         public boolean folderStatusRequested = false; 
    211         public FolderTreeItem folderStatusRequestedItem = null; 
    212209         
    213210                public boolean hasFlags() { 
     
    240237 
    241238                public void requestFolderTree() { 
    242                         folderTreeRequested = true; 
    243239                        fireFolderTreeUpdated(rootFolder); 
    244240                } 
    245241                 
    246242                public void requestFolderStatus(FolderTreeItem[] folders) { 
    247                         folderStatusRequested = true; 
    248                         folderStatusRequestedItem = folders[0]; 
    249243                        fireFolderStatusChanged(statusUpdatedRootFolder); 
    250244                } 
Note: See TracChangeset for help on using the changeset viewer.