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());
|
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);
|
implementations.put(minVersion, className);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T build() {
|
public final T build() {
|
||||||
for (Integer minVersion : implementations.keySet()) {
|
for (Integer minVersion : implementations.keySet()) {
|
||||||
if (Build.VERSION.SDK_INT >= minVersion) {
|
if (Build.VERSION.SDK_INT >= minVersion) {
|
||||||
String className = implementations.get(minVersion);
|
String className = implementations.get(minVersion);
|
||||||
|
|
|
@ -245,7 +245,6 @@ public final class HistoryManager {
|
||||||
} catch (SQLiteException sqle) {
|
} catch (SQLiteException sqle) {
|
||||||
// We're seeing an error here when called in CaptureActivity.onCreate() in rare cases
|
// 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.
|
// 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);
|
Log.w(TAG, sqle);
|
||||||
// continue
|
// continue
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -120,15 +120,15 @@ public abstract class ResultHandler {
|
||||||
shopperButton.setVisibility(View.GONE);
|
shopperButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParsedResult getResult() {
|
public final ParsedResult getResult() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasCustomProductSearch() {
|
final boolean hasCustomProductSearch() {
|
||||||
return customProductSearch != null;
|
return customProductSearch != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Activity getActivity() {
|
final Activity getActivity() {
|
||||||
return activity;
|
return activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ public abstract class ResultHandler {
|
||||||
*
|
*
|
||||||
* @param listener The on click listener to install for this button.
|
* @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);
|
View shopperButton = activity.findViewById(R.id.shopper_button);
|
||||||
shopperButton.setVisibility(View.VISIBLE);
|
shopperButton.setVisibility(View.VISIBLE);
|
||||||
shopperButton.setOnClickListener(listener);
|
shopperButton.setOnClickListener(listener);
|
||||||
|
@ -466,7 +466,7 @@ public abstract class ResultHandler {
|
||||||
*
|
*
|
||||||
* @throws ActivityNotFoundException
|
* @throws ActivityNotFoundException
|
||||||
*/
|
*/
|
||||||
void rawLaunchIntent(Intent intent) {
|
final void rawLaunchIntent(Intent intent) {
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||||
Log.d(TAG, "Launching intent: " + intent + " with extras: " + intent.getExtras());
|
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.
|
* 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 {
|
try {
|
||||||
rawLaunchIntent(intent);
|
rawLaunchIntent(intent);
|
||||||
} catch (ActivityNotFoundException e) {
|
} catch (ActivityNotFoundException e) {
|
||||||
|
@ -505,7 +505,7 @@ public abstract class ResultHandler {
|
||||||
return customProductSearch;
|
return customProductSearch;
|
||||||
}
|
}
|
||||||
|
|
||||||
String fillInCustomSearchURL(String text) {
|
final String fillInCustomSearchURL(String text) {
|
||||||
if (customProductSearch == null) {
|
if (customProductSearch == null) {
|
||||||
return text; // ?
|
return text; // ?
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ public abstract class SupplementalInfoRetriever extends AsyncTask<Object,Object,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Object arg) {
|
protected final void onPostExecute(Object arg) {
|
||||||
TextView textView = textViewRef.get();
|
TextView textView = textViewRef.get();
|
||||||
if (textView != null) {
|
if (textView != null) {
|
||||||
for (Spannable content : newContents) {
|
for (Spannable content : newContents) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ final class LoadPackagesAsyncTask extends AsyncTask<List<String[]>,Object,List<S
|
||||||
activity.setListAdapter(listAdapter);
|
activity.setListAdapter(listAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class ByFirstStringComparator implements Comparator<String[]>, Serializable {
|
private static final class ByFirstStringComparator implements Comparator<String[]>, Serializable {
|
||||||
@Override
|
@Override
|
||||||
public int compare(String[] o1, String[] o2) {
|
public int compare(String[] o1, String[] o2) {
|
||||||
return o1[0].compareTo(o2[0]);
|
return o1[0].compareTo(o2[0]);
|
||||||
|
|
Loading…
Reference in a new issue