Compact very simple getters in a single line

This commit is contained in:
Daniel Martí 2015-04-16 18:32:31 +02:00
parent 33fd77e3b8
commit d6a8ef9e59
11 changed files with 45 additions and 135 deletions

View File

@ -1091,24 +1091,16 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
}
@Override
public App getApp() {
return app;
}
public App getApp() { return app; }
@Override
public ApkListAdapter getApks() {
return adapter;
}
public ApkListAdapter getApks() { return adapter; }
@Override
public Signature getInstalledSignature() {
return mInstalledSignature;
}
public Signature getInstalledSignature() { return mInstalledSignature; }
@Override
public String getInstalledSignatureId() {
return mInstalledSigID;
}
public String getInstalledSignatureId() { return mInstalledSigID; }
public static class AppDetailsSummaryFragment extends Fragment {
@ -1125,21 +1117,13 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
data = (AppDetailsData)activity;
}
protected App getApp() {
return data.getApp();
}
protected App getApp() { return data.getApp(); }
protected ApkListAdapter getApks() {
return data.getApks();
}
protected ApkListAdapter getApks() { return data.getApks(); }
protected Signature getInstalledSignature() {
return data.getInstalledSignature();
}
protected Signature getInstalledSignature() { return data.getInstalledSignature(); }
protected String getInstalledSignatureId() {
return data.getInstalledSignatureId();
}
protected String getInstalledSignatureId() { return data.getInstalledSignatureId(); }
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -1294,13 +1278,9 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
.build();
}
private App getApp() {
return data.getApp();
}
private App getApp() { return data.getApp(); }
private ApkListAdapter getApks() {
return data.getApks();
}
private ApkListAdapter getApks() { return data.getApks(); }
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -1385,13 +1365,9 @@ public class AppDetails extends ActionBarActivity implements ProgressListener, A
installListener.removeApk(getApp().id);
}
protected App getApp() {
return data.getApp();
}
protected App getApp() { return data.getApp(); }
protected ApkListAdapter getApks() {
return data.getApks();
}
protected ApkListAdapter getApks() { return data.getApks(); }
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {

View File

@ -41,9 +41,7 @@ public interface ProgressListener {
}
@Override
public int describeContents() {
return 0;
}
public int describeContents() { return 0; }
@Override
public void writeToParcel(Parcel dest, int flags) {
@ -72,9 +70,7 @@ public interface ProgressListener {
* so we pass that through to the downloader when we set the progress listener. This way,
* we can ask the event for the name of the repo.
*/
public Bundle getData() {
return data;
}
public Bundle getData() { return data; }
}
}

View File

@ -72,13 +72,9 @@ public class RepoXMLHandler extends DefaultHandler {
progressListener = listener;
}
public List<App> getApps() {
return apps;
}
public List<App> getApps() { return apps; }
public List<Apk> getApks() {
return apksList;
}
public List<Apk> getApks() { return apksList; }
public int getMaxAge() { return maxage; }
@ -88,9 +84,7 @@ public class RepoXMLHandler extends DefaultHandler {
public String getName() { return name; }
public String getPubKey() {
return pubkey;
}
public String getPubKey() { return pubkey; }
@Override
public void characters(char[] ch, int start, int length) {

View File

@ -45,7 +45,5 @@ class HoneycombClipboard extends ClipboardCompat {
class OldClipboard extends ClipboardCompat {
@Override
public String getText() {
return null;
}
public String getText() { return null; }
}

View File

@ -430,7 +430,5 @@ public class App extends ValueObject implements Comparable<App> {
return new AppFilter().filter(this);
}
public String getSuggestedVersion() {
return suggestedVersion;
}
public String getSuggestedVersion() { return suggestedVersion; }
}

View File

@ -509,23 +509,17 @@ public class AppProvider extends FDroidProvider {
}
@Override
protected String getTableName() {
return DBHelper.TABLE_APP;
}
protected String getTableName() { return DBHelper.TABLE_APP; }
@Override
protected String getProviderName() {
return "AppProvider";
}
protected String getProviderName() { return "AppProvider"; }
public static String getAuthority() {
return AUTHORITY + "." + PROVIDER_NAME;
}
@Override
protected UriMatcher getMatcher() {
return matcher;
}
protected UriMatcher getMatcher() { return matcher; }
private AppQuerySelection queryCanUpdate() {
String ignoreCurrent = " fdroid_app.ignoreThisUpdate != fdroid_app.suggestedVercode ";

View File

@ -101,21 +101,13 @@ public class NewRepoConfig {
}
public String getBssid() {
return bssid;
}
public String getBssid() { return bssid; }
public String getSsid() {
return ssid;
}
public String getSsid() { return ssid; }
public int getPort() {
return port;
}
public int getPort() { return port; }
public String getRepoUriString() {
return uriString;
}
public String getRepoUriString() { return uriString; }
/**
* This is the URI which was passed to the NewRepoConfig for parsing.
@ -123,9 +115,7 @@ public class NewRepoConfig {
* ssid, bssid, and perhaps other query parameters. If you want the actual repo
* URL, then you will probably want {@link org.fdroid.fdroid.data.NewRepoConfig#getRepoUri()}.
*/
public Uri getParsedUri() {
return uri;
}
public Uri getParsedUri() { return uri; }
public Uri getRepoUri() {
if (uriString == null) {
@ -135,29 +125,17 @@ public class NewRepoConfig {
}
}
public String getHost() {
return host;
}
public String getHost() { return host; }
public String getScheme() {
return scheme;
}
public String getScheme() { return scheme; }
public String getFingerprint() {
return fingerprint;
}
public String getFingerprint() { return fingerprint; }
public boolean isValidRepo() {
return isValidRepo;
}
public boolean isValidRepo() { return isValidRepo; }
public boolean isFromSwap() {
return fromSwap;
}
public boolean isFromSwap() { return fromSwap; }
public boolean preventFurtherSwaps() {
return preventFurtherSwaps;
}
public boolean preventFurtherSwaps() { return preventFurtherSwaps; }
/*
* The port starts out as 8888, but if there is a conflict, it will be
@ -167,9 +145,7 @@ public class NewRepoConfig {
return (port >= 8888 && host.matches("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"));
}
public String getErrorMessage() {
return errorMessage;
}
public String getErrorMessage() { return errorMessage; }
/** Sanitize and format an incoming repo URI for function and readability */
public static String sanitizeRepoUri(Uri uri) {

View File

@ -31,13 +31,9 @@ public class QuerySelection {
this.selection = selection;
}
public String[] getArgs() {
return args;
}
public String[] getArgs() { return args; }
public String getSelection() {
return selection;
}
public String getSelection() { return selection; }
public boolean hasSelection() {
return selection != null && selection.length() > 0;

View File

@ -85,14 +85,10 @@ public class Repo extends ValueObject {
public long getId() { return id; }
public String getName() {
return name;
}
public String getName() { return name; }
@Override
public String toString() {
return address;
}
public String toString() { return address; }
public boolean isSigned() {
return !TextUtils.isEmpty(this.pubkey);

View File

@ -272,15 +272,9 @@ public class ApkDownloader implements AsyncDownloadWrapper.Listener {
}
}
public Apk getApk() {
return curApk;
}
public Apk getApk() { return curApk; }
public int getProgress() {
return progress;
}
public int getProgress() { return progress; }
public int getTotalSize() {
return totalSize;
}
public int getTotalSize() { return totalSize; }
}

View File

@ -64,17 +64,11 @@ abstract public class RepoUpdater {
this.progressListener = progressListener;
}
public boolean hasChanged() {
return hasChanged;
}
public boolean hasChanged() { return hasChanged; }
public List<App> getApps() {
return apps;
}
public List<App> getApps() { return apps; }
public List<Apk> getApks() {
return apks;
}
public List<Apk> getApks() { return apks; }
/**
* For example, you may want to unzip a jar file to get the index inside,
@ -238,9 +232,7 @@ abstract public class RepoUpdater {
return values;
}
public RepoUpdateRememberer getRememberer() {
return rememberer;
}
public RepoUpdateRememberer getRememberer() { return rememberer; }
public static class RepoUpdateRememberer {