From a8a4144141d47c240a4a630bf349ff71e65f2dff Mon Sep 17 00:00:00 2001 From: srowen Date: Mon, 1 Sep 2008 00:33:53 +0000 Subject: [PATCH] git-svn-id: http://zxing.googlecode.com/svn/trunk@574 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../com/google/zxing/common/AbstractBlackBoxTestCase.java | 7 ++++--- .../zxing/common/AbstractNegativeBlackBoxTestCase.java | 7 ++++--- zxingorg/src/com/google/zxing/web/DecodeEmailTask.java | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java index 826369d0..b66ef9cc 100644 --- a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java +++ b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java @@ -36,7 +36,8 @@ import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStreamReader; import java.util.Hashtable; -import java.util.Vector; +import java.util.List; +import java.util.ArrayList; /** * @author srowen@google.com (Sean Owen) @@ -82,7 +83,7 @@ public abstract class AbstractBlackBoxTestCase extends TestCase { private final File testBase; private final Reader barcodeReader; private final BarcodeFormat expectedFormat; - private Vector testResults; + private final List testResults; protected AbstractBlackBoxTestCase(File testBase, Reader barcodeReader, @@ -90,7 +91,7 @@ public abstract class AbstractBlackBoxTestCase extends TestCase { this.testBase = testBase; this.barcodeReader = barcodeReader; this.expectedFormat = expectedFormat; - testResults = new Vector(); + testResults = new ArrayList(); } /** diff --git a/core/test/src/com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java b/core/test/src/com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java index db55393c..ec14f7f1 100644 --- a/core/test/src/com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java +++ b/core/test/src/com/google/zxing/common/AbstractNegativeBlackBoxTestCase.java @@ -26,7 +26,8 @@ import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; -import java.util.Vector; +import java.util.List; +import java.util.ArrayList; /** * This abstract class looks for negative results, i.e. it only allows a certain number of false @@ -54,12 +55,12 @@ public abstract class AbstractNegativeBlackBoxTestCase extends AbstractBlackBoxT } } - private Vector testResults; + private final List testResults; // Use the multiformat reader to evaluate all decoders in the system. protected AbstractNegativeBlackBoxTestCase(File testBase) { super(testBase, new MultiFormatReader(), null); - testResults = new Vector(); + testResults = new ArrayList(); } protected void addTest(int falsePositivesAllowed, float rotation) { diff --git a/zxingorg/src/com/google/zxing/web/DecodeEmailTask.java b/zxingorg/src/com/google/zxing/web/DecodeEmailTask.java index fda4853b..1b8babd2 100644 --- a/zxingorg/src/com/google/zxing/web/DecodeEmailTask.java +++ b/zxingorg/src/com/google/zxing/web/DecodeEmailTask.java @@ -32,6 +32,7 @@ import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Store; import javax.mail.Transport; +import javax.mail.Service; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; @@ -163,13 +164,13 @@ final class DecodeEmailTask extends TimerTask { } } - private static void closeResources(Store store, Folder inbox) { + private static void closeResources(Service service, Folder inbox) { try { if (inbox != null) { inbox.close(true); } - if (store != null) { - store.close(); + if (service != null) { + service.close(); } } catch (MessagingException me) { // continue -- 2.20.1