Lars Ködderitzsch 2015-01-10 17:30:30 +01:00
parent a35f1ba735
commit 8ec1a1a971
2 changed files with 17 additions and 0 deletions

View File

@ -332,6 +332,11 @@ public class Checker extends AutomaticBean implements MessageDispatcher
*/
public String normalize(String aPath)
{
if (aPath == null) {
return aPath;
}
final String osName = System.getProperty("os.name").toLowerCase(
Locale.US);
final boolean onNetWare = (osName.indexOf("netware") > -1);

View File

@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import com.google.common.collect.Sets;
@ -30,6 +31,17 @@ import org.junit.Test;
public class CheckerTest
{
@Test
public void testNullBasedir() throws Exception
{
final Checker c = new Checker();
c.setBasedir("c:/a\\b/./c\\..\\d");
c.setBasedir(null);
assertNull(c.getBasedir());
}
@Test
public void testDosBasedir() throws Exception
{