Closed Bug 257386 Opened 20 years ago Closed 19 years ago

Poorly written code in nsImapMailFolder.cpp

Categories

(MailNews Core :: Networking: IMAP, defect)

defect
Not set
trivial

Tracking

(Not tracked)

VERIFIED FIXED
Future

People

(Reporter: csthomas, Assigned: csthomas)

References

()

Details

Attachments

(1 file, 5 obsolete files)

Attachment #157373 - Flags: superreview?(shaver)
Attachment #157373 - Flags: review?(ere)
Status: NEW → ASSIGNED
Comment on attachment 157373 [details] [diff] [review]
Make code nicer

Why not clean up the usage of rv while at it?
Attached patch Patch v2 (obsolete) — Splinter Review
Attachment #157373 - Attachment is obsolete: true
Attachment #157373 - Flags: superreview?(shaver)
Attachment #157373 - Flags: review?(ere)
Attachment #157728 - Flags: superreview?(shaver)
Attachment #157728 - Flags: review?(ere)
Attachment #157728 - Attachment is obsolete: true
Attachment #157728 - Flags: superreview?(shaver)
Attachment #157728 - Flags: review?(ere)
we want to return openErr. That's what really indicates the success or failure
of opening the db...
I was actually asking about the line:
rv = (*folderInfo)->SetProperty("onlineName", autoOnlineName);

Do we care about rv?  The current code ignores it.
Attachment #157893 - Attachment is obsolete: true
Attachment #157895 - Attachment is obsolete: true
Attached patch Patch v3.2 (obsolete) — Splinter Review
<biesi-away> that could deal with some vertical whitespace
<biesi-away> s/deal with/use/
Attachment #157897 - Flags: superreview?(shaver)
Attachment #157897 - Flags: review?(ere)
Comment on attachment 157897 [details] [diff] [review]
Patch v3.2

> +  if(!db || !folderInfo || !mDatabase)

You can't check mDatabase before you have called OpenDatabase().

> +  if (NS_FAILED((*folderInfo)->GetCharPtrProperty("onlineName", getter_Copies(onlineName))))
> +      return NS_ERROR_UNEXPECTED;

Could we return the real error code that GetCharPtrProperty returned?
Attachment #157897 - Flags: superreview?(shaver)
Attachment #157897 - Flags: review?(ere)
Attachment #157897 - Flags: review-
Attached patch Patch v4Splinter Review
Attachment #157897 - Attachment is obsolete: true
Attachment #157979 - Flags: superreview?(shaver)
Attachment #157979 - Flags: review?(ere)
Attachment #157979 - Flags: review?(ere) → review+
Flags: blocking1.8a4?
Flags: blocking1.8a4? → blocking1.8a4-
Attachment #157979 - Flags: superreview?(shaver) → superreview?(bienvenu)
Product: MailNews → Core
Attachment #157979 - Flags: superreview?(bienvenu) → superreview?(neil.parkwaycc.co.uk)
Status: ASSIGNED → NEW
Target Milestone: --- → Future
Whiteboard: r? → sr?
Comment on attachment 157979 [details] [diff] [review]
Patch v4

>+  rv = (*folderInfo)->GetCharPtrProperty("onlineName", getter_Copies(onlineName));
>+  NS_ENSURE_SUCCESS(rv, rv);
Nit: don't use this, use
if (NS_FAILED(rv))
  return rv;
Attachment #157979 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Unrotted and checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: sr?
Verified FIXED via code inspection (LXR).
Status: RESOLVED → VERIFIED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: