Skip to content

Commit

Permalink
Fixes #1039 - AttributeNormalizer should not track null paths
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Oct 26, 2016
1 parent 7328742 commit c4a8e68
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -146,7 +145,20 @@ public int compare(PathAttribute o1, PathAttribute o2)
return o2.weight - o1.weight;
}
}


private static class PathAttributes extends ArrayList<AttributeNormalizer.PathAttribute>
{
@Override
public boolean add(AttributeNormalizer.PathAttribute pathAttribute)
{
if (pathAttribute.path == null)
{
return false;
}
return super.add(pathAttribute);
}
}

public static String uriSeparators(String path)
{
StringBuilder ret = new StringBuilder();
Expand All @@ -165,7 +177,7 @@ public static String uriSeparators(String path)
}

private URI warURI;
private List<PathAttribute> attributes = new ArrayList<>();
private PathAttributes attributes = new PathAttributes();

public AttributeNormalizer(Resource baseResource)
{
Expand Down

0 comments on commit c4a8e68

Please sign in to comment.