Also extend DescriptorReader#readDescriptors to support .gz-compressed
files which will be necessary to process files rsync'ed from BridgeDB.
And maybe it's useful for other purposes, too.
Implements part of #19332.
Fix leaking resource in TorperfResultImpl.java using
try-with-resource statement.
This fix is related to analysis on metrics-lib using sonarqube
Implements part of #30544
Signed-off-by: fava <fava@libertymail.net>
Fix leaking resource in ExitListEntryImpl.java using
try-with-resource statement.
This fix is related to analysis on metrics-lib using sonarqube
Implements part of #30544
Fix leaking resource in DescriptorReaderImpl.java using
try-with-resource statement.
This fix is related to analysis on metrics-lib using sonarqube
Implements part of #30544
Turns out that updating all dependencies, including those in
metrics-web and exonerator using servlets and JSPs, is much harder
than expected. We decided to revert all these changes for now, so that
we can merge patches again. We're going to investigate alternatives
like Ant + Ivy, Maven, or Gradle in the near future.
Also upgrade to latest metrics-base.
Note that Checkstyle is excluded from this update, because there's a
yet unresolved issue with the new version: ("Unable to create Root
Module") that we'll have to address in a separate patch. But given
that Checkstyle is not required for the build it's okay to keep the
old version for now. It'll be in the release tarball.
We're using a regular expression on the first 100 characters of a
descriptor to recognize bandwidth files. More specifically, if a
descriptor starts with ten digits followed by a newline, we parse it
as a bandwidth file. (This is ugly, but the legacy bandwidth file
format doesn't give us much of a choice.)
This regular expression is broken. The regular expression we want is
one that matches the first 100 characters of a descriptor, which ours
didn't do.
More detailed explanation of the code change:
- We don't need to start the pattern with `^`, because the regular
expression needs to match the whole string anyway.
- The `(?s)` part enables the dotall mode: "In dotall mode, the
expression . matches any character, including a line terminator. By
default this expression does not match line terminators. Dotall
mode can also be enabled via the embedded flag expression (?s).
(The s is a mnemonic for "single-line" mode, which is what this is
called in Perl.)"
- We need to end the pattern with `.*` to match any characters
following the first newline, which also includes newlines due to
the previously enabled dotall mode.
Fixes#30369.
Turns out that characters inside square brackets don't need to be
escaped. In fact, "^[0-9\\.]{7,15}$" does not only match valid IPv4
addresses but also strings like "1\2\3\4".