Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The method in the type is not applicable for the arguments (even though they are?!)

Tags:

java

eclipse

I'm trying to call a method using parameters that definitely match my args, yet I get this error...

The method getAdministratablePaging(Long, ContentFilter, int, int, Integer, Integer) in the type ContentService is not applicable for the arguments (Long, ContentFilter, int, int, Integer, Integer)

The code is...

ResultPage knowledgeCenters = _kcs.getAdministratablePaging(ContentConstants.KNOWLEDGE_ROOT, filter, 0, Constants.COUNT_ALL, ContentConstants.COLUMN_SIZE, Constants.SORT_ORDER_ASCENDING);

I'm working in Eclipse and have tried Clean and rebooting the IDE. Suggestions much appreciated!

like image 507
nscoppin Avatar asked Dec 02 '25 08:12

nscoppin


1 Answers

Just putting my comment as an answer in case it can help somebody seeing this question in the future.

When you see a message like this, then the only possibility is that there are multiple types of one of the parameter objects. In this case, @nscoppin had two different definitions for ContentFilter. Either import the correct one, or use the fully qualified name in the method call, ie

someMethod(com.packageA.subPackage.ContentFilter);
like image 138
Kon Avatar answered Dec 03 '25 22:12

Kon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!