mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
handle decimals for integer and long value types
This commit is contained in:
parent
6fda0ca726
commit
8a6d62083a
@ -387,13 +387,15 @@ public final class LeappFileProcessor {
|
|||||||
bbattributes.add(new BlackboardAttribute(attributeType, moduleName, columnValue));
|
bbattributes.add(new BlackboardAttribute(attributeType, moduleName, columnValue));
|
||||||
} else if (attrType.matches("INTEGER")) {
|
} else if (attrType.matches("INTEGER")) {
|
||||||
try {
|
try {
|
||||||
bbattributes.add(new BlackboardAttribute(attributeType, moduleName, Integer.valueOf(columnValue)));
|
// parse as double to handle values of format like '21.0' and then convert to int
|
||||||
|
bbattributes.add(new BlackboardAttribute(attributeType, moduleName, Double.valueOf(columnValue).intValue()));
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
logger.log(Level.WARNING, String.format("Unable to format %s as an integer.", columnValue), ex);
|
logger.log(Level.WARNING, String.format("Unable to format %s as an integer.", columnValue), ex);
|
||||||
}
|
}
|
||||||
} else if (attrType.matches("LONG")) {
|
} else if (attrType.matches("LONG")) {
|
||||||
try {
|
try {
|
||||||
bbattributes.add(new BlackboardAttribute(attributeType, moduleName, Long.valueOf(columnValue)));
|
// parse as double to handle values of format like '21.0' and then convert to long
|
||||||
|
bbattributes.add(new BlackboardAttribute(attributeType, moduleName, Double.valueOf(columnValue).longValue()));
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
logger.log(Level.WARNING, String.format("Unable to format %s as an long.", columnValue), ex);
|
logger.log(Level.WARNING, String.format("Unable to format %s as an long.", columnValue), ex);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user