Add some final keywords

This commit is contained in:
Daniel Martí 2015-01-03 19:38:54 +01:00
parent 623748091d
commit 1405705fd5
4 changed files with 11 additions and 11 deletions

View File

@ -1158,7 +1158,7 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
Apk curApk = null; Apk curApk = null;
for (int i = 0; i < getApks().getCount(); i ++) { for (int i = 0; i < getApks().getCount(); i ++) {
Apk apk = getApks().getItem(i); final Apk apk = getApks().getItem(i);
if (apk.vercode == getApp().suggestedVercode) { if (apk.vercode == getApp().suggestedVercode) {
curApk = apk; curApk = apk;
break; break;
@ -1178,7 +1178,7 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
Iterator<String> permissions = permsList.iterator(); Iterator<String> permissions = permsList.iterator();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
while (permissions.hasNext()) { while (permissions.hasNext()) {
String permissionName = permissions.next(); final String permissionName = permissions.next();
try { try {
Permission permission = new Permission(getActivity(), permissionName); Permission permission = new Permission(getActivity(), permissionName);
// TODO: Make this list RTL friendly // TODO: Make this list RTL friendly
@ -1205,7 +1205,7 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
if (getApp().antiFeatures != null) { if (getApp().antiFeatures != null) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (String af : getApp().antiFeatures) { for (String af : getApp().antiFeatures) {
String afdesc = descAntiFeature(af); final String afdesc = descAntiFeature(af);
if (afdesc != null) { if (afdesc != null) {
sb.append("\t• ").append(afdesc).append("\n"); sb.append("\t• ").append(afdesc).append("\n");
} }

View File

@ -171,7 +171,7 @@ public class FDroidApp extends Application {
// Things can be null if the SD card is not ready - we'll just // Things can be null if the SD card is not ready - we'll just
// ignore that and do it next time. // ignore that and do it next time.
if (local_path != null) { if (local_path != null) {
File[] files = local_path.listFiles(); final File[] files = local_path.listFiles();
if (files != null) { if (files != null) {
for (File f : files) { for (File f : files) {
if (f.getName().endsWith(".apk")) { if (f.getName().endsWith(".apk")) {

View File

@ -103,7 +103,7 @@ public class RepoXMLHandler extends DefaultHandler {
throws SAXException { throws SAXException {
super.endElement(uri, localName, qName); super.endElement(uri, localName, qName);
String curel = localName; final String curel = localName;
String str = curchars.toString(); String str = curchars.toString();
if (str != null) { if (str != null) {
str = str.trim(); str = str.trim();
@ -253,28 +253,28 @@ public class RepoXMLHandler extends DefaultHandler {
super.startElement(uri, localName, qName, attributes); super.startElement(uri, localName, qName, attributes);
if (localName.equals("repo")) { if (localName.equals("repo")) {
String pk = attributes.getValue("", "pubkey"); final String pk = attributes.getValue("", "pubkey");
if (pk != null) if (pk != null)
pubkey = pk; pubkey = pk;
String maxAgeAttr = attributes.getValue("", "maxage"); final String maxAgeAttr = attributes.getValue("", "maxage");
if (maxAgeAttr != null) { if (maxAgeAttr != null) {
try { try {
maxage = Integer.parseInt(maxAgeAttr); maxage = Integer.parseInt(maxAgeAttr);
} catch (NumberFormatException nfe) {} } catch (NumberFormatException nfe) {}
} }
String versionAttr = attributes.getValue("", "version"); final String versionAttr = attributes.getValue("", "version");
if (versionAttr != null) { if (versionAttr != null) {
try { try {
version = Integer.parseInt(versionAttr); version = Integer.parseInt(versionAttr);
} catch (NumberFormatException nfe) {} } catch (NumberFormatException nfe) {}
} }
String nm = attributes.getValue("", "name"); final String nm = attributes.getValue("", "name");
if (nm != null) if (nm != null)
name = cleanWhiteSpace(nm); name = cleanWhiteSpace(nm);
String dc = attributes.getValue("", "description"); final String dc = attributes.getValue("", "description");
if (dc != null) if (dc != null)
description = cleanWhiteSpace(dc); description = cleanWhiteSpace(dc);

View File

@ -161,7 +161,7 @@ public class UpdateService extends IntentService implements ProgressListener {
@Override @Override
protected void onReceiveResult(int resultCode, Bundle resultData) { protected void onReceiveResult(int resultCode, Bundle resultData) {
String message = resultData.getString(UpdateService.RESULT_MESSAGE); final String message = resultData.getString(UpdateService.RESULT_MESSAGE);
boolean finished = false; boolean finished = false;
if (resultCode == UpdateService.STATUS_ERROR_GLOBAL) { if (resultCode == UpdateService.STATUS_ERROR_GLOBAL) {
forwardEvent(EVENT_ERROR); forwardEvent(EVENT_ERROR);