mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Updated some comments about thread safety and fixed one easy case. Sean, please have a look.
git-svn-id: https://zxing.googlecode.com/svn/trunk@973 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
63a1dc62a3
commit
0c3a4b4b5a
|
@ -20,7 +20,8 @@ package com.google.zxing.common;
|
|||
* <p>This provides an easy abstraction to read bits at a time from a sequence of bytes, where the
|
||||
* number of bits read is not often a multiple of 8.</p>
|
||||
*
|
||||
* <p>This class is not thread-safe.</p>
|
||||
* <p>This class is thread-safe but not reentrant. Unless the caller modifies the bytes array
|
||||
* it passed in, in which case all bets are off.</p>
|
||||
*
|
||||
* @author Sean Owen
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.google.zxing.ReaderException;
|
|||
* <p>For an interesting discussion of this issue, see
|
||||
* <a href="http://webdiis.unizar.es/~neira/12082/thresholding.pdf">this paper</a>.</p>
|
||||
*
|
||||
* NOTE: This class is not threadsafe.
|
||||
* NOTE: This class is not thread-safe.
|
||||
*
|
||||
* @author Sean Owen
|
||||
* @author dswitkin@google.com (Daniel Switkin)
|
||||
|
|
|
@ -34,7 +34,7 @@ import com.google.zxing.ReaderException;
|
|||
*/
|
||||
public abstract class GridSampler {
|
||||
|
||||
private static GridSampler gridSampler = null;
|
||||
private static GridSampler gridSampler = new DefaultGridSampler();
|
||||
|
||||
/**
|
||||
* Sets the implementation of {@link GridSampler} used by the library. One global
|
||||
|
@ -43,7 +43,7 @@ public abstract class GridSampler {
|
|||
* in the whole lifetime of the JVM. For instance, an Android activity can swap in
|
||||
* an implementation that takes advantage of native platform libraries.
|
||||
*
|
||||
* @param newGridSampler
|
||||
* @param newGridSampler The platform-specific object to install.
|
||||
*/
|
||||
public static void setGridSampler(GridSampler newGridSampler) {
|
||||
if (newGridSampler == null) {
|
||||
|
@ -56,11 +56,6 @@ 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();
|
||||
}
|
||||
return gridSampler;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ import java.util.Vector;
|
|||
* markers at three corners of a QR Code.</p>
|
||||
*
|
||||
* <p>This class is not thread-safe and should not be reused.</p>
|
||||
* TODO(dswitkin): Is this comment still true? I don't see any global variables for example.
|
||||
*
|
||||
* <p>In contrast to {@link FinderPatternFinder}, this class will return an array of all possible
|
||||
* QR code locations in the image.</p>
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.Vector;
|
|||
* some code.</p>
|
||||
*
|
||||
* <p>This class is not thread-safe.</p>
|
||||
* TODO(dswitkin): Is this still true?
|
||||
*
|
||||
* @author Sean Owen
|
||||
*/
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.util.Vector;
|
|||
* markers at three corners of a QR Code.</p>
|
||||
*
|
||||
* <p>This class is not thread-safe and should not be reused.</p>
|
||||
* TODO(dswitkin): Is this still true?
|
||||
*
|
||||
* @author Sean Owen
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue