Remove unnecessary "new Type[]" when declaring arrays
This commit is contained in:
parent
0fde562b32
commit
713e33bf57
@ -541,7 +541,7 @@ public class UpdateService extends IntentService implements ProgressListener {
|
||||
private List<String> getKnownAppIdsFromProvider(List<App> apps) {
|
||||
|
||||
final Uri uri = AppProvider.getContentUri(apps);
|
||||
String[] fields = new String[] { AppProvider.DataColumns.APP_ID };
|
||||
String[] fields = { AppProvider.DataColumns.APP_ID };
|
||||
Cursor cursor = getContentResolver().query(uri, fields, null, null, null);
|
||||
|
||||
int knownIdCount = cursor != null ? cursor.getCount() : 0;
|
||||
|
@ -301,13 +301,13 @@ public class ApkProvider extends FDroidProvider {
|
||||
|
||||
private QuerySelection queryApp(String appId) {
|
||||
String selection = DataColumns.APK_ID + " = ? ";
|
||||
String[] args = new String[] { appId };
|
||||
String[] args = { appId };
|
||||
return new QuerySelection(selection, args);
|
||||
}
|
||||
|
||||
private QuerySelection querySingle(Uri uri) {
|
||||
String selection = " vercode = ? and id = ? ";
|
||||
String[] args = new String[] {
|
||||
String[] args = {
|
||||
// First (0th) path segment is the word "apk",
|
||||
// and we are not interested in it.
|
||||
uri.getPathSegments().get(1),
|
||||
@ -318,7 +318,7 @@ public class ApkProvider extends FDroidProvider {
|
||||
|
||||
private QuerySelection queryRepo(long repoId) {
|
||||
String selection = DataColumns.REPO_ID + " = ? ";
|
||||
String[] args = new String[]{ Long.toString(repoId) };
|
||||
String[] args = { Long.toString(repoId) };
|
||||
return new QuerySelection(selection, args);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class AppProvider extends FDroidProvider {
|
||||
private Helper() {}
|
||||
|
||||
public static int count(Context context, Uri uri) {
|
||||
String[] projection = new String[] { AppProvider.DataColumns._COUNT };
|
||||
String[] projection = { AppProvider.DataColumns._COUNT };
|
||||
Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null);
|
||||
int count = 0;
|
||||
if (cursor != null && cursor.getCount() == 1) {
|
||||
|
@ -72,11 +72,11 @@ public class SystemInstaller extends Installer {
|
||||
mDeleteObserver = new PackageDeleteObserver();
|
||||
|
||||
try {
|
||||
Class<?>[] installTypes = new Class[] {
|
||||
Class<?>[] installTypes = {
|
||||
Uri.class, IPackageInstallObserver.class, int.class,
|
||||
String.class
|
||||
};
|
||||
Class<?>[] deleteTypes = new Class[] {
|
||||
Class<?>[] deleteTypes = {
|
||||
String.class, IPackageDeleteObserver.class,
|
||||
int.class
|
||||
};
|
||||
|
@ -271,7 +271,7 @@ public class LocalRepoKeyStore {
|
||||
private void addToStore(String alias, KeyPair kp, Certificate cert) throws KeyStoreException,
|
||||
NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException,
|
||||
UnrecoverableKeyException {
|
||||
Certificate[] chain = new Certificate[] {
|
||||
Certificate[] chain = {
|
||||
cert
|
||||
};
|
||||
keyStore.setKeyEntry(alias, kp.getPrivate(),
|
||||
|
@ -94,7 +94,7 @@ public class MDnsHelper implements ServiceListener {
|
||||
protected Void doInBackground(Void... params) {
|
||||
try {
|
||||
int ip = wifiManager.getConnectionInfo().getIpAddress();
|
||||
byte[] byteIp = new byte[] {
|
||||
byte[] byteIp = {
|
||||
(byte) (ip & 0xff),
|
||||
(byte) (ip >> 8 & 0xff),
|
||||
(byte) (ip >> 16 & 0xff),
|
||||
|
@ -613,7 +613,7 @@ public class ManageReposActivity extends ActionBarActivity {
|
||||
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
|
||||
Uri uri = RepoProvider.getContentUri();
|
||||
Log.i(TAG, "Creating repo loader '" + uri + "'.");
|
||||
String[] projection = new String[] {
|
||||
String[] projection = {
|
||||
RepoProvider.DataColumns._ID,
|
||||
RepoProvider.DataColumns.NAME,
|
||||
RepoProvider.DataColumns.PUBLIC_KEY,
|
||||
|
@ -53,7 +53,7 @@ public class RepoDetailsActivity extends ActionBarActivity {
|
||||
.commit();
|
||||
}
|
||||
|
||||
String[] projection = new String[] {
|
||||
String[] projection = {
|
||||
RepoProvider.DataColumns.NAME,
|
||||
RepoProvider.DataColumns.ADDRESS,
|
||||
RepoProvider.DataColumns.FINGERPRINT
|
||||
|
Loading…
x
Reference in New Issue
Block a user