-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed #1
base: fix
Are you sure you want to change the base?
fixed #1
Conversation
} | ||
|
||
public String mapShipmentOnButtonClick() { | ||
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
The SimpleDateFormat object was created without setting the time zone. Make sure that you want to use the default time zone or use letter z, Z or X in the pattern. Otherwise, if you don?t call setTimeZone() on the created SimpleDateFormat object, you might get an unexpected date and time when using the object.
urlConnection.connect(); | ||
|
||
InputStream inputStream = urlConnection.getInputStream(); | ||
FileOutputStream fileOutputStream = new FileOutputStream(directory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
Problem
This line of code contains a resource that might not be closed properly. Resource leaks can cause your system to slow down or crash.
Fix
Consider closing the following resource: fileOutputStream. The resource is referenced in statements at the following line: 35. The resource closure statement is at line: 37. There are other execution paths that do not contain closure statements, e.g., when exception is thrown by InputStream.read. Either a) close fileOutputStream in a try-finally block or b) close the resource by declaring fileOutputStream in a try-with-resources block.
More info
View resource management guidelines at oracle.com (external link).
l = Float.parseFloat(firstResponse.substring(0, firstResponse.indexOf(','))); | ||
b = Float.parseFloat(firstResponse.substring(firstResponse.indexOf(',') + 1, firstResponse.length() - 1)); | ||
|
||
h = Float.parseFloat(secondResponse.substring(0, secondResponse.indexOf(','))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
If the indexOf() search on line 533 does not find the substring and returns -1, the call to substring() on line 533 will throw IndexOutOfBoundsException.
List<Float> dim = new ArrayList<>(); | ||
if (secondResponse != null) { | ||
|
||
l = Float.parseFloat(firstResponse.substring(0, firstResponse.indexOf(','))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
If the indexOf() search on line 530 does not find the substring and returns -1, the call to substring() on line 530 will throw IndexOutOfBoundsException.
db = this.getReadableDatabase(); | ||
|
||
String query = "select email, pass from " + TABLE_NAME; | ||
Cursor cursor = db.rawQuery(query, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
Problem
This line of code might contain a resource leak. Resource leaks can cause your system to slow down or crash.
Fix
Consider closing the following resource: cursor. Currently, there are execution paths that do not contain closure statements. Either a) close cursor in a try-finally block or b) close the resource by declaring cursor in a try-with-resources block.
More info
View resource management guidelines at oracle.com (external link).
} | ||
|
||
public String mapShipmentOnButtonClick() { | ||
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
The SimpleDateFormat object was created without setting the time zone. Make sure that you want to use the default time zone or use letter z, Z or X in the pattern. Otherwise, if you don?t call setTimeZone() on the created SimpleDateFormat object, you might get an unexpected date and time when using the object.
} | ||
|
||
public String mapShipmentOnButtonClick() { | ||
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
The SimpleDateFormat object was created without setting the time zone. Make sure that you want to use the default time zone or use letter z, Z or X in the pattern. Otherwise, if you don?t call setTimeZone() on the created SimpleDateFormat object, you might get an unexpected date and time when using the object.
} | ||
|
||
public String mapShipmentOnButtonClick() { | ||
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
The SimpleDateFormat object was created without setting the time zone. Make sure that you want to use the default time zone or use letter z, Z or X in the pattern. Otherwise, if you don?t call setTimeZone() on the created SimpleDateFormat object, you might get an unexpected date and time when using the object.
} | ||
|
||
public String mapShipmentOnButtonClick() { | ||
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer
The SimpleDateFormat object was created without setting the time zone. Make sure that you want to use the default time zone or use letter z, Z or X in the pattern. Otherwise, if you don’t call setTimeZone() on the created SimpleDateFormat object, you might get an unexpected date and time when using the object.
No description provided.