Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArchiveFileTreeElement breaks the FileTreeElement contract #784

Closed
JonathanxD opened this issue Jul 25, 2022 · 3 comments · Fixed by #1233
Closed

ArchiveFileTreeElement breaks the FileTreeElement contract #784

JonathanxD opened this issue Jul 25, 2022 · 3 comments · Fixed by #1233

Comments

@JonathanxD
Copy link

JonathanxD commented Jul 25, 2022

Shadow Version

7.1.2

Gradle Version

7.4.2

Description

ShadowCopyAction$ArchiveFileTreeElement breaks the contract of FileTreeElement that states it never returns null. I got this while writing my own Transformer, although I can handle this corner case, it's not clear in the documentation that this might happen and it's also not good to break an interface contract.

I don't know how it would be possible to solve this, if possible at all.

@johnrengelman
Copy link
Collaborator

That's interesting. Yeah, the issue here is that the java File type doesn't support virtual filesystems like in an archive. That's what Path does. So I'm not sure there is a way to do this because the resulting File couldn't be properly formed.

@Goooler
Copy link
Member

Goooler commented Jan 21, 2025

@JonathanxD Can you try out 9.0.0-beta4?

override fun getFile(): File = throw UnsupportedOperationException()

@Goooler
Copy link
Member

Goooler commented Feb 28, 2025

This has been fixed by #1233.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants