I think I'd have to hear from everyone else before I'd be willing to break compatability.  Your point on generics is well made, except that with erasure, libraries should still work with older code.  Changing a public method signature in a non-backwards compatible manner is a scary thing for any project - best to avoid, unless it's absolutely necessary.
 
BTW - I haven't dug into it, but I'm pretty sure that making HTree implement Map would not be a breaking change...
 
- K
 
----------------------- Original Message -----------------------
  
From: Chas Emerick <[email protected]>
To: Kevin Day <[email protected]>
Cc: JDBM General listserv <[email protected]>
Date: Thu, 27 Aug 2009 15:53:52 -0400
Subject: Re: [Jdbm-general] Why FastIterator?
  
Is backwards compatibility a concern?  The shift to generics was certainly a breaking change....and really, I'd be surprised if anyone complained about pre-1.2 code being brought into alignment with modern idioms, etc.

Honestly, I'd love to see HTree implement java.util.Map -- which would obviously be a breaking change, but result in a huge improvement in the interoperability of the library in general.

Yes, I believe FastIterator could extend Iterator, if retaining API compatibility is important enough.

- Chas

On Aug 27, 2009, at 3:20 PM, Kevin Day wrote:

I'm pretty sure that the code in question does predate 1.2.  Given the recent shift in the code base to use generics, I certainly don't see any issue with a refactoring on this.  The challenge will be how to do it in a way that doesn't break backwards compatability.  You may, for example, need to introduce a keysIterator() method instead of changing the return type of keys().
 
Another option, which may be cleaner, would be to make FastIterator extend Iterator (if that's possible)...
 
I'd certainly welcome such a patch (and everyone else is pretty quiet these days, so that makes a quorum!)
 
- K
 
----------------------- Original Message -----------------------
  
From: Chas Emerick <[email protected]>
Cc: 
Date: Thu, 27 Aug 2009 12:42:54 -0400
Subject: [Jdbm-general] Why FastIterator?
  
Is there a reason why jdbm defines the FastIterator class, rather than  
simply using the standard Iterator interface?

I'd be happy to prepare a patch that would eliminated FastIterator,  
replacing its usage with Iterator, and properly implementing hasNext.   
This would only impact HashDirectory as far as I can tell, but would  
help eliminate what appears to be a wart (IMO) in the library.  (Maybe  
jdbm predates Java 1.2, so Iterator wasn't available?)

Would such a patch be welcome?

Thanks,

- Chas

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jdbm-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdbm-general

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july_______________________________________________
Jdbm-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdbm-general

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
Jdbm-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdbm-general


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jdbm-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdbm-general

Reply via email to