mpetazzoni / ttorrent

BitTorrent Java library with tracker and download client
http://mpetazzoni.github.com/ttorrent/
Apache License 2.0
1.38k stars 502 forks source link

Pleeease declare constructors, methods and fields as protected instead of private. :( #114

Open preston opened 9 years ago

preston commented 9 years ago

I have a few minor modifications I need to make to HTTPAnnouncementRequest, HTTPTrackerClient etc for my specific project. Unfortunately, many of these classes make heavy use of private declarations that effectively make them final. That is, cleanly building customizations on top of torrent is project pretty much impossible. Please please pleeeeeease change these declarations to allow things to be easily subclass-able!

For example:

mpetazzoni commented 9 years ago

Composition vs inheritance? Can you achieve what you're looking for through composition instead?

preston commented 9 years ago

Unfortunately not as-is, since a number of the more important methods are a bit large.

preston commented 9 years ago

@mpetazzoni Would you accept a PR if I did some non-functional refactoring to break out a few methods and change some private declarations to protected?

mpetazzoni commented 9 years ago

Sure, send away

preston commented 9 years ago

Done! PR submitted as #115.