Skip to content

Comments

GH-1142 Fix LiteCommands.class not properly initialized as BeanCandidate#1308

Closed
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-litecommands-bean-registration
Closed

GH-1142 Fix LiteCommands.class not properly initialized as BeanCandidate#1308
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-litecommands-bean-registration

Conversation

Copy link

Copilot AI commented Feb 20, 2026

LiteCommands is registered via addCandidate() inside the @Subscribe(EternalInitializeEvent.class) handler, which runs after beanFactory.initializeCandidates() has already completed. The candidate was never consumed into a bean — it sat unprocessed in the BeanCandidateContainer.

  • Added beanFactory.initializeCandidates(LiteCommands.class) immediately after addCandidate() to eagerly initialize the late-registered candidate
@Subscribe(EternalInitializeEvent.class)
public void onEnable(BeanFactory beanFactory, LiteCommandsBuilder<CommandSender, ?, ?> liteCommandsBuilder) {
    LiteCommands<CommandSender> register = liteCommandsBuilder.build();
    beanFactory.addCandidate(LiteCommands.class, () -> register);
    beanFactory.initializeCandidates(LiteCommands.class); // ensure candidate is consumed into a bean
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkstyle.org
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/EternalCore/.codeql-scratch/dbs/java/working/files-to-index4308888360123323105.list --sourceArchiveDir=/home/REDACTED/work/EternalCore/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/EternalCore/.codeql-scratch/dbs/java/trap/java (dns block)
  • hub.spigotmc.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:&#43;HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 (dns block)
  • www.puppycrawl.com
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/EternalCore/.codeql-scratch/dbs/java/working/files-to-index4308888360123323105.list --sourceArchiveDir=/home/REDACTED/work/EternalCore/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/EternalCore/.codeql-scratch/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[injector] LiteCommands.class is not properly registered as BeanCandidate</issue_title>
<issue_description></issue_description>

<agent_instructions>Carefully explore the code around dependency injector, identify the cause and make so that LiteCommands class is registered properly as BeanCandidate</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@Jakubk15 Jakubk15 added the 🐛 bug Something isn't working label Feb 20, 2026
Copilot AI and others added 2 commits February 20, 2026 15:24
Co-authored-by: Jakubk15 <77227023+Jakubk15@users.noreply.github.com>
Call beanFactory.initializeCandidates(LiteCommands.class) after addCandidate
to ensure the candidate is consumed and turned into a proper bean in the
BeanContainer, since this registration happens after the main
initializeCandidates() call has already completed.

Co-authored-by: Jakubk15 <77227023+Jakubk15@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix LiteCommands class registration as BeanCandidate Fix LiteCommands.class not properly initialized as BeanCandidate Feb 20, 2026
Copilot AI requested a review from Jakubk15 February 20, 2026 15:29
@Jakubk15 Jakubk15 marked this pull request as ready for review February 20, 2026 15:44
@Jakubk15 Jakubk15 requested a review from a team as a code owner February 20, 2026 15:44
@Jakubk15 Jakubk15 requested a review from Rollczi February 20, 2026 15:45
@Jakubk15 Jakubk15 changed the title Fix LiteCommands.class not properly initialized as BeanCandidate GH-1142 Fix LiteCommands.class not properly initialized as BeanCandidate Feb 20, 2026
@Jakubk15 Jakubk15 removed their request for review February 20, 2026 15:51
@Jakubk15 Jakubk15 removed their assignment Feb 20, 2026
@Rollczi
Copy link
Member

Rollczi commented Feb 21, 2026

nie wiem jaki to problem rozwiązuje

@Rollczi Rollczi closed this Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[injector] LiteCommands.class is not properly registered as BeanCandidate

3 participants