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

`wrong-sprintf-arguments` causes `Source#defects()` to crash with `ValidationException` when `.printf` has no arguments

Open Beginner friendly
#1,577 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@opusstudiohq-max is already working on this.

Since Oct 22, 2026.

  • #1585 by @opusstudiohq-max — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
80/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, xml
Domain
testing

Research direction

Start with src/main/resources/org/eolang/lints/misc/wrong-sprintf-arguments.xsl and inspect how the stylesheet handles .printf when there is no o[@as] child. Reproduce with the EO example in the issue and run the Source#defects() call. Done when it returns defects or stays silent without throwing, and other lints still report their defects.

Written by the indexing model from the issue text.

Description

bug good-title

wrong-sprintf-arguments crashes the whole Source#defects() call with a Saxon ValidationException when .printf is used without any argument. The caller gets an exception instead of the defects, so no other lint reports anything for that file.

Steps to reproduce

On master at 245d999f90b0607f1e560f5e2bfa11b321f276c4, parse this program and run the lints:

+package a

# Foo.
[] > foo
  "ab".printf > @
new Source(new EoSyntax(eo).parsed()).defects();
Actual result
com.google.common.util.concurrent.UncheckedExecutionException
Caused by: net.sf.saxon.type.ValidationException: Cannot convert string "" to double

Saxon also prints #error(): Cannot convert string "" to double; SystemID: .../wrong-sprintf-arguments. A template with specifiers, such as "ab %d and %s".printf, fails in the same way.

Expected result

The program is valid EO, since printf is just not applied yet, so the lint should either report a normal defect about the missing tuple or stay silent, and the other lints should still return their defects. As a control, the same program with an argument, "ab".printf *, is inspected normally and returns its defects.

Technical evidence

In src/main/resources/org/eolang/lints/misc/wrong-sprintf-arguments.xsl the variable used is built by <xsl:apply-templates select="o[@as][1]" mode="arguments"/>. When .printf has no o[@as] child, nothing is produced and $used is an empty text value. The next step compares it as a number, $used=-1, and Saxon cannot convert an empty string to a double.

The arguments template returns -1 for an argument that is not a tuple, but nothing handles the case when there is no argument at all. #1548 describes a wrong count for another input of the same lint, and #1571 concerns the stylesheets that decode the template, so neither covers this.

Dominant language
Java
Stars
14
Forks
39
Avg merge
2d 23h
Merged PRs (30d)
34

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: 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 objectionary/lints

All issues in objectionary/lints

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.