Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
itaiag committed Nov 16, 2017
1 parent 80515a5 commit 61b6556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;

Expand Down Expand Up @@ -82,6 +81,8 @@ public Object getFromString(String stringRepresentation) throws Exception {
String propertiesString = stringRepresentation.substring(classEndIndex + 1);
Properties properties = new Properties();
try {
// Since we don't want to lose the backslashes, we need to replace each of the single backslashes with
// double backslashes before loading the string to the properties object
propertiesString = propertiesString.replaceAll("(?<!\\\\)\\\\(?!\\\\)", "\\\\\\\\");
properties.load(new StringReader(propertiesString));
} catch (IOException e1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public Object getFromString(String stringRepresentation) throws Exception {
String propertiesString = stringRepresentation.substring(classEndIndex + 1);
Properties properties = new Properties();
try {
// Since we don't want to lose the backslashes, we need to replace each of the single backslashes with
// double backslashes before loading the string to the properties object
propertiesString = propertiesString.replaceAll("(?<!\\\\)\\\\(?!\\\\)", "\\\\\\\\");
properties.load(new StringReader(propertiesString));
} catch (IOException e1) {
Expand Down

0 comments on commit 61b6556

Please sign in to comment.