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
The given lines are the root of the issue here: when OutputPath#isFile() is true, OutputPath#toPath() is called to convert the path into a Path object.
However, this causes an issue when the outputPath variable holds a PipePath: PipePath returns true for #isFile() but throws an UnsupportedOperationException for #toPath() (presumably because you cannot obtain a Path object for pipes). This causes the aforementioned crash via UnsupportedOperationException.
Although there is an if-check present before those lines, which short-circuits when the outputPath is a Pipe, this only returns and stops when the PipePath does not have a ArchiveFormat. If the PipePath does contain an ArchiveFormat, then this if-check passes and it goes straight into the aforementioned currently-crashing code.
Logfile: https://gist.github.com/Bricktricker/67bbcf61eafe403d240060dfe798874d (from orig. reporter on The Forge Project discord)
DiffPatch/src/main/java/codechicken/diffpatch/cli/PatchOperation.java
Lines 132 to 133 in 7d2555a
The given lines are the root of the issue here: when
OutputPath#isFile()
istrue
,OutputPath#toPath()
is called to convert the path into aPath
object.However, this causes an issue when the
outputPath
variable holds aPipePath
:PipePath
returnstrue
for#isFile()
but throws anUnsupportedOperationException
for#toPath()
(presumably because you cannot obtain aPath
object for pipes). This causes the aforementioned crash viaUnsupportedOperationException
.Although there is an
if
-check present before those lines, which short-circuits when theoutputPath
is aPipe
, this only returns and stops when thePipePath
does not have aArchiveFormat
. If thePipePath
does contain anArchiveFormat
, then thisif
-check passes and it goes straight into the aforementioned currently-crashing code.DiffPatch/src/main/java/codechicken/diffpatch/cli/PatchOperation.java
Lines 126 to 130 in 7d2555a
The bug was reported via a user using ForgeGradle 4.0.14 and 4.0.15 (with 4.0.14 being the version of ForgeGradle that first switched to DiffPatch). The offending code which causes the issue is this, where a
ByteArrayOutputStream
with an archive format ofArchiveFormat.ZIP
is given as the output path of thePatchOperation
https://github.com/MinecraftForge/ForgeGradle/blob/a74f4b155d3c41f495e4e03398ead9a95ef831f8/src/userdev/java/net/minecraftforge/gradle/userdev/MinecraftUserRepo.java#L1033-L1044
The text was updated successfully, but these errors were encountered: