mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Changes from code inspection
git-svn-id: https://zxing.googlecode.com/svn/trunk@2526 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
0288f08c1c
commit
3bad6fc4c5
|
@ -62,11 +62,11 @@ public abstract class PlatformSupportManager<T> {
|
|||
this.implementations = new TreeMap<Integer,String>(Collections.reverseOrder());
|
||||
}
|
||||
|
||||
protected void addImplementationClass(int minVersion, String className) {
|
||||
protected final void addImplementationClass(int minVersion, String className) {
|
||||
implementations.put(minVersion, className);
|
||||
}
|
||||
|
||||
public T build() {
|
||||
public final T build() {
|
||||
for (Integer minVersion : implementations.keySet()) {
|
||||
if (Build.VERSION.SDK_INT >= minVersion) {
|
||||
String className = implementations.get(minVersion);
|
||||
|
|
|
@ -245,7 +245,6 @@ public final class HistoryManager {
|
|||
} catch (SQLiteException sqle) {
|
||||
// We're seeing an error here when called in CaptureActivity.onCreate() in rare cases
|
||||
// and don't understand it. First theory is that it's transient so can be safely ignored.
|
||||
// TODO revisit this after live in a future version to see if it 'worked'
|
||||
Log.w(TAG, sqle);
|
||||
// continue
|
||||
} finally {
|
||||
|
|
|
@ -120,15 +120,15 @@ public abstract class ResultHandler {
|
|||
shopperButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public ParsedResult getResult() {
|
||||
public final ParsedResult getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
boolean hasCustomProductSearch() {
|
||||
final boolean hasCustomProductSearch() {
|
||||
return customProductSearch != null;
|
||||
}
|
||||
|
||||
Activity getActivity() {
|
||||
final Activity getActivity() {
|
||||
return activity;
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ public abstract class ResultHandler {
|
|||
*
|
||||
* @param listener The on click listener to install for this button.
|
||||
*/
|
||||
void showGoogleShopperButton(View.OnClickListener listener) {
|
||||
final void showGoogleShopperButton(View.OnClickListener listener) {
|
||||
View shopperButton = activity.findViewById(R.id.shopper_button);
|
||||
shopperButton.setVisibility(View.VISIBLE);
|
||||
shopperButton.setOnClickListener(listener);
|
||||
|
@ -466,7 +466,7 @@ public abstract class ResultHandler {
|
|||
*
|
||||
* @throws ActivityNotFoundException
|
||||
*/
|
||||
void rawLaunchIntent(Intent intent) {
|
||||
final void rawLaunchIntent(Intent intent) {
|
||||
if (intent != null) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||
Log.d(TAG, "Launching intent: " + intent + " with extras: " + intent.getExtras());
|
||||
|
@ -477,7 +477,7 @@ public abstract class ResultHandler {
|
|||
/**
|
||||
* Like {@link #rawLaunchIntent(Intent)} but will show a user dialog if nothing is available to handle.
|
||||
*/
|
||||
void launchIntent(Intent intent) {
|
||||
final void launchIntent(Intent intent) {
|
||||
try {
|
||||
rawLaunchIntent(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
|
@ -505,7 +505,7 @@ public abstract class ResultHandler {
|
|||
return customProductSearch;
|
||||
}
|
||||
|
||||
String fillInCustomSearchURL(String text) {
|
||||
final String fillInCustomSearchURL(String text) {
|
||||
if (customProductSearch == null) {
|
||||
return text; // ?
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public abstract class SupplementalInfoRetriever extends AsyncTask<Object,Object,
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Object arg) {
|
||||
protected final void onPostExecute(Object arg) {
|
||||
TextView textView = textViewRef.get();
|
||||
if (textView != null) {
|
||||
for (Spannable content : newContents) {
|
||||
|
|
|
@ -97,7 +97,7 @@ final class LoadPackagesAsyncTask extends AsyncTask<List<String[]>,Object,List<S
|
|||
activity.setListAdapter(listAdapter);
|
||||
}
|
||||
|
||||
private static class ByFirstStringComparator implements Comparator<String[]>, Serializable {
|
||||
private static final class ByFirstStringComparator implements Comparator<String[]>, Serializable {
|
||||
@Override
|
||||
public int compare(String[] o1, String[] o2) {
|
||||
return o1[0].compareTo(o2[0]);
|
||||
|
|
Loading…
Reference in a new issue