Skip to content

Commit

Permalink
Merge pull request #16
Browse files Browse the repository at this point in the history
* updated to version 1.2.6
* updated readme and CHANGELOG.txt
* format code
  • Loading branch information
paulrutter committed Nov 12, 2018
1 parent 1841671 commit 1175afb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.2.6 - 12 Nov 2018
- Merged pull request https://github.com/blueconic/browscap-java/pull/16.
Reduce dependencies by leveraging commons-csv.
Startup performance is not affected.

1.2.5 - 21 Sept 2018
- Merged pull request https://github.com/blueconic/browscap-java/pull/14.
It is now possible to supply your own BrowsCap ZIP file as file input stream in the constructor.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Add this to the dependencies in your pom.xml.
<dependency>
<groupId>com.blueconic</groupId>
<artifactId>browscap-java</artifactId>
<version>1.2.5</version>
<version>1.2.6</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public static UserAgentParser parse(final Reader input, final Collection<BrowsCa
private UserAgentParser parse(final Reader input) throws IOException, ParseException {

final List<Rule> rules = new ArrayList<>();
CSVFormat format = CSVFormat.DEFAULT.withSkipHeaderRecord();
final CSVFormat format = CSVFormat.DEFAULT.withSkipHeaderRecord();
try (CSVParser records = format.parse(input)) {
for (CSVRecord record : records) {
for (final CSVRecord record : records) {
final Rule rule = getRule(record);
if (rule != null) {
rules.add(rule);
Expand Down Expand Up @@ -113,7 +113,7 @@ private static String normalizePattern(final String pattern) {
return lowerCase;
}

private Map<BrowsCapField, String> getBrowsCapFields(CSVRecord record) {
private Map<BrowsCapField, String> getBrowsCapFields(final CSVRecord record) {
final Map<BrowsCapField, String> values = new EnumMap<>(BrowsCapField.class);
for (final BrowsCapField field : myFields) {
values.put(field, getValue(record.get(field.getIndex())));
Expand Down Expand Up @@ -193,7 +193,7 @@ Rule createRule(final String pattern, final Capabilities capabilities) {
return new Rule(prefix, suffixArray, postfix, pattern, capabilities);
}

private Rule getWildCardRule() {
private Rule getWildCardRule() {
// The default match all pattern
final Map<BrowsCapField, String> fieldValues = new EnumMap<>(BrowsCapField.class);
for (final BrowsCapField field : myFields) {
Expand Down

0 comments on commit 1175afb

Please sign in to comment.