rkalla / cloudfront-log-parser

Amazon CloudFront Log Parser
Apache License 2.0
22 stars 6 forks source link

int getFieldIndex() can return null #6

Closed ghost closed 13 years ago

ghost commented 13 years ago

I have no idea how the compiler allows this, but using an inlined if-else statement of: (index == null ? null : index.intValue());

it is possible for getFieldIndex to return null if the fieldName given is unknown.

ghost commented 13 years ago

Fixed. Method returns INVALID_INDEX (int == -1) instead of null.