Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlikely argument type #440

Open
laeubi opened this issue Jan 26, 2024 · 2 comments
Open

Unlikely argument type #440

laeubi opened this issue Jan 26, 2024 · 2 comments

Comments

@laeubi
Copy link
Member

laeubi commented Jan 26, 2024

From the compiler logs

Unlikely argument type for equals(): TB seems to be unrelated to TA
4. INFO in bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java (at line 327)
	return o2.equals(o1);
	                 ^^
Unlikely argument type for equals(): TA seems to be unrelated to TB
5. INFO in bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/CoercingComparator.java (at line 336)
	return o1.equals(o2);
	                 ^^
Unlikely argument type for equals(): TB seems to be unrelated to TA
@merks
Copy link
Contributor

merks commented Jan 28, 2024

@laeubi

Should we just add this?

image

@laeubi
Copy link
Member Author

laeubi commented Jan 28, 2024

Good question, the class is maybe doing some strange things the compiler does not understand or there is a real error...

I just noticed in the past that "Unlikely argument type" was often a sign that I did something by accident than by intend.

In this case I think the compiler is concerned because of <TA extends Object, TB extends Object> it assumes different types but using equals method of object that never returns true if not o1 == o2 ...

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

No branches or pull requests

2 participants