Skip to content

Commit 82159ac

Browse files
author
anders-wartoft
committed
Fixed code scanning warnings
1 parent e446cf0 commit 82159ac

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ target
22

33
.vscode
44
.DS_Store
5+
6+
.fake

src/main/java/nu/sitia/loggenerator/filter/substituters/DateSubstitute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class DateSubstitute extends AbstractSubstitute {
2828
private Date date;
2929

3030
/** Regex for a date pattern */
31-
private static final String dateRegex = "\\{date:(?<datepattern>[yYmMHhsz+-dD:\\d'T. ]+|epoch|epoch16)(/(?<locale>[^}]+))?}";
31+
private static final String dateRegex = "\\{date:(?<datepattern>[yYmMHhszdD:\\d'T. +\\-]+|epoch|epoch16)(/(?<locale>[^}]+))?}";
3232
/** Cached pattern for getting date format string */
3333
private static final Pattern datePattern = Pattern.compile(dateRegex);
3434

src/main/java/nu/sitia/loggenerator/util/Ipv4.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static long ipv4ToLong(String ipAddress) {
3333
for (int i = 0; i < ipAddressInArray.length; i++) {
3434
int power = 3 - i;
3535
int ip = Integer.parseInt(ipAddressInArray[i]);
36-
result += ip * Math.pow(256, power);
36+
result += (long) (ip * Math.pow(256, power));
3737
}
3838
return result;
3939
}

0 commit comments

Comments
 (0)