Loading src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java +3 −3 Original line number Diff line number Diff line Loading @@ -852,7 +852,7 @@ public interface ExtraInfoDescriptor extends Descriptor { * * @since 1.1.0 */ Double getHidservRendRelayedCells(); long getHidservRendRelayedCells(); /** * Get the obfuscation parameters applied to the original Loading Loading @@ -918,7 +918,7 @@ public interface ExtraInfoDescriptor extends Descriptor { * * @since 2.15.0 */ Double getHidservRendV3RelayedCells(); long getHidservRendV3RelayedCells(); /** * Get the obfuscation parameters applied to the original measurement value Loading @@ -941,7 +941,7 @@ public interface ExtraInfoDescriptor extends Descriptor { * * @since 2.15.0 */ Double getHidservDirV3OnionsSeen(); long getHidservDirV3OnionsSeen(); /** * Get the obfuscation parameters applied to the original measurement value Loading src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java +9 −9 Original line number Diff line number Diff line Loading @@ -833,7 +833,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl throw new DescriptorParseException("Illegal line '" + line + "'."); } try { this.hidservRendRelayedCells = Double.parseDouble(partsNoOpt[1]); this.hidservRendRelayedCells = Long.parseLong(partsNoOpt[1]); } catch (NumberFormatException e) { throw new DescriptorParseException("Illegal line '" + line + "'."); } Loading Loading @@ -873,7 +873,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl throw new DescriptorParseException("Illegal line '" + line + "'."); } try { this.hidservRendV3RelayedCells = Double.parseDouble(partsNoOpt[1]); this.hidservRendV3RelayedCells = Long.parseLong(partsNoOpt[1]); } catch (NumberFormatException e) { throw new DescriptorParseException("Illegal line '" + line + "'."); } Loading @@ -889,7 +889,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl throw new DescriptorParseException("Illegal line '" + line + "'."); } try { this.hidservDirV3OnionsSeen = Double.parseDouble(partsNoOpt[1]); this.hidservDirV3OnionsSeen = Long.parseLong(partsNoOpt[1]); } catch (NumberFormatException e) { throw new DescriptorParseException("Illegal line '" + line + "'."); } Loading Loading @@ -1479,10 +1479,10 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl return this.hidservStatsIntervalLength; } private Double hidservRendRelayedCells; private long hidservRendRelayedCells; @Override public Double getHidservRendRelayedCells() { public long getHidservRendRelayedCells() { return this.hidservRendRelayedCells; } Loading Loading @@ -1523,10 +1523,10 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl return this.hidservV3StatsIntervalLength; } private Double hidservRendV3RelayedCells; private long hidservRendV3RelayedCells; @Override public Double getHidservRendV3RelayedCells() { public long getHidservRendV3RelayedCells() { return this.hidservRendV3RelayedCells; } Loading @@ -1538,10 +1538,10 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl : new HashMap<>(this.hidservRendV3RelayedCellsParameters); } private Double hidservDirV3OnionsSeen; private long hidservDirV3OnionsSeen; @Override public Double getHidservDirV3OnionsSeen() { public long getHidservDirV3OnionsSeen() { return this.hidservDirV3OnionsSeen; } Loading src/test/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImplTest.java +4 −5 Original line number Diff line number Diff line Loading @@ -2209,8 +2209,7 @@ public class ExtraInfoDescriptorImplTest { .createWithDefaultLines(); assertEquals(1449152816000L, descriptor.getHidservStatsEndMillis()); assertEquals(86400L, descriptor.getHidservStatsIntervalLength()); assertEquals(36474281.0, descriptor.getHidservRendRelayedCells(), 0.0001); assertEquals(36474281, descriptor.getHidservRendRelayedCells()); Map<String, Double> params = descriptor.getHidservRendRelayedCellsParameters(); assertTrue(params.containsKey("delta_f")); Loading @@ -2220,7 +2219,7 @@ public class ExtraInfoDescriptorImplTest { assertTrue(params.containsKey("bin_size")); assertEquals(1024.0, params.remove("bin_size"), 0.0001); assertTrue(params.isEmpty()); assertEquals(-3.0, descriptor.getHidservDirOnionsSeen(), 0.0001); assertEquals(-3, descriptor.getHidservDirOnionsSeen()); params = descriptor.getHidservDirOnionsSeenParameters(); assertTrue(params.containsKey("delta_f")); assertEquals(8.0, params.remove("delta_f"), 0.0001); Loading @@ -2237,7 +2236,7 @@ public class ExtraInfoDescriptorImplTest { .createWithDefaultLines(); assertEquals(1606737600000L, descriptor.getHidservV3StatsEndMillis()); assertEquals(86400L, descriptor.getHidservV3StatsIntervalLength()); assertEquals(6920802.0, descriptor.getHidservRendV3RelayedCells(), 0.0001); assertEquals(6920802, descriptor.getHidservRendV3RelayedCells()); Map<String, Double> params = descriptor.getHidservRendV3RelayedCellsParameters(); assertTrue(params.containsKey("delta_f")); Loading @@ -2247,7 +2246,7 @@ public class ExtraInfoDescriptorImplTest { assertTrue(params.containsKey("bin_size")); assertEquals(1024.0, params.remove("bin_size"), 0.0001); assertTrue(params.isEmpty()); assertEquals(28.0, descriptor.getHidservDirV3OnionsSeen(), 0.0001); assertEquals(28, descriptor.getHidservDirV3OnionsSeen()); params = descriptor.getHidservDirV3OnionsSeenParameters(); assertTrue(params.containsKey("delta_f")); assertEquals(8.0, params.remove("delta_f"), 0.0001); Loading Loading
src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java +3 −3 Original line number Diff line number Diff line Loading @@ -852,7 +852,7 @@ public interface ExtraInfoDescriptor extends Descriptor { * * @since 1.1.0 */ Double getHidservRendRelayedCells(); long getHidservRendRelayedCells(); /** * Get the obfuscation parameters applied to the original Loading Loading @@ -918,7 +918,7 @@ public interface ExtraInfoDescriptor extends Descriptor { * * @since 2.15.0 */ Double getHidservRendV3RelayedCells(); long getHidservRendV3RelayedCells(); /** * Get the obfuscation parameters applied to the original measurement value Loading @@ -941,7 +941,7 @@ public interface ExtraInfoDescriptor extends Descriptor { * * @since 2.15.0 */ Double getHidservDirV3OnionsSeen(); long getHidservDirV3OnionsSeen(); /** * Get the obfuscation parameters applied to the original measurement value Loading
src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java +9 −9 Original line number Diff line number Diff line Loading @@ -833,7 +833,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl throw new DescriptorParseException("Illegal line '" + line + "'."); } try { this.hidservRendRelayedCells = Double.parseDouble(partsNoOpt[1]); this.hidservRendRelayedCells = Long.parseLong(partsNoOpt[1]); } catch (NumberFormatException e) { throw new DescriptorParseException("Illegal line '" + line + "'."); } Loading Loading @@ -873,7 +873,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl throw new DescriptorParseException("Illegal line '" + line + "'."); } try { this.hidservRendV3RelayedCells = Double.parseDouble(partsNoOpt[1]); this.hidservRendV3RelayedCells = Long.parseLong(partsNoOpt[1]); } catch (NumberFormatException e) { throw new DescriptorParseException("Illegal line '" + line + "'."); } Loading @@ -889,7 +889,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl throw new DescriptorParseException("Illegal line '" + line + "'."); } try { this.hidservDirV3OnionsSeen = Double.parseDouble(partsNoOpt[1]); this.hidservDirV3OnionsSeen = Long.parseLong(partsNoOpt[1]); } catch (NumberFormatException e) { throw new DescriptorParseException("Illegal line '" + line + "'."); } Loading Loading @@ -1479,10 +1479,10 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl return this.hidservStatsIntervalLength; } private Double hidservRendRelayedCells; private long hidservRendRelayedCells; @Override public Double getHidservRendRelayedCells() { public long getHidservRendRelayedCells() { return this.hidservRendRelayedCells; } Loading Loading @@ -1523,10 +1523,10 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl return this.hidservV3StatsIntervalLength; } private Double hidservRendV3RelayedCells; private long hidservRendV3RelayedCells; @Override public Double getHidservRendV3RelayedCells() { public long getHidservRendV3RelayedCells() { return this.hidservRendV3RelayedCells; } Loading @@ -1538,10 +1538,10 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl : new HashMap<>(this.hidservRendV3RelayedCellsParameters); } private Double hidservDirV3OnionsSeen; private long hidservDirV3OnionsSeen; @Override public Double getHidservDirV3OnionsSeen() { public long getHidservDirV3OnionsSeen() { return this.hidservDirV3OnionsSeen; } Loading
src/test/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImplTest.java +4 −5 Original line number Diff line number Diff line Loading @@ -2209,8 +2209,7 @@ public class ExtraInfoDescriptorImplTest { .createWithDefaultLines(); assertEquals(1449152816000L, descriptor.getHidservStatsEndMillis()); assertEquals(86400L, descriptor.getHidservStatsIntervalLength()); assertEquals(36474281.0, descriptor.getHidservRendRelayedCells(), 0.0001); assertEquals(36474281, descriptor.getHidservRendRelayedCells()); Map<String, Double> params = descriptor.getHidservRendRelayedCellsParameters(); assertTrue(params.containsKey("delta_f")); Loading @@ -2220,7 +2219,7 @@ public class ExtraInfoDescriptorImplTest { assertTrue(params.containsKey("bin_size")); assertEquals(1024.0, params.remove("bin_size"), 0.0001); assertTrue(params.isEmpty()); assertEquals(-3.0, descriptor.getHidservDirOnionsSeen(), 0.0001); assertEquals(-3, descriptor.getHidservDirOnionsSeen()); params = descriptor.getHidservDirOnionsSeenParameters(); assertTrue(params.containsKey("delta_f")); assertEquals(8.0, params.remove("delta_f"), 0.0001); Loading @@ -2237,7 +2236,7 @@ public class ExtraInfoDescriptorImplTest { .createWithDefaultLines(); assertEquals(1606737600000L, descriptor.getHidservV3StatsEndMillis()); assertEquals(86400L, descriptor.getHidservV3StatsIntervalLength()); assertEquals(6920802.0, descriptor.getHidservRendV3RelayedCells(), 0.0001); assertEquals(6920802, descriptor.getHidservRendV3RelayedCells()); Map<String, Double> params = descriptor.getHidservRendV3RelayedCellsParameters(); assertTrue(params.containsKey("delta_f")); Loading @@ -2247,7 +2246,7 @@ public class ExtraInfoDescriptorImplTest { assertTrue(params.containsKey("bin_size")); assertEquals(1024.0, params.remove("bin_size"), 0.0001); assertTrue(params.isEmpty()); assertEquals(28.0, descriptor.getHidservDirV3OnionsSeen(), 0.0001); assertEquals(28, descriptor.getHidservDirV3OnionsSeen()); params = descriptor.getHidservDirV3OnionsSeenParameters(); assertTrue(params.containsKey("delta_f")); assertEquals(8.0, params.remove("delta_f"), 0.0001); Loading