This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 64400 - FeedReader Code Must Be Checked
Summary: FeedReader Code Must Be Checked
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-15 08:50 UTC by Geertjan Wielenga
Modified: 2005-11-19 01:14 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff of changes (21.98 KB, patch)
2005-11-19 01:14 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geertjan Wielenga 2005-09-15 08:50:04 UTC
Now that the FeedReader sources are available in trunk, a developer needs to go
through it VERY carefully and make sure that the code is 100% correct. There've
been various comments on dev@apisupport about parts of the code that are not
quite right, for example:

(1) Closing of streams (i.e, do str.close() after str.writeObject(f) in the
RssNode.AddRssAction). This was suggested by Rich in the finally block:

finally {
 if (lock != null)
   lock.releaseLock();
 if (str != null)
   str.close();
} 

2. Cleaning of Window Component template will lead to changes in FeedReader. For
example, someone pointed out that the following variables are not used:

private RequestProcessor.Task nodeSetterTask;
private final Object NODE_SETTER_LOCK = new Object(); 

3. Some of the comments by Rich in his code indicate that the code being
commented is not quite complete. For example, one comment is "//Should never
happen - no reason for it to fail above" and Jesse, in the mailing list, says
that an assertion should be used here.

} catch (IntrospectionException e) {
    throw new AssertionError(e);
} 

4. Jesse also wrote that this is unsafe and that XMLUtil.toElementContent or 
return new Node[0] should be used instead:

return "<font color='red'>" + ex.getMessage() + "</font>";

<b>The bottom line is that even though I could try and tweak the code myself,
that would not be a good idea at all. I am not a developer. A developer needs to
go through everything in this sample, before Beta preferably, to make sure that
everything is exactly how we want users to code this application.</b>
Comment 1 Geertjan Wielenga 2005-09-15 08:53:57 UTC
One more thing: Please DIFF all/any changes to FeedReader code and send those
diffs to me -- we must remember to keep the tutorial and the sources synchronized.
Comment 2 Milos Kleint 2005-09-15 08:58:51 UTC
number 2. is fixed already.
Comment 3 Marian Mirilovic 2005-09-23 10:25:57 UTC
Agreed with Honza and Peter, this is no more stopper for Beta.
Comment 4 Geertjan Wielenga 2005-09-23 14:30:16 UTC
Agreed with Honza, this should definitely be done for FCS, but not for Beta. But
I'll do number 2 for Beta.

Downgrading to P2.
Comment 5 Milos Kleint 2005-10-27 10:44:49 UTC
i'll check this
Comment 6 Milos Kleint 2005-10-27 12:05:23 UTC
items 1,2 and 4 done.

number 3 I didn't understand.

Apart from that, the code in feedreader seemed reasonable to me. But I'm not an
expert on normative, correct code. 

close the issue or reasign back to Jesse?


Checking in
samples/feedreader-suite/FeedReader/src/org/myorg/feedreader/RssNode.java;
/cvs/apisupport/samples/feedreader-suite/FeedReader/src/org/myorg/feedreader/RssNode.java,v
 <--  RssNode.java
new revision: 1.2; previous revision: 1.1
done
Comment 7 Jesse Glick 2005-10-27 19:47:13 UTC
I will handle #3 (at least in this case), change handling of #4, and go through
other stuff.
Comment 8 Jesse Glick 2005-10-27 21:07:43 UTC
committed     Up-To-Date  1.3        
apisupport/samples/feedreader-suite/FeedReader/src/org/myorg/feedreader/RssNode.java
Comment 9 Jesse Glick 2005-11-19 01:13:45 UTC
Various bug fixes, cleanups, simplifications, and stylistic edits too numerous
to list individually.

committed   * Up-To-Date  1.2        
apisupport/samples/feedreader-suite/FeedReader/src/org/myorg/feedreader/Bundle.properties
committed   * Up-To-Date  1.2        
apisupport/samples/feedreader-suite/FeedReader/src/org/myorg/feedreader/Feed.java
committed   * Up-To-Date  1.2        
apisupport/samples/feedreader-suite/FeedReader/src/org/myorg/feedreader/FeedAction.java
committed   * Up-To-Date  1.3        
apisupport/samples/feedreader-suite/FeedReader/src/org/myorg/feedreader/FeedTopComponent.java
committed   * Up-To-Date  1.4        
apisupport/samples/feedreader-suite/FeedReader/src/org/myorg/feedreader/RssNode.java
committed   * Up-To-Date  1.2        
apisupport/samples/feedreader-suite/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties
committed   * Up-To-Date  1.3        
apisupport/samples/feedreader-suite/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/resources/layer.xml
committed   * Up-To-Date  1.4        
apisupport/samples/feedreader-suite/nbproject/project.properties
Comment 10 Jesse Glick 2005-11-19 01:14:21 UTC
Created attachment 27060 [details]
Diff of changes