palantir / palantir/conjure-java

Introduce default visitUnknown for enum visitors

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

Nobody has claimed this yet.

Dominant language
Java
Stars
39
Forks
49
Avg merge
8h 22m
Merged PRs (30d)
32

Description

What happened?

The Visitor generated for enums requires implementations to handle the visitUnknown case, but we literally never do anything other than throw a generic exception in the unknown case.

What did you want to happen?

Either provide a default implementation for visitUnknown or generate a StrictVisitor where accept(StrictVisitor) handles the unknown case instead of passing the responsibility on to the implementation.

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the enum Visitor generation entry point and inspecting how visitUnknown is produced and invoked. Clarify whether the intended result is a default visitUnknown implementation or a StrictVisitor, then define completion as generated visitors handling unknown enum values without requiring each implementation to provide the generic exception behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.