Uploaded image for project: 'Solr Search Provider'
  1. Solr Search Provider
  2. MGNLEESOLR-175

Overloaded methods in SolrQueryBuilder are ambiguous

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 6.1.6
    • 6.1.2

    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).

      Checklists

        Acceptance criteria

        Attachments

          There are no Sub-Tasks for this issue.

          Activity

            People

              vrg Valeria Robles-Garzon
              jayala Jonathan Ayala
              DeveloperX
              Votes:
              7 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Work Started:

                Checklists

                  Bug DoR
                  Task DoD

                  Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 1d 3.75h
                    1d 3.75h