#22695: descriptor file processing ---------------------------------+----------------------------------- Reporter: iwakeh | Owner: metrics-team Type: defect | Status: new Priority: High | Milestone: metrics-lib 2.0.0 Component: Metrics/metrics-lib | Version: Severity: Normal | Resolution: Keywords: | Actual Points: Parent ID: | Points: Reviewer: | Sponsor: ---------------------------------+----------------------------------- Description changed by iwakeh:
Old description: > In 1.9.0 a new method `getDescrptorFile` was introduced. This actually > can cause various problems and has some open design questions that should > be answered in this ticket. > (I'll attach a branch with a test demonstration part of the problem.) > > `DescriptorParser` has the new method (since 1.9.0): > > {{{ > public Iterable<Descriptor> parseDescriptors(byte[] rawDescriptorBytes, > File descriptorFile, String fileName); > }}} > > In addition to the problem demonstrated in the (to be attached) test this > raises some questions: > > 1) What should be done, if `descriptorFile.getName() != fileName`? > 2) What should be done, if `descriptorFile != null && (null == fileName > || fileName.isEmpty())`? > 3) What should be done, if `descriptorFile == null && null != fileName`? > 4a) What should be done, if `descriptorFile == null && null != fileName > && fileName.isEmpty()`? > 4b) What should be done, if `descriptorFile == null && null == fileName`? New description: In 1.9.0 a new method `getDescrptorFile` was introduced. This actually can cause various problems and has some open design questions that should be answered in this ticket. (I'll attach a branch with a test demonstrating part of the problem.) `DescriptorParser` has the new method (since 1.9.0): {{{ public Iterable<Descriptor> parseDescriptors(byte[] rawDescriptorBytes, File descriptorFile, String fileName); }}} In addition to the problem demonstrated in the (to be attached) test this raises some questions: 1) What should be done, if `descriptorFile.getName() != fileName`? 2) What should be done, if `descriptorFile != null && (null == fileName || fileName.isEmpty())`? 3) What should be done, if `descriptorFile == null && null != fileName`? 4a) What should be done, if `descriptorFile == null && null != fileName && fileName.isEmpty()`? 4b) What should be done, if `descriptorFile == null && null == fileName`? The implementation of the solution should also have tests for each of the possible cases. -- -- Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22695#comment:3> Tor Bug Tracker & Wiki <https://trac.torproject.org/> The Tor Project: anonymity online _______________________________________________ tor-bugs mailing list tor-bugs@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs