[MGNLEESOLR-175] Overloaded methods in SolrQueryBuilder are ambiguous Created: 10/Nov/22  Updated: 19/Jul/23  Resolved: 11/Jul/23

Status: Closed
Project: Solr Search Provider
Component/s: None
Affects Version/s: 6.1.2
Fix Version/s: 6.1.6

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Valeria Robles-Garzon
Resolution: Fixed Votes: 7
Labels: quickwin
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 1d 3.75h Time Spent: 1d 3.75h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
causality
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLEESOLR-204 Implement Sub-task Completed Valeria Robles-Garzon  
MGNLEESOLR-205 Review Sub-task Closed Oanh Thai Hoang  
MGNLEESOLR-206 Pre-Integration QA Sub-task Closed Oanh Thai Hoang  
MGNLEESOLR-207 QA Sub-task Completed Phong Le Quoc  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Epic Link: Support
Sprint: DevX 41
Story Points: 0.5
Team: DeveloperX
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1. Use the following test class to demonstrate the ambiguity of param methods in info.magnolia.search.solr.templating.SolrQueryBuilder
    public class SolrSearchTest {
    
    	private SolrQueryBuilder solrQueryBuilder;
    	
    	public SolrSearchTest(SolrQueryBuilder solrQueryBuilder) {
    		super();
    		this.solrQueryBuilder = solrQueryBuilder;
    	}
    
    	private void test() {
    		this.solrQueryBuilder.param("this", "is","a","test");
    	}
    }
  2.  Try to compile

Expected results

Code is correctly compiled

Actual results

There's an error shown in the IDE:

The method param(String, String[]) is ambiguous for the type SolrQueryBuilder

Development notes

Method param is overloaded as follows:

info.magnolia.search.solr.templating.SolrQueryBuilder.param(String, String...)

info.magnolia.search.solr.templating.SolrQueryBuilder.param(String, String, String...)

There's no way to distinguish between them as when passing more than 2 Strings any of the methods match in parameters. Fix would be reducing to one single method or changing the method parameters definition (renaming one of them).


Generated at Mon Feb 12 11:00:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.