Closed Bug 307150 Opened 19 years ago Closed 19 years ago

Incomplete implementation of javax.mail.Message in grendel.storage.MessageReadOnly

Categories

(Grendel Graveyard :: Protocols, defect, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kieran.maclean, Assigned: kieran.maclean)

References

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6
Build Identifier: 

The implementation of javax.mail.Message in grendel.storage.MessageReadOnly is
incomplete it lacks functionality that is required for the use of it as JavaMail
Message.

The methods:
public Enumeration getAllHeaders();
public Message reply(boolean replyToAll);
are the most important as the first is used to render the message, and the
second to reply to a message both operations are needed by Grendel users.

Reproducible: Always

Steps to Reproduce:
Priority: -- → P1
Assignee: rlkeller → kieran
This patch completes the implementation of grendel.storage.MessageReadOnly.
It also fixes a bug with the detection of the content type of a message.
Attachment #195083 - Flags: review?(kieran)
Comment on attachment 195083 [details] [diff] [review]
Patch to complete the implementation

Wrong reveiwer, sorry
Attachment #195083 - Flags: review?(kieran) → review?(rlkeller)
Comment on attachment 195083 [details] [diff] [review]
Patch to complete the implementation

>          references = internReferences(id_table, value.trim());
>        }
>      }
> +        base_headers = h;
>    }


bad indentation


> +      String type = "text/plain";  //XXX lie to it...
> +            String[] content_types = getHeader("Content-Type");
> +            if ((content_types!=null)&&(content_types.length>0)) {
> +                type = content_types[0];
> +            } 
> +            data_handler = new DataHandler(getContentAsString(),type);
> +        }
> +        return data_handler;

You have an uncessary level of indentation here.

>    protected InternetHeaders getHeadersObj() throws MessagingException {
> +        if (full_headers==null) {
> +            try {
>      InputStream is=getInputStreamWithHeaders();
> -    InternetHeaders ih=new InternetHeaders(is);
> +                full_headers=new InternetHeaders(is);
>      try { is.close(); } catch(Exception e) {e.printStackTrace();}
> -    return ih;
> +            } catch (IOException ioe) {
> +                if (session.getDebug()) {
> +                    ioe.printStackTrace();
> +                }

inconsistent indentation

> +  public abstract InputStream getInputStreamWithHeaders() throws MessagingException, IOException; /*{
> +                                                                                                   

Kieran, just delete the code please :). This is so confusing for people reading
the code.

> +     if (! urlName.getHost().equalsIgnoreCase(url.getHost())) throw new MessagingException("Not the same host.");
> +     if (urlName.getPort() != url.getPort()) throw new MessagingException("Not the same port.");
> +     String file = urlName.getFile();
> +     if (file.contains("/")) throw new MessagingException("Invalid URL.");

This is a bit hard to read. Move the "throw" statements to the next line.
Attachment #195083 - Flags: review?(rlkeller) → review-
This patch completes the implementation of grendel.storage.MessageReadOnly,
with the source formatting corrected.
It also fixes a bug with the detection of the content type of a message.

Some sections of the code look incorrectly formatted, however the indentation
is correct in the source file but the diff ignores whitespace so it puts the
old indentation in the diff.
Attachment #195118 - Flags: review?(rlkeller)
This patch completes the implementation of grendel.storage.MessageReadOnly,
with the source formatting corrected.
This patch also has serveral whitespace changes included in it as well.
It also fixes a bug with the detection of the content type of a message.
Attachment #195136 - Flags: review?(rlkeller)
Blocks: 304954
Arranging bug dependences and assignments for code patches.
No longer blocks: 304954
Status: NEW → ASSIGNED
Blocks: 304954
Comment on attachment 195136 [details] [diff] [review]
Patch to complete the implementation (+ws changes)

looks good! r=rj.keller@beonex.com.

Sorry for the delay.
Attachment #195136 - Flags: review?(rlkeller) → review+
Attachment #195118 - Flags: review?(rlkeller)
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: