>Note: The Javadoc says the var markers must not be null. So we could document 
 >null and empty as the same.

+1

I think it doesn't make much sense, and I think it also doesn't work. Maybe we 
should allow only for non-empty prefix/sufix?


Bruno

    On Thursday, 1 October 2020, 11:57:46 am NZDT, Gary Gregory 
<[email protected]> wrote:  
 
 Note: The Javadoc says the var markers must not be null. So we could document 
null and empty as the same.
The first question I have is how does this even make sense, both the start and 
end markers are empty strings... so... that matches each character in input 
since "a" starts with "" and ends with ""?
Gary
On Wed, Sep 30, 2020 at 6:46 PM Bruno P. Kinoshita <[email protected]> wrote:

 Hi,
I reproduced the same behaviour on master branch of [text]. And indeed, found 
nothing in the javadoc that says what is the expected behaviour.
I think the class javadoc, as well as the setter javadoc would be good places 
to have such a documentation.
Let's see what others think about it, but if there are no objections, then we 
would need a JIRA issue to track this change (and pull requests would be 
welcome as well :)

Thanks!Bruno


    On Thursday, 1 October 2020, 10:49:52 am NZDT, Thomas Auinger 
<[email protected]> wrote:  

 Hi,



I can run the following test without exception but it doesn't yield the
expected result. Also I can find no information that prefix and or suffix
must not be empty.



@Test
public void testNoPrefixAndSuffix() {
    final Map<String, String> map = new HashMap<>();
    map.put("name", "commons");
    assertEqualsCharSeq("Hi commons!", StringSubstitutor.replace("Hi name!",
map, "", ""));
}



Is that a bug?



Cheers

Thomas



  
  

Reply via email to