Skip to content

Adding a release to the demo branch - #1

Open
MikeSourceCode wants to merge 1 commit into
masterfrom
demo
Open

Adding a release to the demo branch#1
MikeSourceCode wants to merge 1 commit into
masterfrom
demo

Conversation

@MikeSourceCode

Copy link
Copy Markdown
Owner

No description provided.

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(',')));

Copy link
Copy Markdown
Owner Author

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.

urlConnection.connect();

InputStream inputStream = urlConnection.getInputStream();
FileOutputStream fileOutputStream = new FileOutputStream(directory);

Copy link
Copy Markdown
Owner Author

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).

db = this.getReadableDatabase();

String query = "select email, pass from " + TABLE_NAME;
Cursor cursor = db.rawQuery(query, null);

Copy link
Copy Markdown
Owner Author

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).

List<Float> dim = new ArrayList<>();
if (secondResponse != null) {

l = Float.parseFloat(firstResponse.substring(0, firstResponse.indexOf(',')));

Copy link
Copy Markdown
Owner Author

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.

}

public String mapShipmentOnButtonClick() {
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd");

Copy link
Copy Markdown
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant