You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to recreate imagej-updater's hashing in Python, and while I had success with many files, I stumbled upon some very peculiar behaving files. Six hours of debugging later, I found two non-obvious bugs in imagej-updater's code.
While this seems to be two bugs, it doesn't really affect the updater, since the hashes are calculated consistently wrong ;) … or at least contrary to what taking a brief look at the code might suggest.
First: Contrary to what keepOnlyMainClass parameter (the default) suggests, the FilterManifest filter will never show the main class:
if (line.toUpperCase().startsWith("Main-Class:")) builder.append(line).append('\n');
After the .toUpperCase() call, it can never .startsWith() the mixed case text fragment ... hence just an empty manifest is passed.
Second: A missing super(). turns this simple supposedly-iterative (I presume) function into a rather unpredictable recursive affair ... contrary to what SkipHashedLines suggests, some lines starting with a # will hence remain in the resulting stream.
I was trying to recreate imagej-updater's hashing in Python, and while I had success with many files, I stumbled upon some very peculiar behaving files. Six hours of debugging later, I found two non-obvious bugs in imagej-updater's code.
While this seems to be two bugs, it doesn't really affect the updater, since the hashes are calculated consistently wrong ;) … or at least contrary to what taking a brief look at the code might suggest.
First: Contrary to what
keepOnlyMainClass
parameter (the default) suggests, theFilterManifest
filter will never show the main class:imagej-updater/src/main/java/net/imagej/updater/util/FilterManifest.java
Line 90 in cd8ba1c
After the
.toUpperCase()
call, it can never.startsWith()
the mixed case text fragment ... hence just an empty manifest is passed.Second: A missing
super().
turns this simple supposedly-iterative (I presume) function into a rather unpredictable recursive affair ... contrary to whatSkipHashedLines
suggests, some lines starting with a#
will hence remain in the resulting stream.imagej-updater/src/main/java/net/imagej/updater/util/SkipHashedLines.java
Line 65 in cd8ba1c
The text was updated successfully, but these errors were encountered: