[infer][tests] cleanup of the Cursor NPE test file

Summary:
- The package declaration was wrong
- There was a leftover copy-pasted resource leak test from `CursorLeak.java`.

Reviewed By: sblackshear

Differential Revision: D4612687

fbshipit-source-id: 42c1a35
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent 171083fbba
commit b63a656dc4

@ -23,7 +23,6 @@ codetoanalyze/java/infer/CursorLeaks.java, int CursorLeaks.getImageCountHelperNo
codetoanalyze/java/infer/CursorLeaks.java, void CursorLeaks.loadPrefsFromContentProviderNotClosed(), 11, RESOURCE_LEAK, [start of procedure loadPrefsFromContentProviderNotClosed(),Taking false branch,Taking true branch]
codetoanalyze/java/infer/CursorLeaks.java, void CursorLeaks.queryUVMLegacyDbNotClosed(), 4, RESOURCE_LEAK, [start of procedure queryUVMLegacyDbNotClosed(),Taking true branch]
codetoanalyze/java/infer/CursorNPEs.java, int CursorNPEs.cursorFromDownloadManagerNPE(DownloadManager), 5, NULL_DEREFERENCE, [start of procedure cursorFromDownloadManagerNPE(...)]
codetoanalyze/java/infer/CursorNPEs.java, int CursorNPEs.cursorNotClosed(SQLiteDatabase), 7, RESOURCE_LEAK, [start of procedure cursorNotClosed(...),Taking false branch]
codetoanalyze/java/infer/CursorNPEs.java, void CursorNPEs.cursorFromContentResolverNPE(String), 12, NULL_DEREFERENCE, [start of procedure cursorFromContentResolverNPE(...)]
codetoanalyze/java/infer/CursorNPEs.java, void CursorNPEs.cursorFromMediaNPE(), 3, NULL_DEREFERENCE, [start of procedure cursorFromMediaNPE()]
codetoanalyze/java/infer/DynamicDispatch.java, void DynamicDispatch$WithField.dispatchOnFieldBad(), 3, NULL_DEREFERENCE, [start of procedure dispatchOnFieldBad(),start of procedure DynamicDispatch$Subtype(),start of procedure DynamicDispatch$Supertype(),return from a call to DynamicDispatch$Supertype.<init>(),return from a call to DynamicDispatch$Subtype.<init>(),start of procedure DynamicDispatch$WithField(...),return from a call to DynamicDispatch$WithField.<init>(DynamicDispatch$Subtype),start of procedure foo(),return from a call to Object DynamicDispatch$Subtype.foo()]

@ -23,7 +23,6 @@ infer/tests/codetoanalyze/java/infer/CursorLeaks.java, int CursorLeaks.getImageC
infer/tests/codetoanalyze/java/infer/CursorLeaks.java, void CursorLeaks.loadPrefsFromContentProviderNotClosed(), 11, RESOURCE_LEAK, [start of procedure loadPrefsFromContentProviderNotClosed(),Taking false branch,Taking true branch]
infer/tests/codetoanalyze/java/infer/CursorLeaks.java, void CursorLeaks.queryUVMLegacyDbNotClosed(), 4, RESOURCE_LEAK, [start of procedure queryUVMLegacyDbNotClosed(),Taking true branch]
infer/tests/codetoanalyze/java/infer/CursorNPEs.java, int CursorNPEs.cursorFromDownloadManagerNPE(DownloadManager), 5, NULL_DEREFERENCE, [start of procedure cursorFromDownloadManagerNPE(...)]
infer/tests/codetoanalyze/java/infer/CursorNPEs.java, int CursorNPEs.cursorNotClosed(SQLiteDatabase), 7, RESOURCE_LEAK, [start of procedure cursorNotClosed(...),Taking false branch]
infer/tests/codetoanalyze/java/infer/CursorNPEs.java, void CursorNPEs.cursorFromContentResolverNPE(String), 12, NULL_DEREFERENCE, [start of procedure cursorFromContentResolverNPE(...)]
infer/tests/codetoanalyze/java/infer/CursorNPEs.java, void CursorNPEs.cursorFromMediaNPE(), 3, NULL_DEREFERENCE, [start of procedure cursorFromMediaNPE()]
infer/tests/codetoanalyze/java/infer/DynamicDispatch.java, void DynamicDispatch$WithField.dispatchOnFieldBad(), 3, NULL_DEREFERENCE, [start of procedure dispatchOnFieldBad(),start of procedure DynamicDispatch$Subtype(),start of procedure DynamicDispatch$Supertype(),return from a call to DynamicDispatch$Supertype.<init>(),return from a call to DynamicDispatch$Subtype.<init>(),start of procedure DynamicDispatch$WithField(...),return from a call to DynamicDispatch$WithField.<init>(DynamicDispatch$Subtype),start of procedure foo(),return from a call to Object DynamicDispatch$Subtype.foo()]

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
package codetoanalyze.java.errors;
package codetoanalyze.java.infer;
import android.app.DownloadManager;
@ -33,17 +33,6 @@ public class CursorNPEs {
}
}
public int cursorNotClosed(SQLiteDatabase sqLiteDatabase) {
Cursor cursor = sqLiteDatabase.query(
"events", null,
null, null, null, null, null);
if (cursor == null) {
return 0;
} else {
return cursor.getCount();
}
}
Context mContext;
ContentResolver mContentResolver;

@ -47,7 +47,6 @@ codetoanalyze/java/infer/CursorLeaks.java, void CursorLeaks.loadPrefsFromContent
codetoanalyze/java/infer/CursorLeaks.java, void CursorLeaks.loadPrefsFromContentProviderNotClosed(), 11, RESOURCE_LEAK, [start of procedure loadPrefsFromContentProviderNotClosed(),Taking false branch,Taking true branch]
codetoanalyze/java/infer/CursorLeaks.java, void CursorLeaks.queryUVMLegacyDbNotClosed(), 4, RESOURCE_LEAK, [start of procedure queryUVMLegacyDbNotClosed(),Taking true branch]
codetoanalyze/java/infer/CursorNPEs.java, int CursorNPEs.cursorFromDownloadManagerNPE(DownloadManager), 5, NULL_DEREFERENCE, [start of procedure cursorFromDownloadManagerNPE(...)]
codetoanalyze/java/infer/CursorNPEs.java, int CursorNPEs.cursorNotClosed(SQLiteDatabase), 7, RESOURCE_LEAK, [start of procedure cursorNotClosed(...),Taking false branch]
codetoanalyze/java/infer/CursorNPEs.java, void CursorNPEs.cursorFromContentProviderClient(), 3, NULL_TEST_AFTER_DEREFERENCE, [start of procedure cursorFromContentProviderClient(),Taking false branch]
codetoanalyze/java/infer/CursorNPEs.java, void CursorNPEs.cursorFromContentResolverNPE(String), 12, NULL_DEREFERENCE, [start of procedure cursorFromContentResolverNPE(...)]
codetoanalyze/java/infer/CursorNPEs.java, void CursorNPEs.cursorFromMediaNPE(), 3, NULL_DEREFERENCE, [start of procedure cursorFromMediaNPE()]

Loading…
Cancel
Save