Minor style tweaks

git-svn-id: https://zxing.googlecode.com/svn/trunk@503 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-07-09 17:24:02 +00:00
parent 42940c4580
commit 6d124e1be5
6 changed files with 15 additions and 10 deletions

View file

@ -275,7 +275,9 @@ final class CameraManager {
int previewHeight = (int) (stillResolution.x * stillMultiplier * 1.5f);
int previewWidth = previewHeight * screenResolution.x / screenResolution.y;
previewWidth = ((previewWidth + 7) >> 3) << 3;
if (previewWidth > cameraResolution.x) previewWidth = cameraResolution.x;
if (previewWidth > cameraResolution.x) {
previewWidth = cameraResolution.x;
}
previewHeight = previewWidth * screenResolution.y / screenResolution.x;
previewResolution = new Point(previewWidth, previewHeight);
Log.v(TAG, "previewWidth " + previewWidth + " previewHeight " + previewHeight);

View file

@ -214,9 +214,8 @@ final class DecodeThread extends Thread {
return null;
}
private String getNewPhotoName() {
Date now = new Date();
return "capture" + now.getTime() + ".jpg";
private static String getNewPhotoName() {
return "capture" + System.currentTimeMillis() + ".jpg";
}
}

View file

@ -43,9 +43,9 @@ import java.io.IOException;
*/
public final class BugBarcodeApp implements IButtonEventListener, ImageObserver {
private ICameraDevice camera;
private ICameraModuleControl cameraControl;
private Frame frame;
private final ICameraDevice camera;
private final ICameraModuleControl cameraControl;
private final Frame frame;
private Image image;
private ImageCanvas imageCanvas;
private Label barcodeLabel;

View file

@ -34,7 +34,7 @@ import com.google.zxing.ReaderException;
*/
public abstract class GridSampler {
private static GridSampler gridSampler;
private static GridSampler gridSampler = null;
/**
* Sets the implementation of {@link GridSampler} used by the library. One global
@ -56,6 +56,8 @@ public abstract class GridSampler {
* @return the current implementation of {@link GridSampler}
*/
public static GridSampler getInstance() {
// No real point in trying to make this thread-safe;
// doesn't matter if a second instance is created
if (gridSampler == null) {
gridSampler = new DefaultGridSampler();
}

View file

@ -141,7 +141,9 @@ public abstract class AbstractUPCEANReader extends AbstractOneDReader implements
*/
boolean checkChecksum(String s) throws ReaderException {
int length = s.length();
if (length == 0) return false;
if (length == 0) {
return false;
}
int sum = 0;
for (int i = length - 2; i >= 0; i -= 2) {

View file

@ -163,7 +163,7 @@ final class DecodeEmailTask extends TimerTask {
}
}
private void closeResources(Store store, Folder inbox) {
private static void closeResources(Store store, Folder inbox) {
try {
if (inbox != null) {
inbox.close(true);