AsciiArt startup banner: drop the 1s sleep, fix the once-only race, rotate banners
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem
com.dotcms.util.AsciiArt prints a single hardcoded startup banner and blocks the startup thread for a full second doing it:
private static boolean artDone = false; // not thread-safe
...
if (artDone) return; // check-then-set race
...
Thread.sleep(1000); // 1s added to every boot
Three things worth fixing:
Thread.sleep(1000)— a full second of dead time on every startup, purely so the banner lingers. Nothing reads it that fast; the log keeps it.artDoneis a plainbooleanwith a check-then-set — two threads racingdoArt()can both print.- One banner, hardcoded. A small rotating set is nicer and costs nothing.
Proposal
- Replace the single banner with a
String[]of banners, pick one per boot. AtomicBoolean.compareAndSetfor the once-only guard.- Drop the
Thread.sleep(1000).
Notes
Java text blocks still process escape sequences, so any ASCII art containing \ must escape it as \\ or the file will not compile (error: illegal escape character). Use \s to preserve a trailing space, since text blocks strip incidental trailing whitespace.
Acceptance criteria
- Startup banner still prints exactly once
- No
Thread.sleepin the startup path -
dotcms-corecompiles
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at com.dotcms.util.AsciiArt and inspect the doArt() entry point, including the current banner text, guard, and sleep. Replace the single-banner behavior as proposed, preserve valid Java text-block escaping, and compile dotcms-core to verify that the startup banner prints exactly once without Thread.sleep.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100