mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Add missing annotations
This commit is contained in:
		
							parent
							
								
									9658f18fea
								
							
						
					
					
						commit
						79a22c1aca
					
				
					 7 changed files with 23 additions and 18 deletions
				
			
		|  | @ -7,6 +7,7 @@ import android.database.Cursor; | |||
| import android.database.sqlite.SQLiteDatabase; | ||||
| import android.database.sqlite.SQLiteQueryBuilder; | ||||
| import android.net.Uri; | ||||
| import android.support.annotation.NonNull; | ||||
| import android.text.TextUtils; | ||||
| 
 | ||||
| import fr.free.nrw.commons.CommonsApplication; | ||||
|  | @ -39,7 +40,7 @@ public class ModificationsContentProvider extends ContentProvider{ | |||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { | ||||
|     public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { | ||||
|         SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder(); | ||||
|         queryBuilder.setTables(ModifierSequence.Table.TABLE_NAME); | ||||
| 
 | ||||
|  | @ -61,12 +62,12 @@ public class ModificationsContentProvider extends ContentProvider{ | |||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String getType(Uri uri) { | ||||
|     public String getType(@NonNull Uri uri) { | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Uri insert(Uri uri, ContentValues contentValues) { | ||||
|     public Uri insert(@NonNull Uri uri, ContentValues contentValues) { | ||||
|         int uriType = uriMatcher.match(uri); | ||||
|         SQLiteDatabase sqlDB = CommonsApplication.getInstance().getDBOpenHelper().getWritableDatabase(); | ||||
|         long id = 0; | ||||
|  | @ -82,7 +83,7 @@ public class ModificationsContentProvider extends ContentProvider{ | |||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int delete(Uri uri, String s, String[] strings) { | ||||
|     public int delete(@NonNull Uri uri, String s, String[] strings) { | ||||
|         int uriType = uriMatcher.match(uri); | ||||
|         SQLiteDatabase sqlDB = CommonsApplication.getInstance().getDBOpenHelper().getWritableDatabase(); | ||||
|         switch (uriType) { | ||||
|  | @ -99,7 +100,7 @@ public class ModificationsContentProvider extends ContentProvider{ | |||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int bulkInsert(Uri uri, ContentValues[] values) { | ||||
|     public int bulkInsert(@NonNull Uri uri, @NonNull ContentValues[] values) { | ||||
|         Timber.d("Hello, bulk insert! (ModificationsContentProvider)"); | ||||
|         int uriType = uriMatcher.match(uri); | ||||
|         SQLiteDatabase sqlDB = CommonsApplication.getInstance().getDBOpenHelper().getWritableDatabase(); | ||||
|  | @ -121,7 +122,7 @@ public class ModificationsContentProvider extends ContentProvider{ | |||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int update(Uri uri, ContentValues contentValues, String selection, String[] selectionArgs) { | ||||
|     public int update(@NonNull Uri uri, ContentValues contentValues, String selection, String[] selectionArgs) { | ||||
|         /* | ||||
|         SQL Injection warnings: First, note that we're not exposing this to the outside world (exported="false") | ||||
|         Even then, we should make sure to sanitize all user input appropriately. Input that passes through ContentValues | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Mikel
						Mikel