[tor-bugs] #17000 [metrics-lib]: Allow to distinguish between relay and bridge descriptors
    Tor Bug Tracker & Wiki 
    blackhole at torproject.org
       
    Thu Sep 10 08:23:04 UTC 2015
    
    
  
#17000: Allow to distinguish between relay and bridge descriptors
-----------------------------+--------------------------
     Reporter:  karsten      |      Owner:  karsten
         Type:  enhancement  |     Status:  needs_review
     Priority:  normal       |  Milestone:
    Component:  metrics-lib  |    Version:
   Resolution:               |   Keywords:
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+--------------------------
Comment (by iwakeh):
 I agree with atargar's comment above.
 In general it looks good, but there is some code duplication.
 Was there a reason not to just extend {{{ServerDescriptor}}}
 with methods like {{{isRelay()}}},  {{{isBridge()}}}?
 In order to avoid repeated interfaces and classes for bridges and
 relays in addition to the slimmed down hierarchy (as suggested by atargar)
 generics could be used. Thus, one could probably also
 reduce the number of existing classes and interfaces.
 As an example for what I'm aiming at:
 {{{
   protected static <S extends Server> List<ServerDescriptorBase<S>>
       parseDescriptors(Class<S> clazz, byte[] descriptorsBytes,
           boolean failUnrecognizedDescriptorLines)
       throws DescriptorParseException
 }}}
 for the parseDescriptor method.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17000#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
    
    
More information about the tor-bugs
mailing list