Skip to content

Problem with calling super in overridden default method#4776

Open
stephan-herrmann wants to merge 1 commit intoeclipse-jdt:masterfrom
stephan-herrmann:issue1600_secondAttempt
Open

Problem with calling super in overridden default method#4776
stephan-herrmann wants to merge 1 commit intoeclipse-jdt:masterfrom
stephan-herrmann:issue1600_secondAttempt

Conversation

@stephan-herrmann
Copy link
Copy Markdown
Contributor

@stephan-herrmann stephan-herrmann commented Jan 22, 2026

Improve the fix from #4727:

  • treat default methods like abstract (1 location)
  • treat default methods like concrete (1 location)

Fixes #1600

@stephan-herrmann
Copy link
Copy Markdown
Contributor Author

stephan-herrmann commented Jan 22, 2026

@srikanth-sankaran this change occurs in direct neighborhood of your 039347d.

You (2014):

					if (!original.isAbstract()) {
-						if (original2.isAbstract())
+						if (original2.isAbstract() || original2.isDefaultMethod()) 

I (2026):

-					if (!original.isAbstract()) {
+					if (!original.isAbstract() && !original.isDefaultMethod()) {
						if (original2.isAbstract() || original2.isDefaultMethod()) 

It actually makes your change more symmetric, in that we treat default methods like abstract methods. Do you see any problem with that?

Unfortunately, the sorting from #4727 needs a different strategy, here we need to prioritize implemented methods (i.e., default methods are like concrete).

If you agree, then we could actually fix #1600 with no known (!) regression - in a minimal way, i.e.

I still believe that msmb() should not see some of the method it sees - but that might be something for 4.40.

Improve the fix from eclipse-jdt#4727:
- treat default methods like abstract (1 location)
- treat default methods like concrete (1 location)

Fixes eclipse-jdt#1600
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.

Problem with calling super in overridden default method

1 participant