Minor changes from inspection

This commit is contained in:
Sean Owen 2016-08-22 10:46:41 +01:00
parent 608dff8522
commit 33fd85e0c2
10 changed files with 16 additions and 29 deletions

View file

@ -97,7 +97,7 @@ import android.util.Log;
* <h2>Enabling experimental barcode formats</h2> * <h2>Enabling experimental barcode formats</h2>
* *
* <p>Some formats are not enabled by default even when scanning with {@link #ALL_CODE_TYPES}, such as * <p>Some formats are not enabled by default even when scanning with {@link #ALL_CODE_TYPES}, such as
* PDF417. Use {@link #initiateScan(java.util.Collection)} with * PDF417. Use {@link #initiateScan(Collection)} with
* a collection containing the names of formats to scan for explicitly, like "PDF_417", to use such * a collection containing the names of formats to scan for explicitly, like "PDF_417", to use such
* formats.</p> * formats.</p>
* *
@ -332,8 +332,8 @@ public class IntentIntegrator {
* *
* @param intent Intent to start. * @param intent Intent to start.
* @param code Request code for the activity * @param code Request code for the activity
* @see android.app.Activity#startActivityForResult(Intent, int) * @see Activity#startActivityForResult(Intent, int)
* @see android.app.Fragment#startActivityForResult(Intent, int) * @see Fragment#startActivityForResult(Intent, int)
*/ */
protected void startActivityForResult(Intent intent, int code) { protected void startActivityForResult(Intent intent, int code) {
if (fragment == null) { if (fragment == null) {

View file

@ -88,7 +88,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
private static final String[] ZXING_URLS = { "http://zxing.appspot.com/scan", "zxing://scan/" }; private static final String[] ZXING_URLS = { "http://zxing.appspot.com/scan", "zxing://scan/" };
public static final int HISTORY_REQUEST_CODE = 0x0000bacc; private static final int HISTORY_REQUEST_CODE = 0x0000bacc;
private static final Collection<ResultMetadataType> DISPLAYABLE_METADATA_TYPES = private static final Collection<ResultMetadataType> DISPLAYABLE_METADATA_TYPES =
EnumSet.of(ResultMetadataType.ISSUE_NUMBER, EnumSet.of(ResultMetadataType.ISSUE_NUMBER,

View file

@ -166,7 +166,7 @@ public final class LocaleManager {
return language; return language;
} }
public static String getTranslatedAssetLanguage() { static String getTranslatedAssetLanguage() {
String language = getSystemLanguage(); String language = getSystemLanguage();
return TRANSLATED_HELP_ASSET_LANGUAGES.contains(language) ? language : DEFAULT_LANGUAGE; return TRANSLATED_HELP_ASSET_LANGUAGES.contains(language) ? language : DEFAULT_LANGUAGE;
} }
@ -176,7 +176,7 @@ public final class LocaleManager {
return tld == null ? DEFAULT_TLD : tld; return tld == null ? DEFAULT_TLD : tld;
} }
public static String getCountry(Context context) { private static String getCountry(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String countryOverride = prefs.getString(PreferencesActivity.KEY_SEARCH_COUNTRY, "-"); String countryOverride = prefs.getString(PreferencesActivity.KEY_SEARCH_COUNTRY, "-");
if (countryOverride != null && !countryOverride.isEmpty() && !"-".equals(countryOverride)) { if (countryOverride != null && !countryOverride.isEmpty() && !"-".equals(countryOverride)) {

View file

@ -220,7 +220,7 @@ final class CameraConfigurationManager {
if (camera != null) { if (camera != null) {
Camera.Parameters parameters = camera.getParameters(); Camera.Parameters parameters = camera.getParameters();
if (parameters != null) { if (parameters != null) {
String flashMode = camera.getParameters().getFlashMode(); String flashMode = parameters.getFlashMode();
return flashMode != null && return flashMode != null &&
(Camera.Parameters.FLASH_MODE_ON.equals(flashMode) || (Camera.Parameters.FLASH_MODE_ON.equals(flashMode) ||
Camera.Parameters.FLASH_MODE_TORCH.equals(flashMode)); Camera.Parameters.FLASH_MODE_TORCH.equals(flashMode));

View file

@ -106,8 +106,7 @@ public final class ZXingTestActivity extends Activity {
public void onActivityResult(int requestCode, int resultCode, Intent intent) { public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent); IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (result != null) { if (result != null) {
String contents = result.getContents(); if (result.getContents() != null) {
if (contents != null) {
showDialog(R.string.result_succeeded, result.toString()); showDialog(R.string.result_succeeded, result.toString());
} else { } else {
showDialog(R.string.result_failed, getString(R.string.result_failed_why)); showDialog(R.string.result_failed, getString(R.string.result_failed_why));

View file

@ -48,7 +48,7 @@ public interface Reader {
* hints, each possibly associated to some data, which may help the implementation decode. * hints, each possibly associated to some data, which may help the implementation decode.
* *
* @param image image of barcode to decode * @param image image of barcode to decode
* @param hints passed as a {@link java.util.Map} from {@link DecodeHintType} * @param hints passed as a {@link Map} from {@link DecodeHintType}
* to arbitrary data. The * to arbitrary data. The
* meaning of the data depends upon the hint type. The implementation may or may not do * meaning of the data depends upon the hint type. The implementation may or may not do
* anything with these hints. * anything with these hints.

View file

@ -94,7 +94,7 @@ public final class MonochromeRectangleDetector {
* @param bottom maximum value of y * @param bottom maximum value of y
* @param maxWhiteRun maximum run of white pixels that can still be considered to be within * @param maxWhiteRun maximum run of white pixels that can still be considered to be within
* the barcode * the barcode
* @return a {@link com.google.zxing.ResultPoint} encapsulating the corner that was found * @return a {@link ResultPoint} encapsulating the corner that was found
* @throws NotFoundException if such a point cannot be found * @throws NotFoundException if such a point cannot be found
*/ */
private ResultPoint findCornerFromCenter(int centerX, private ResultPoint findCornerFromCenter(int centerX,

View file

@ -192,11 +192,8 @@ public final class WhiteRectangleDetector {
int maxSize = right - left; int maxSize = right - left;
ResultPoint z = null; ResultPoint z = null;
for (int i = 1; i < maxSize; i++) { for (int i = 1; z == null && i < maxSize; i++) {
z = getBlackPointOnSegment(left, down - i, left + i, down); z = getBlackPointOnSegment(left, down - i, left + i, down);
if (z != null) {
break;
}
} }
if (z == null) { if (z == null) {
@ -205,11 +202,8 @@ public final class WhiteRectangleDetector {
ResultPoint t = null; ResultPoint t = null;
//go down right //go down right
for (int i = 1; i < maxSize; i++) { for (int i = 1; t == null && i < maxSize; i++) {
t = getBlackPointOnSegment(left, up + i, left + i, up); t = getBlackPointOnSegment(left, up + i, left + i, up);
if (t != null) {
break;
}
} }
if (t == null) { if (t == null) {
@ -218,11 +212,8 @@ public final class WhiteRectangleDetector {
ResultPoint x = null; ResultPoint x = null;
//go down left //go down left
for (int i = 1; i < maxSize; i++) { for (int i = 1; x == null && i < maxSize; i++) {
x = getBlackPointOnSegment(right, up + i, right - i, up); x = getBlackPointOnSegment(right, up + i, right - i, up);
if (x != null) {
break;
}
} }
if (x == null) { if (x == null) {
@ -231,11 +222,8 @@ public final class WhiteRectangleDetector {
ResultPoint y = null; ResultPoint y = null;
//go up left //go up left
for (int i = 1; i < maxSize; i++) { for (int i = 1; y == null && i < maxSize; i++) {
y = getBlackPointOnSegment(right, down - i, right - i, down); y = getBlackPointOnSegment(right, down - i, right - i, down);
if (y != null) {
break;
}
} }
if (y == null) { if (y == null) {

View file

@ -132,7 +132,7 @@ public abstract class UPCEANReader extends OneDReader {
} }
/** /**
* <p>Like {@link #decodeRow(int, BitArray, java.util.Map)}, but * <p>Like {@link #decodeRow(int, BitArray, Map)}, but
* allows caller to inform method about where the UPC/EAN start pattern is * allows caller to inform method about where the UPC/EAN start pattern is
* found. This allows this to be computed once and reused across many implementations.</p> * found. This allows this to be computed once and reused across many implementations.</p>
* *

View file

@ -60,7 +60,7 @@
<plugin> <plugin>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId> <artifactId>jetty-maven-plugin</artifactId>
<version>9.4.0.M0</version> <version>9.4.0.M1</version>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>