Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Question on ContentAssistProcessorTestBuilder#append
Question on ContentAssistProcessorTestBuilder#append [message #1758593] Thu, 30 March 2017 07:48 Go to next message
Eclipse UserFriend
Could someone please explain to me why `ContentAssistProcessorTestBuilder` returns with a new instance instead of `this` when appending content? For example here: `org.eclipse.xtext.junit4.ui.ContentAssistProcessorTestBuilder.append(String)`. In other words, why is it required to clone the current instance.

I am using 2.11.0.

Thanks!
Re: Question on ContentAssistProcessorTestBuilder#append [message #1758628 is a reply to message #1758593] Thu, 30 March 2017 13:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

the code is quite old. it was introduced with https://github.com/eclipse/xtext/commit/0dc1bb90af1317e50442256cda273b5121fedae1#diff-a4934d9e0e768ddbe95e43a12b17d65d
i dont see a obvious reason but neither why it could harm


Re: Question on ContentAssistProcessorTestBuilder#append [message #1758630 is a reply to message #1758628] Thu, 30 March 2017 14:32 Go to previous message
Eclipse UserFriend
Yeah, I can live with this too, I was just surprised when the below code was broken due to the new instance creation:

  protected def newBuilder(String content) {
    val builder = new ContentAssistProcessorTestBuilder(injector, this) {

      @Override
      override protected toString(ICompletionProposal proposal) {
        return super.toString(proposal).trim;
      }

    };
    builder.append(content);
    return builder;
  }


Long story short, I was just interested if that is on purpose or not.

Thanks for the answer and looking up the commit!
Previous Topic:Custom class reference in inferrer
Next Topic:[SOLVED] What is the generated file ".File.dslbin"?
Goto Forum:
  


Current Time: Sat Aug 30 23:39:57 EDT 2025

Powered by FUDForum. Page generated in 0.03080 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top