Issue Details (XML | Word | Printable)

Key: NET-75
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Andrew Paterson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

Uninitialised variable in FTPClient

Created: 18/Dec/03 06:11 PM   Updated: 20/Sep/07 05:31 AM
Return to search
Component/s: None
Affects Version/s: 1.1
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: other
Platform: Other

Bugzilla Id: 25620


 Description  « Hide
When NetComponents became commons-net, a new variable __restartOffset was added in FTPClient.java. Although there is a new "setter" method, there is no explicit initialisation of this variable in the constructor. It may be that Java automatically initialises instance variables to zero (I am more familiar with C++ in this regard) but I feel that it would be better to do this explicitly, especially as all of the other variables are explicitly initialised.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Daniel Savarese added a comment - 23/Dec/03 06:12 AM
Good catch. I just fixed it by explicitly assigned to __restartOffset a
value of zero in __initDefaults(). It's actually more than just a generally
good thing to do. Without initializing the variable in __initDefaults(),
__restsartOffset is not reset the various times __initDefaults() is called
(e.g., reinitialize(), connect()), so values will persist between
connections and in other situations where it should be reset.