Skip to content

Conversation

@SentryMan
Copy link
Collaborator

As the title says

@SentryMan SentryMan added this to the 3.6 milestone Nov 23, 2025
@SentryMan SentryMan requested a review from rbygrave November 23, 2025 00:20
@SentryMan SentryMan self-assigned this Nov 23, 2025
@SentryMan SentryMan added the enhancement New feature or request label Nov 23, 2025
@SentryMan SentryMan enabled auto-merge (squash) November 23, 2025 04:10
mechite added a commit to mechite/javalin that referenced this pull request Nov 26, 2025
This is a hack, but I've done it a lot and personally think it could be
a better way of handling optional dependencies over `Class.forName`

The thing is, `Class.forName` was designed for this very use-case of
optional dependencies. Javalin claims "no reflection" even in the very
readme file, so there are two ways to back this claim

- Remove all non-test usage of reflection entirely, opting for
  techniques like these (which work and in my opinion have no downsides,
  except that readers might be annoyed we are catching `Error`s?

  This even works properly in a `native-image` as well)

- Remove the claim of "no reflection"

Please note that I have no clue on writing idiomatic Kotlin.

Related-to: avaje/avaje-http#670 (comment)
Related-to: avaje/avaje-inject#932
Related-to: avaje/avaje-http#675
Signed-off-by: Mahied Maruf <contact@mechite.com>
@SentryMan SentryMan merged commit 23e0c53 into avaje:master Nov 26, 2025
5 checks passed
@SentryMan SentryMan deleted the NCDF branch November 27, 2025 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants