[TIMOB-26218] Android: Resolve Veracode string equality warnings
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-08-24T01:19:58.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 7.5.0 |
| Components | Android |
| Labels | android, scanner, string |
| Reporter | Joshua Quick |
| Assignee | Joshua Quick |
| Created | 2018-07-19T21:21:58.000+0000 |
| Updated | 2018-08-24T01:20:02.000+0000 |
Description
*Summary:*
The Veracode scanner has sighted the following string equality/comparison issues in Titanium's Android Java code...
||Class||Line||Description||
|MediaModule.java|729|Member variable
intentType should use equals() instead of ==|
|TiBlob.java|263|Member variable mimeType should use equals() instead of ==.|
|TiBlob.java|421|Member variable mimeType should use ! equals() instead of !=.|
|TiCameraActivity.java|413|Member variable mediaType should use equals() instead of ==.|
|TiCameraActivity.java|682|Member variable mediaType should use equals() instead of ==.|
Note that there are no bugs in the above code.
String reference equality happens to work for the way it's written, but we should change to use equals() to avoid potential bugs in the future.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10208