mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Minor changes from inspection
This commit is contained in:
parent
608dff8522
commit
33fd85e0c2
|
@ -97,7 +97,7 @@ import android.util.Log;
|
|||
* <h2>Enabling experimental barcode formats</h2>
|
||||
*
|
||||
* <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
|
||||
* formats.</p>
|
||||
*
|
||||
|
@ -332,8 +332,8 @@ public class IntentIntegrator {
|
|||
*
|
||||
* @param intent Intent to start.
|
||||
* @param code Request code for the activity
|
||||
* @see android.app.Activity#startActivityForResult(Intent, int)
|
||||
* @see android.app.Fragment#startActivityForResult(Intent, int)
|
||||
* @see Activity#startActivityForResult(Intent, int)
|
||||
* @see Fragment#startActivityForResult(Intent, int)
|
||||
*/
|
||||
protected void startActivityForResult(Intent intent, int code) {
|
||||
if (fragment == null) {
|
||||
|
|
|
@ -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/" };
|
||||
|
||||
public static final int HISTORY_REQUEST_CODE = 0x0000bacc;
|
||||
private static final int HISTORY_REQUEST_CODE = 0x0000bacc;
|
||||
|
||||
private static final Collection<ResultMetadataType> DISPLAYABLE_METADATA_TYPES =
|
||||
EnumSet.of(ResultMetadataType.ISSUE_NUMBER,
|
||||
|
|
|
@ -166,7 +166,7 @@ public final class LocaleManager {
|
|||
return language;
|
||||
}
|
||||
|
||||
public static String getTranslatedAssetLanguage() {
|
||||
static String getTranslatedAssetLanguage() {
|
||||
String language = getSystemLanguage();
|
||||
return TRANSLATED_HELP_ASSET_LANGUAGES.contains(language) ? language : DEFAULT_LANGUAGE;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ public final class LocaleManager {
|
|||
return tld == null ? DEFAULT_TLD : tld;
|
||||
}
|
||||
|
||||
public static String getCountry(Context context) {
|
||||
private static String getCountry(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
String countryOverride = prefs.getString(PreferencesActivity.KEY_SEARCH_COUNTRY, "-");
|
||||
if (countryOverride != null && !countryOverride.isEmpty() && !"-".equals(countryOverride)) {
|
||||
|
|
|
@ -220,7 +220,7 @@ final class CameraConfigurationManager {
|
|||
if (camera != null) {
|
||||
Camera.Parameters parameters = camera.getParameters();
|
||||
if (parameters != null) {
|
||||
String flashMode = camera.getParameters().getFlashMode();
|
||||
String flashMode = parameters.getFlashMode();
|
||||
return flashMode != null &&
|
||||
(Camera.Parameters.FLASH_MODE_ON.equals(flashMode) ||
|
||||
Camera.Parameters.FLASH_MODE_TORCH.equals(flashMode));
|
||||
|
|
|
@ -106,8 +106,7 @@ public final class ZXingTestActivity extends Activity {
|
|||
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
|
||||
if (result != null) {
|
||||
String contents = result.getContents();
|
||||
if (contents != null) {
|
||||
if (result.getContents() != null) {
|
||||
showDialog(R.string.result_succeeded, result.toString());
|
||||
} else {
|
||||
showDialog(R.string.result_failed, getString(R.string.result_failed_why));
|
||||
|
|
|
@ -48,7 +48,7 @@ public interface Reader {
|
|||
* hints, each possibly associated to some data, which may help the implementation 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
|
||||
* meaning of the data depends upon the hint type. The implementation may or may not do
|
||||
* anything with these hints.
|
||||
|
|
|
@ -94,7 +94,7 @@ public final class MonochromeRectangleDetector {
|
|||
* @param bottom maximum value of y
|
||||
* @param maxWhiteRun maximum run of white pixels that can still be considered to be within
|
||||
* 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
|
||||
*/
|
||||
private ResultPoint findCornerFromCenter(int centerX,
|
||||
|
|
|
@ -192,11 +192,8 @@ public final class WhiteRectangleDetector {
|
|||
int maxSize = right - left;
|
||||
|
||||
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);
|
||||
if (z != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (z == null) {
|
||||
|
@ -205,11 +202,8 @@ public final class WhiteRectangleDetector {
|
|||
|
||||
ResultPoint t = null;
|
||||
//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);
|
||||
if (t != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (t == null) {
|
||||
|
@ -218,11 +212,8 @@ public final class WhiteRectangleDetector {
|
|||
|
||||
ResultPoint x = null;
|
||||
//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);
|
||||
if (x != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (x == null) {
|
||||
|
@ -231,11 +222,8 @@ public final class WhiteRectangleDetector {
|
|||
|
||||
ResultPoint y = null;
|
||||
//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);
|
||||
if (y != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (y == null) {
|
||||
|
|
|
@ -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
|
||||
* found. This allows this to be computed once and reused across many implementations.</p>
|
||||
*
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>9.4.0.M0</version>
|
||||
<version>9.4.0.M1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
Loading…
Reference in a new issue