[jira] [Commented] (TEXT-89) Add UTF-32 surrogate pairs support for WordUtils.initials()
[ https://issues.apache.org/jira/browse/TEXT-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16086488#comment-16086488 ] ASF GitHub Bot commented on TEXT-89: Github user arunvinudss commented on the issue: https://github.com/apache/commons-text/pull/49 @ameyjadiye Done. > Add UTF-32 surrogate pairs support for WordUtils.initials() > --- > > Key: TEXT-89 > URL: https://issues.apache.org/jira/browse/TEXT-89 > Project: Commons Text > Issue Type: Improvement >Reporter: Arun Vinud >Priority: Minor > > The current implementation of WordUtils.initials() doesn't support UTF-32 . > Refactor the code to provide support using UTF-16 surrogate pairs . The > proposed improvement should provide support to characters outside BMP. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (TEXT-89) Add UTF-32 surrogate pairs support for WordUtils.initials()
[ https://issues.apache.org/jira/browse/TEXT-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16086483#comment-16086483 ] ASF GitHub Bot commented on TEXT-89: Github user coveralls commented on the issue: https://github.com/apache/commons-text/pull/49 [![Coverage Status](https://coveralls.io/builds/12387036/badge)](https://coveralls.io/builds/12387036) Coverage decreased (-0.2%) to 97.126% when pulling **15c2e4b28686edf6f0807304367dba82ac3d359d on arunvinudss:TEXT-89** into **aaf4aba369ed0b97d17bc9343f763b0d099dbc2f on apache:master**. > Add UTF-32 surrogate pairs support for WordUtils.initials() > --- > > Key: TEXT-89 > URL: https://issues.apache.org/jira/browse/TEXT-89 > Project: Commons Text > Issue Type: Improvement >Reporter: Arun Vinud >Priority: Minor > > The current implementation of WordUtils.initials() doesn't support UTF-32 . > Refactor the code to provide support using UTF-16 surrogate pairs . The > proposed improvement should provide support to characters outside BMP. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CODEC-228) URLCodec.decode does not throw DecoderException with invalid UTF-8
[ https://issues.apache.org/jira/browse/CODEC-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16086324#comment-16086324 ] Gary Gregory commented on CODEC-228: It seems reasonable to me to add this extra error checking functionality. How should it be surfaced to developers? > URLCodec.decode does not throw DecoderException with invalid UTF-8 > -- > > Key: CODEC-228 > URL: https://issues.apache.org/jira/browse/CODEC-228 > Project: Commons Codec > Issue Type: Bug >Affects Versions: 1.10 >Reporter: Andrew Gaul > > I expect the following to throw {{DecoderException}}: > {code:java} > new URLCodec().decode("%AE%8A-", "UTF-8"); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Resolved] (TEXT-85) Create CaseUtils class. Add toCamelCase
[ https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pascal Schumacher resolved TEXT-85. --- Resolution: Fixed Fix Version/s: 1.2 > Create CaseUtils class. Add toCamelCase > --- > > Key: TEXT-85 > URL: https://issues.apache.org/jira/browse/TEXT-85 > Project: Commons Text > Issue Type: Improvement >Reporter: Rob Tompkins >Assignee: Rob Tompkins > Fix For: 1.2 > > > Based on the conversation here: > http://markmail.org/message/7nvizsbykvxpr7g5 > We wish to have a {{toCamelCase}} method. The suggestion is to create a > {{CaseUtils}} class. > I wonder if we should think about deprecating the case management in > {{WordUtils}} and move it over? Maybe, maybe not. > I would think our method signature would look something like: > {code} > String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter) > {code} > potentially with {{String}} replaced with {{CharSequence}}. > Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} > might be a good starting point. > https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499 -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16086305#comment-16086305 ] Arend v. Reinersdorff commented on TEXT-74: --- Hi [~cscherban], I improved the description: It was not formatting properly in Jira and a bit misleading. I hope it is clearer now. It's not about inner or outer variables, but about replacing in the source or in the values. The values might be untrusted user input. > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > StrSubstitutor replaces variables in values. And currently there's no way to > turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacement values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > Here's some example code. At the moment it prints: > {code} > Hello Hamburg from Hamburg > {code} > The commented line is my suggestion for this feature. If it works, it should > print: > {code} > Hello ${city} from Hamburg > {code} > {code} > // untrusted user input > String userInputName = "${city}"; > String userInputCity = "Hamburg"; > MapvalueMap = new HashMap<>(); > valueMap.put("name", userInputName); > valueMap.put("city", userInputCity); > String source = "Hello ${name} from ${city}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arend v. Reinersdorff updated TEXT-74: -- Description: StrSubstitutor replaces variables in values. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacement values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello Hamburg from Hamburg {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${city} from Hamburg {code} {code} // untrusted user input String userInputName = "${city}"; String userInputCity = "Hamburg"; MapvalueMap = new HashMap<>(); valueMap.put("name", userInputName); valueMap.put("city", userInputCity); String source = "Hello ${name} from ${city}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} was: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello Hamburg from Hamburg {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${city} from Hamburg {code} {code} // untrusted user input String userInputName = "${city}"; String userInputCity = "Hamburg"; Map valueMap = new HashMap<>(); valueMap.put("name", userInputName); valueMap.put("city", userInputCity); String source = "Hello ${name} from ${city}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > StrSubstitutor replaces variables in values. And currently there's no way to > turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacement values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > Here's some example code. At the moment it prints: > {code} > Hello Hamburg from Hamburg > {code} > The commented line is my suggestion for this feature. If it works, it should > print: > {code} > Hello ${city} from Hamburg > {code} > {code} > // untrusted user input > String userInputName = "${city}"; > String userInputCity = "Hamburg"; > Map valueMap = new HashMap<>(); > valueMap.put("name", userInputName); > valueMap.put("city", userInputCity); > String source = "Hello ${name} from ${city}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arend v. Reinersdorff updated TEXT-74: -- Description: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello Hamburg from Hamburg {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${city} from Hamburg {code} {code} // untrusted user input String userInputName = "${city}"; String userInputCity = "Hamburg"; MapvalueMap = new HashMap<>(); valueMap.put("name", userInputName); valueMap.put("city", userInputCity); String source = "Hello ${name} from ${city}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} was: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello Hamburg from Hamburg {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${city} from Hamburg {code} {code} // untrusted user input String userInputName = "${city}"; String userInputCity = "Hamburg"; Map valueMap = new HashMap<>(); valueMap.put("name", userInputName); valueMap.put("city", userInputCity); String source = "Hello ${name} from ${city}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > In StrSubstitutor variable replacement works in a recursive way. And > currently there's no way to turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacemnt values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > Here's some example code. At the moment it prints: > {code} > Hello Hamburg from Hamburg > {code} > The commented line is my suggestion for this feature. If it works, it should > print: > {code} > Hello ${city} from Hamburg > {code} > {code} > // untrusted user input > String userInputName = "${city}"; > String userInputCity = "Hamburg"; > Map valueMap = new HashMap<>(); > valueMap.put("name", userInputName); > valueMap.put("city", userInputCity); > String source = "Hello ${name} from ${city}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arend v. Reinersdorff updated TEXT-74: -- Description: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello Hamburg from Hamburg {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${city} from Hamburg {code} {code} // untrusted user input String userInputName = "${city}"; String userInputCity = "Hamburg"; MapvalueMap = new HashMap<>(); valueMap.put("name", userInputName); valueMap.put("city", userInputCity); String source = "Hello ${name} from ${city}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} was: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello world {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${key2} {code} {code} Map valueMap = new HashMap<>(); valueMap.put("key", "${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > In StrSubstitutor variable replacement works in a recursive way. And > currently there's no way to turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacemnt values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > Here's some example code. At the moment it prints: > {code} > Hello Hamburg from Hamburg > {code} > The commented line is my suggestion for this feature. If it works, it should > print: > {code} > Hello ${city} from Hamburg > {code} > {code} > // untrusted user input > String userInputName = "${city}"; > String userInputCity = "Hamburg"; > Map valueMap = new HashMap<>(); > valueMap.put("name", userInputName); > valueMap.put("city", userInputCity); > String source = "Hello ${name} from ${city}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arend v. Reinersdorff updated TEXT-74: -- Description: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello world {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${key2} {code} {code} MapvalueMap = new HashMap<>(); valueMap.put("key", "${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} was: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello world {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${key2} {code} {code} Map valueMap = new HashMap<>(); valueMap.put("key", "$${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > In StrSubstitutor variable replacement works in a recursive way. And > currently there's no way to turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacemnt values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > Here's some example code. At the moment it prints: > {code} > Hello world > {code} > The commented line is my suggestion for this feature. If it works, it should > print: > {code} > Hello ${key2} > {code} > {code} > Map valueMap = new HashMap<>(); > valueMap.put("key", "${key2}"); > valueMap.put("key2", "world"); > String source = "Hello ${key}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arend v. Reinersdorff updated TEXT-74: -- Description: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints: {code} Hello world {code} The commented line is my suggestion for this feature. If it works, it should print: {code} Hello ${key2} {code} {code} MapvalueMap = new HashMap<>(); valueMap.put("key", "$${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} was: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. {noformat} Here's some example code. At the moment it prints "Hello world". The commented line is my suggestion for this feature. If it works, it should print "Hello ${key2}" : {noformat} {code} Map valueMap = new HashMap<>(); valueMap.put("key", "$${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > In StrSubstitutor variable replacement works in a recursive way. And > currently there's no way to turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacemnt values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > Here's some example code. At the moment it prints: > {code} > Hello world > {code} > The commented line is my suggestion for this feature. If it works, it should > print: > {code} > Hello ${key2} > {code} > {code} > Map valueMap = new HashMap<>(); > valueMap.put("key", "$${key2}"); > valueMap.put("key2", "world"); > String source = "Hello ${key}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arend v. Reinersdorff updated TEXT-74: -- Description: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. {noformat} Here's some example code. At the moment it prints "Hello world". The commented line is my suggestion for this feature. If it works, it should print "Hello ${key2}" : {noformat} {code} MapvalueMap = new HashMap<>(); valueMap.put("key", "$${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} was: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints "Hello world". The commented line is my suggestion for this feature. If it works, it should print "Hello ${key2}": {code} Map valueMap = new HashMap<>(); valueMap.put("key", "$${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > In StrSubstitutor variable replacement works in a recursive way. And > currently there's no way to turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacemnt values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > {noformat} > Here's some example code. At the moment it prints "Hello world". The > commented line is my suggestion for this feature. If it works, it should > print "Hello ${key2}" : > {noformat} > {code} > Map valueMap = new HashMap<>(); > valueMap.put("key", "$${key2}"); > valueMap.put("key2", "world"); > String source = "Hello ${key}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arend v. Reinersdorff updated TEXT-74: -- Description: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints "Hello world". The commented line is my suggestion for this feature. If it works, it should print "Hello ${key2}": {code} MapvalueMap = new HashMap<>(); valueMap.put("key", "$${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); {code} was: In StrSubstitutor variable replacement works in a recursive way. And currently there's no way to turn this off. Why turn it off: I want to replace some variables in a simple template. Some of the replacemnt values are arbitrary user input. At the moment I escape all dollar signs in the replacement values with "$$". This is annoying. Especially as I use one template with variables as a value for another variable. Here I have to escape twice. Here's some example code. At the moment it prints "Hello world". The commented line is my suggestion for this feature. If it works, it should print "Hello ${key2}": Map valueMap = new HashMap<>(); valueMap.put("key", "$${key2}"); valueMap.put("key2", "world"); String source = "Hello ${key}"; StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); // strSubstitutor.setEnableSubstitutionInValues(false); System.out.println(strSubstitutor.replace(source)); > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > In StrSubstitutor variable replacement works in a recursive way. And > currently there's no way to turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacemnt values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > Here's some example code. At the moment it prints "Hello world". The > commented line is my suggestion for this feature. If it works, it should > print "Hello ${key2}": > {code} > Map valueMap = new HashMap<>(); > valueMap.put("key", "$${key2}"); > valueMap.put("key2", "world"); > String source = "Hello ${key}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (NET-640) TFTP sendFile retry broken
[ https://issues.apache.org/jira/browse/NET-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16086216#comment-16086216 ] Gary Gregory commented on NET-640: -- If you do get the time, GitHub is the best place (IMO) to send us a patch through a pull request: https://github.com/apache/commons-net Thank you, Gary > TFTP sendFile retry broken > -- > > Key: NET-640 > URL: https://issues.apache.org/jira/browse/NET-640 > Project: Commons Net > Issue Type: Bug > Components: TFTP >Affects Versions: 3.6 >Reporter: Clément Mangin > > The latest TFTP client rewrite for 3.6 promised to fix NET-477 but the bug is > still present. > The sendFile method does not resend the last sent block when it times out > while waiting for said block's ack. > Fix patch: https://s3.amazonaws.com/clement-mangin-personal/TFTPClient.patch -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Created] (IO-545) FilenameUtils.getFullPath incorrectly parses file names that begin with a tilde
J.P. created IO-545: --- Summary: FilenameUtils.getFullPath incorrectly parses file names that begin with a tilde Key: IO-545 URL: https://issues.apache.org/jira/browse/IO-545 Project: Commons IO Issue Type: Bug Components: Utilities Affects Versions: 2.5, 2.4 Environment: OpenJDK Runtime Environment (build 1.8.0_92-b14) FreeBSD 10.0-RELEASE-p11 Reporter: J.P. Priority: Minor For any file with a name that begins with a tilde, which is a valid file name in BSD and Windows, if you call FilenameUtils.getFullPath and pass the file name, it returns the file name followed by a path separator. It should return an empty string. It seems to be parsing it as a unix user directory because it starts with the tilde. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (TEXT-47) WordUtils.capitalize() can't handle 1:M conversions
[ https://issues.apache.org/jira/browse/TEXT-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16086076#comment-16086076 ] Amey Jadiye commented on TEXT-47: - I don't see even java have solution for this ? can we just create map and lookup from it whenever these kind of char comes for conversion ? > WordUtils.capitalize() can't handle 1:M conversions > --- > > Key: TEXT-47 > URL: https://issues.apache.org/jira/browse/TEXT-47 > Project: Commons Text > Issue Type: Bug >Reporter: Duncan Jones > Fix For: 1.x > > > Some case conversions are not 1:1, for instance the German letter ß, which is > normally capitalised to 'SS'. > {code:java} > // Failing test > assertEquals("SS", WordUtils.capitalize("\u00DF")); > {code} > If we were using upper case and not title case, a solution such as the > following would work: > {code:java} > public static String capitalize(final String str, final char... delimiters) { > final int delimLen = delimiters == null ? -1 : delimiters.length; > if (StringUtils.isEmpty(str) || delimLen == 0) { > return str; > } > final StringBuffer buffer = new StringBuffer(str.length()); > final char[] chars = str.toCharArray(); > boolean capitalizeNext = true; > for (int i = 0; i < chars.length; i++) { > final char ch = chars[i]; > if (isDelimiter(ch, delimiters)) { > capitalizeNext = true; > buffer.append(ch); > } else if (capitalizeNext) { > // Use ENGLISH locale to be backwards compatible with previous > releases, which > // used Character.toUpperCase() > buffer.append(String.valueOf(ch).toUpperCase(Locale.ENGLISH)); > capitalizeNext = false; > } else { > buffer.append(ch); > } > } > return buffer.toString(); > } > {code} > ... but as we use title case, we can't use the String class to convert for us. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (TEXT-74) StrSubstitutor: Ability to turn off substitution in values
[ https://issues.apache.org/jira/browse/TEXT-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16085825#comment-16085825 ] Christopher Alexander Scherban commented on TEXT-74: Are you essentially just asking that only the innermost variable, in the case of nesting, be replaced? > StrSubstitutor: Ability to turn off substitution in values > -- > > Key: TEXT-74 > URL: https://issues.apache.org/jira/browse/TEXT-74 > Project: Commons Text > Issue Type: Improvement >Reporter: Arend v. Reinersdorff >Priority: Minor > Labels: features > Fix For: 1.x > > > In StrSubstitutor variable replacement works in a recursive way. And > currently there's no way to turn this off. > Why turn it off: I want to replace some variables in a simple template. Some > of the replacemnt values are arbitrary user input. > At the moment I escape all dollar signs in the replacement values with "$$". > This is annoying. Especially as I use one template with variables as a value > for another variable. Here I have to escape twice. > Here's some example code. At the moment it prints "Hello world". The > commented line is my suggestion for this feature. If it works, it should > print "Hello ${key2}": > MapvalueMap = new HashMap<>(); > valueMap.put("key", "$${key2}"); > valueMap.put("key2", "world"); > String source = "Hello ${key}"; > StrSubstitutor strSubstitutor = new StrSubstitutor(valueMap); > // strSubstitutor.setEnableSubstitutionInValues(false); > System.out.println(strSubstitutor.replace(source)); -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Created] (JEXL-237) Ability to restrict usage of certain names when declaring local variables
Dmitri Blinov created JEXL-237: -- Summary: Ability to restrict usage of certain names when declaring local variables Key: JEXL-237 URL: https://issues.apache.org/jira/browse/JEXL-237 Project: Commons JEXL Issue Type: Wish Affects Versions: 3.1 Reporter: Dmitri Blinov Priority: Minor One of the errors the scriptwriter usually makes is an accidental override of certain context variables with his own local variables, which leads to nasty bugs detected only when script is executed. As of now there is only a small list of reserved words that can not be used as a valid variable name, and it is restricted to basic Jexl syntax keywords. When Jexl syntax is extended with custom functions and predefined context variables, its much easier for a local variable name to clash with predefined name, thus altering script execution further on. To exclude those errors it is needed that a custom name verification would exist, prohibiting the scripts from be successfully parsed. -- This message was sent by Atlassian JIRA (v6.4.14#64029)