mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Minor changes from inspection
This commit is contained in:
parent
ae6b9f4426
commit
e2afb336e2
|
@ -50,7 +50,7 @@ final class DecodeHandler extends Handler {
|
|||
|
||||
@Override
|
||||
public void handleMessage(Message message) {
|
||||
if (!running) {
|
||||
if (message == null || !running) {
|
||||
return;
|
||||
}
|
||||
switch (message.what) {
|
||||
|
|
|
@ -51,7 +51,7 @@ public final class SearchBookContentsActivity extends Activity {
|
|||
|
||||
private static final String TAG = SearchBookContentsActivity.class.getSimpleName();
|
||||
|
||||
private static final Pattern TAG_PATTERN = Pattern.compile("\\<.*?\\>");
|
||||
private static final Pattern TAG_PATTERN = Pattern.compile("<.*?>");
|
||||
private static final Pattern LT_ENTITY_PATTERN = Pattern.compile("<");
|
||||
private static final Pattern GT_ENTITY_PATTERN = Pattern.compile(">");
|
||||
private static final Pattern QUOTE_ENTITY_PATTERN = Pattern.compile("'");
|
||||
|
|
|
@ -39,7 +39,8 @@ public final class CommandLineEncoder {
|
|||
|
||||
public static void main(String[] args) throws Exception {
|
||||
EncoderConfig config = new EncoderConfig();
|
||||
JCommander jCommander = new JCommander(config, args);
|
||||
JCommander jCommander = new JCommander(config);
|
||||
jCommander.parse(args);
|
||||
jCommander.setProgramName(CommandLineEncoder.class.getSimpleName());
|
||||
if (config.help) {
|
||||
jCommander.usage();
|
||||
|
|
|
@ -49,7 +49,8 @@ public final class CommandLineRunner {
|
|||
|
||||
public static void main(String[] args) throws Exception {
|
||||
DecoderConfig config = new DecoderConfig();
|
||||
JCommander jCommander = new JCommander(config, args);
|
||||
JCommander jCommander = new JCommander(config);
|
||||
jCommander.parse(args);
|
||||
jCommander.setProgramName(CommandLineRunner.class.getSimpleName());
|
||||
if (config.help) {
|
||||
jCommander.usage();
|
||||
|
|
|
@ -28,7 +28,7 @@ final class Validators {
|
|||
}
|
||||
|
||||
static String filterNumber(String number) {
|
||||
return number.replaceAll("[ \\.,\\-\\(\\)]", "");
|
||||
return number.replaceAll("[ .,\\-()]", "");
|
||||
}
|
||||
|
||||
static void validateNumber(String number) throws GeneratorException {
|
||||
|
|
|
@ -126,14 +126,14 @@ public final class ChartServlet extends HttpServlet {
|
|||
throw new IllegalArgumentException("Unknown format " + imageFormat);
|
||||
}
|
||||
|
||||
ByteArrayOutputStream pngOut = new ByteArrayOutputStream();
|
||||
MatrixToImageWriter.writeToStream(matrix, imageFormat, pngOut);
|
||||
byte[] pngData = pngOut.toByteArray();
|
||||
ByteArrayOutputStream imageOut = new ByteArrayOutputStream(1024);
|
||||
MatrixToImageWriter.writeToStream(matrix, imageFormat, imageOut);
|
||||
byte[] imageData = imageOut.toByteArray();
|
||||
|
||||
response.setContentType(contentType);
|
||||
response.setContentLength(pngData.length);
|
||||
response.setContentLength(imageData.length);
|
||||
response.setHeader("Cache-Control", "public");
|
||||
response.getOutputStream().write(pngData);
|
||||
response.getOutputStream().write(imageData);
|
||||
}
|
||||
|
||||
private static ChartServletRequestParameters doParseParameters(ServletRequest request, boolean readBody)
|
||||
|
|
Loading…
Reference in a new issue