Skip to content
Snippets Groups Projects
Commit 887a0e1b authored by felmer's avatar felmer
Browse files

SSDM-3071: Bug fixed by trimming the lines.

SVN: 35709
parent 51583627
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ public class PropertyIOUtils
List<String> lines = FileUtilities.loadToStringList(propertiesFile);
for (int i = 0; i < lines.size(); i++)
{
String line = lines.get(i);
String line = lines.get(i).trim();
if (line.length() == 0 || line.startsWith("#"))
{
continue;
......
......@@ -60,5 +60,16 @@ public class PropertyIOUtilsTest extends AbstractFileSystemTestCase
+ "': question", ex.getMessage());
}
}
@Test
public void testLoadPropertiesWithEmptyLineWithASpace()
{
File propertiesFile = new File(workingDirectory, "p.properties");
FileUtilities.writeToFile(propertiesFile, " answer = 42 \n \n");
Properties properties = PropertyIOUtils.loadProperties(propertiesFile);
assertEquals("42", properties.getProperty("answer"));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment