Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Improper for loop promotion from while

Open
#67 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
compilers, tooling

Research direction

Start with RealmsSelectWorldTemplate.func_224497_a and compare the generated for-loop form with the while-loop structure shown in the issue. Trace how the decompiler handles the loop initializer, condition, update expression, and Either variable; done means this case is emitted as the intended while loop without regressing related loop transformations.

Written by the indexing model from the issue text.

Description

1.16-pre1 RealmsSelectWorldTemplate.func_224497_a

WorldTemplatePaginatedList worldtemplatepaginatedlist = p_224497_1_;
Either<WorldTemplatePaginatedList, String> either;
for(RealmsClient realmsclient = RealmsClient.func_224911_a(); worldtemplatepaginatedlist != null; worldtemplatepaginatedlist = RealmsSelectWorldTemplateScreen.this.field_230706_i_.func_213169_a(() -> {
   if (either.right().isPresent()) {
      ...
   } else {
      ...
   }
}).join()) {
   either = RealmsSelectWorldTemplateScreen.this.func_224509_a(worldtemplatepaginatedlist, realmsclient);
}
WorldTemplatePaginatedList worldtemplatepaginatedlist = p_224497_1_;
RealmsClient realmsclient = RealmsClient.func_224911_a();
while (worldtemplatepaginatedlist != null) {
   Either<WorldTemplatePaginatedList, String> either = RealmsSelectWorldTemplateScreen.this.func_224509_a(worldtemplatepaginatedlist, realmsclient);
   worldtemplatepaginatedlist = RealmsSelectWorldTemplateScreen.this.field_230706_i_.func_213169_a(() -> {
      if (either.right().isPresent()) {
         ...
      } else {
         ...
      }
   };
}
Dominant language
No language data
Stars
110
Forks
49
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MinecraftForge/ForgeFlower

All issues in MinecraftForge/ForgeFlower

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.