git-svn-id: https://zxing.googlecode.com/svn/trunk@574 59b500cc-1b3d-0410-9834-0bbf25fbcc57

This commit is contained in:
srowen 2008-09-01 00:33:53 +00:00
parent 56fa39f734
commit 67d139dadb
3 changed files with 12 additions and 9 deletions

View file

@ -36,7 +36,8 @@ import java.io.FilenameFilter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Vector; import java.util.List;
import java.util.ArrayList;
/** /**
* @author srowen@google.com (Sean Owen) * @author srowen@google.com (Sean Owen)
@ -82,7 +83,7 @@ public abstract class AbstractBlackBoxTestCase extends TestCase {
private final File testBase; private final File testBase;
private final Reader barcodeReader; private final Reader barcodeReader;
private final BarcodeFormat expectedFormat; private final BarcodeFormat expectedFormat;
private Vector<TestResult> testResults; private final List<TestResult> testResults;
protected AbstractBlackBoxTestCase(File testBase, protected AbstractBlackBoxTestCase(File testBase,
Reader barcodeReader, Reader barcodeReader,
@ -90,7 +91,7 @@ public abstract class AbstractBlackBoxTestCase extends TestCase {
this.testBase = testBase; this.testBase = testBase;
this.barcodeReader = barcodeReader; this.barcodeReader = barcodeReader;
this.expectedFormat = expectedFormat; this.expectedFormat = expectedFormat;
testResults = new Vector<TestResult>(); testResults = new ArrayList<TestResult>();
} }
/** /**

View file

@ -26,7 +26,8 @@ import javax.imageio.ImageIO;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.IOException; 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 * 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<TestResult> testResults; private final List<TestResult> testResults;
// Use the multiformat reader to evaluate all decoders in the system. // Use the multiformat reader to evaluate all decoders in the system.
protected AbstractNegativeBlackBoxTestCase(File testBase) { protected AbstractNegativeBlackBoxTestCase(File testBase) {
super(testBase, new MultiFormatReader(), null); super(testBase, new MultiFormatReader(), null);
testResults = new Vector<TestResult>(); testResults = new ArrayList<TestResult>();
} }
protected void addTest(int falsePositivesAllowed, float rotation) { protected void addTest(int falsePositivesAllowed, float rotation) {

View file

@ -32,6 +32,7 @@ import javax.mail.MessagingException;
import javax.mail.Session; import javax.mail.Session;
import javax.mail.Store; import javax.mail.Store;
import javax.mail.Transport; import javax.mail.Transport;
import javax.mail.Service;
import javax.mail.internet.InternetAddress; import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage; 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 { try {
if (inbox != null) { if (inbox != null) {
inbox.close(true); inbox.close(true);
} }
if (store != null) { if (service != null) {
store.close(); service.close();
} }
} catch (MessagingException me) { } catch (MessagingException me) {
// continue // continue