Skip to content

Fix false positive METHOD_RETURN_TYPE_CHANGED for covariant return type overrides (#522) - #523

Merged
siom79 merged 1 commit into
masterfrom
claude/japicmp-issue-522-1DtKr
May 27, 2026
Merged

Fix false positive METHOD_RETURN_TYPE_CHANGED for covariant return type overrides (#522)#523
siom79 merged 1 commit into
masterfrom
claude/japicmp-issue-522-1DtKr

Conversation

@siom79

@siom79 siom79 commented May 27, 2026

Copy link
Copy Markdown
Owner

Introduce METHOD_RETURN_TYPE_COVARIANT_CHANGED: when a class overrides an interface
or superclass method with a covariant return type, the Java compiler generates a bridge
method with the original return type, ensuring binary compatibility. japicmp now
detects this pattern (bridge method present + new type is subtype of old type) and
reports the change as METHOD_RETURN_TYPE_COVARIANT_CHANGED (binary/source compatible,
MINOR semver) instead of the false-positive METHOD_RETURN_TYPE_CHANGED (MAJOR).

https://claude.ai/code/session_01S6MqaVyB48WckAALkz6KXM

…pe overrides (#522)

Introduce METHOD_RETURN_TYPE_COVARIANT_CHANGED: when a class overrides an interface
or superclass method with a covariant return type, the Java compiler generates a bridge
method with the original return type, ensuring binary compatibility. japicmp now
detects this pattern (bridge method present + new type is subtype of old type) and
reports the change as METHOD_RETURN_TYPE_COVARIANT_CHANGED (binary/source compatible,
MINOR semver) instead of the false-positive METHOD_RETURN_TYPE_CHANGED (MAJOR).

https://claude.ai/code/session_01S6MqaVyB48WckAALkz6KXM
@siom79
siom79 merged commit 2d6b2c8 into master May 27, 2026
15 checks passed
@siom79
siom79 deleted the claude/japicmp-issue-522-1DtKr branch May 27, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants