Skip to content

verify returned suggestion type#11299

Closed
456dev wants to merge 2 commits into
PaperMC:masterfrom
456dev:feat/list-type-verify
Closed

verify returned suggestion type#11299
456dev wants to merge 2 commits into
PaperMC:masterfrom
456dev:feat/list-type-verify

Conversation

@456dev
Copy link
Copy Markdown
Contributor

@456dev 456dev commented Aug 19, 2024

draft: need to figure out where else in the api is/isnt typesafe for lists.

since generic types get erased at runtime, java doesn't actually know what is in the returned.
here i convert it to a String array,
which only accepts the one type, which throws the ArrayStoreException when failed.

additionally, since this occurs in BukkitCommandNode, the plugin/commands class is not in the stacktrace, so i add the command class to the error log.

made to help diagnose what plugin was causing this


Download the paperclip jar for this pull request: paper-11299.zip

since generic types get erased at runtime, java doesn't actually know what is in the returned. List
convert it to a String array, which only accepts the one type, which throws the ArrayStoreException when failed. additionally, since this occurs in BukkitCommandNode, the plugin/commands class is not in the stacktrace.
@456dev 456dev requested a review from a team as a code owner August 19, 2024 11:23
@electronicboy electronicboy added the publish-pr Enables a workflow to build Paperclip jars on the pull request. label Aug 19, 2024
Comment thread patches/server/1051-verify-returned-suggestion-type.patch Outdated
Co-authored-by: dawon <7982418+dawon@users.noreply.github.com>
@456dev 456dev marked this pull request as draft August 19, 2024 11:51
@Machine-Maker
Copy link
Copy Markdown
Member

I think this falls into a similar category as the other PR you opened relating to generic type checks at runtime.

@456dev
Copy link
Copy Markdown
Contributor Author

456dev commented Aug 19, 2024

Yeah understandable. This was mainly so I could give extra debug logging build without sending a random jar.
Closing

@456dev 456dev closed this Aug 19, 2024
@456dev 456dev deleted the feat/list-type-verify branch April 25, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

publish-pr Enables a workflow to build Paperclip jars on the pull request.

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

4 participants