From: Jeff W. <jww...@ya...> - 2005-02-24 16:40:14
|
--- Joe Emenaker <jo...@em...> wrote: > Date: Thu, 24 Feb 2005 03:01:42 +0000 > From: Joe Emenaker <jo...@em...> > To: Jeff Weber <jww...@ya...> > Subject: Overriding calculateChecksum > > I came across this in your DM5 drivers.... > > /** Calculates the checksum for the DM5 by calling > * this.calculateChecksum(Patch patch, int start, int end, int offset). This > * needs to be included to override the version in the Driver class. > */ > protected void calculateChecksum(Patch p) { > calculateChecksum(p, checksumStart, checksumEnd, checksumOffset); > } > > Actually, I don't think you have to include this. If > you delete it, the > /un-overridden/ *calculateChecksum(Patch)* in Driver > should /still/ call > your /overridden/ version of > *calculateChecksum(Patch,int,int,int). > > One of the nice things about inheritance..... > Funny you should mention this. I was reviewing my code and came across this just last week and I thought the same thing. When I removed it I found that it actually does not call the overridden method. It calls the method in the Driver class. I used a debugger to confirm it. I don't understand why this happens. Maybe it's just something flakey with my system (OSX). __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |