mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Enable RAT check in build; enable checkstyle; fix some violations; update Jetty/Android plugin
This commit is contained in:
parent
ec9487c0b2
commit
867d580e66
|
@ -227,56 +227,55 @@ final class QRCodeEncoder {
|
|||
|
||||
private void encodeQRCodeContents(Intent intent, String type) {
|
||||
switch (type) {
|
||||
case Contents.Type.TEXT: {
|
||||
String data = intent.getStringExtra(Intents.Encode.DATA);
|
||||
if (data != null && !data.isEmpty()) {
|
||||
contents = data;
|
||||
displayContents = data;
|
||||
case Contents.Type.TEXT:
|
||||
String textData = intent.getStringExtra(Intents.Encode.DATA);
|
||||
if (textData != null && !textData.isEmpty()) {
|
||||
contents = textData;
|
||||
displayContents = textData;
|
||||
title = activity.getString(R.string.contents_text);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Contents.Type.EMAIL: {
|
||||
String data = ContactEncoder.trim(intent.getStringExtra(Intents.Encode.DATA));
|
||||
if (data != null) {
|
||||
contents = "mailto:" + data;
|
||||
displayContents = data;
|
||||
|
||||
case Contents.Type.EMAIL:
|
||||
String emailData = ContactEncoder.trim(intent.getStringExtra(Intents.Encode.DATA));
|
||||
if (emailData != null) {
|
||||
contents = "mailto:" + emailData;
|
||||
displayContents = emailData;
|
||||
title = activity.getString(R.string.contents_email);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Contents.Type.PHONE: {
|
||||
String data = ContactEncoder.trim(intent.getStringExtra(Intents.Encode.DATA));
|
||||
if (data != null) {
|
||||
contents = "tel:" + data;
|
||||
displayContents = PhoneNumberUtils.formatNumber(data);
|
||||
|
||||
case Contents.Type.PHONE:
|
||||
String phoneData = ContactEncoder.trim(intent.getStringExtra(Intents.Encode.DATA));
|
||||
if (phoneData != null) {
|
||||
contents = "tel:" + phoneData;
|
||||
displayContents = PhoneNumberUtils.formatNumber(phoneData);
|
||||
title = activity.getString(R.string.contents_phone);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Contents.Type.SMS: {
|
||||
String data = ContactEncoder.trim(intent.getStringExtra(Intents.Encode.DATA));
|
||||
if (data != null) {
|
||||
contents = "sms:" + data;
|
||||
displayContents = PhoneNumberUtils.formatNumber(data);
|
||||
|
||||
case Contents.Type.SMS:
|
||||
String smsData = ContactEncoder.trim(intent.getStringExtra(Intents.Encode.DATA));
|
||||
if (smsData != null) {
|
||||
contents = "sms:" + smsData;
|
||||
displayContents = PhoneNumberUtils.formatNumber(smsData);
|
||||
title = activity.getString(R.string.contents_sms);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Contents.Type.CONTACT: {
|
||||
|
||||
Bundle bundle = intent.getBundleExtra(Intents.Encode.DATA);
|
||||
if (bundle != null) {
|
||||
case Contents.Type.CONTACT:
|
||||
Bundle contactBundle = intent.getBundleExtra(Intents.Encode.DATA);
|
||||
if (contactBundle != null) {
|
||||
|
||||
String name = bundle.getString(ContactsContract.Intents.Insert.NAME);
|
||||
String organization = bundle.getString(ContactsContract.Intents.Insert.COMPANY);
|
||||
String address = bundle.getString(ContactsContract.Intents.Insert.POSTAL);
|
||||
List<String> phones = getAllBundleValues(bundle, Contents.PHONE_KEYS);
|
||||
List<String> phoneTypes = getAllBundleValues(bundle, Contents.PHONE_TYPE_KEYS);
|
||||
List<String> emails = getAllBundleValues(bundle, Contents.EMAIL_KEYS);
|
||||
String url = bundle.getString(Contents.URL_KEY);
|
||||
String name = contactBundle.getString(ContactsContract.Intents.Insert.NAME);
|
||||
String organization = contactBundle.getString(ContactsContract.Intents.Insert.COMPANY);
|
||||
String address = contactBundle.getString(ContactsContract.Intents.Insert.POSTAL);
|
||||
List<String> phones = getAllBundleValues(contactBundle, Contents.PHONE_KEYS);
|
||||
List<String> phoneTypes = getAllBundleValues(contactBundle, Contents.PHONE_TYPE_KEYS);
|
||||
List<String> emails = getAllBundleValues(contactBundle, Contents.EMAIL_KEYS);
|
||||
String url = contactBundle.getString(Contents.URL_KEY);
|
||||
List<String> urls = url == null ? null : Collections.singletonList(url);
|
||||
String note = bundle.getString(Contents.NOTE_KEY);
|
||||
String note = contactBundle.getString(Contents.NOTE_KEY);
|
||||
|
||||
ContactEncoder encoder = useVCard ? new VCardContactEncoder() : new MECARDContactEncoder();
|
||||
String[] encoded = encoder.encode(Collections.singletonList(name),
|
||||
|
@ -295,15 +294,14 @@ final class QRCodeEncoder {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case Contents.Type.LOCATION: {
|
||||
Bundle bundle = intent.getBundleExtra(Intents.Encode.DATA);
|
||||
if (bundle != null) {
|
||||
|
||||
case Contents.Type.LOCATION:
|
||||
Bundle locationBundle = intent.getBundleExtra(Intents.Encode.DATA);
|
||||
if (locationBundle != null) {
|
||||
// These must use Bundle.getFloat(), not getDouble(), it's part of the API.
|
||||
float latitude = bundle.getFloat("LAT", Float.MAX_VALUE);
|
||||
float longitude = bundle.getFloat("LONG", Float.MAX_VALUE);
|
||||
float latitude = locationBundle.getFloat("LAT", Float.MAX_VALUE);
|
||||
float longitude = locationBundle.getFloat("LONG", Float.MAX_VALUE);
|
||||
if (latitude != Float.MAX_VALUE && longitude != Float.MAX_VALUE) {
|
||||
contents = "geo:" + latitude + ',' + longitude;
|
||||
displayContents = latitude + "," + longitude;
|
||||
|
@ -311,7 +309,6 @@ final class QRCodeEncoder {
|
|||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ package com.google.zxing;
|
|||
*/
|
||||
public final class ChecksumException extends ReaderException {
|
||||
|
||||
private static final ChecksumException instance = new ChecksumException();
|
||||
private static final ChecksumException INSTANCE = new ChecksumException();
|
||||
|
||||
private ChecksumException() {
|
||||
// do nothing
|
||||
|
@ -35,18 +35,10 @@ public final class ChecksumException extends ReaderException {
|
|||
}
|
||||
|
||||
public static ChecksumException getChecksumInstance() {
|
||||
if (isStackTrace) {
|
||||
return new ChecksumException();
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
return IS_STACK_TRACE ? new ChecksumException() : INSTANCE;
|
||||
}
|
||||
|
||||
public static ChecksumException getChecksumInstance(Throwable cause) {
|
||||
if (isStackTrace) {
|
||||
return new ChecksumException(cause);
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
return IS_STACK_TRACE ? new ChecksumException(cause) : INSTANCE;
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ package com.google.zxing;
|
|||
*/
|
||||
public final class FormatException extends ReaderException {
|
||||
|
||||
private static final FormatException instance = new FormatException();
|
||||
private static final FormatException INSTANCE = new FormatException();
|
||||
|
||||
private FormatException() {
|
||||
}
|
||||
|
@ -35,18 +35,10 @@ public final class FormatException extends ReaderException {
|
|||
}
|
||||
|
||||
public static FormatException getFormatInstance() {
|
||||
if (isStackTrace) {
|
||||
return new FormatException();
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
return IS_STACK_TRACE ? new FormatException() : INSTANCE;
|
||||
}
|
||||
|
||||
public static FormatException getFormatInstance(Throwable cause) {
|
||||
if (isStackTrace) {
|
||||
return new FormatException(cause);
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
return IS_STACK_TRACE ? new FormatException(cause) : INSTANCE;
|
||||
}
|
||||
}
|
|
@ -24,14 +24,14 @@ package com.google.zxing;
|
|||
*/
|
||||
public final class NotFoundException extends ReaderException {
|
||||
|
||||
private static final NotFoundException instance = new NotFoundException();
|
||||
private static final NotFoundException INSTANCE = new NotFoundException();
|
||||
|
||||
private NotFoundException() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public static NotFoundException getNotFoundInstance() {
|
||||
return instance;
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
}
|
|
@ -26,7 +26,8 @@ package com.google.zxing;
|
|||
public abstract class ReaderException extends Exception {
|
||||
|
||||
// disable stack traces when not running inside test units
|
||||
protected static final boolean isStackTrace = System.getProperty("surefire.test.class.path") != null;
|
||||
protected static final boolean IS_STACK_TRACE =
|
||||
System.getProperty("surefire.test.class.path") != null;
|
||||
|
||||
ReaderException() {
|
||||
// do nothing
|
||||
|
|
|
@ -230,15 +230,15 @@ public final class HighLevelEncoder {
|
|||
// any other mode except possibly digit (which uses only 4 bits). Any
|
||||
// other latch would be equally successful *after* this character, and
|
||||
// so wouldn't save any bits.
|
||||
State latch_state = stateNoBinary.latchAndAppend(mode, charInMode);
|
||||
result.add(latch_state);
|
||||
State latchState = stateNoBinary.latchAndAppend(mode, charInMode);
|
||||
result.add(latchState);
|
||||
}
|
||||
// Try generating the character by switching to its mode.
|
||||
if (!charInCurrentTable && SHIFT_TABLE[state.getMode()][mode] >= 0) {
|
||||
// It never makes sense to temporarily shift to another mode if the
|
||||
// character exists in the current mode. That can never save bits.
|
||||
State shift_state = stateNoBinary.shiftAndAppend(mode, charInMode);
|
||||
result.add(shift_state);
|
||||
State shiftState = stateNoBinary.shiftAndAppend(mode, charInMode);
|
||||
result.add(shiftState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -270,10 +270,10 @@ public final class HighLevelEncoder {
|
|||
}
|
||||
if (pairCode == 3 || pairCode == 4) {
|
||||
// both characters are in DIGITS. Sometimes better to just add two digits
|
||||
State digit_state = stateNoBinary
|
||||
State digitState = stateNoBinary
|
||||
.latchAndAppend(MODE_DIGIT, 16 - pairCode) // period or comma in DIGIT
|
||||
.latchAndAppend(MODE_DIGIT, 1); // space in DIGIT
|
||||
result.add(digit_state);
|
||||
result.add(digitState);
|
||||
}
|
||||
if (state.getBinaryShiftByteCount() > 0) {
|
||||
// It only makes sense to do the characters as binary if we're already
|
||||
|
@ -287,7 +287,7 @@ public final class HighLevelEncoder {
|
|||
List<State> result = new LinkedList<>();
|
||||
for (State newState : states) {
|
||||
boolean add = true;
|
||||
for (Iterator<State> iterator = result.iterator(); iterator.hasNext(); ) {
|
||||
for (Iterator<State> iterator = result.iterator(); iterator.hasNext();) {
|
||||
State oldState = iterator.next();
|
||||
if (oldState.isBetterThanOrEqualTo(newState)) {
|
||||
add = false;
|
||||
|
|
|
@ -77,23 +77,20 @@ public final class BitMatrix implements Cloneable {
|
|||
if (stringRepresentation.charAt(pos) == '\n' ||
|
||||
stringRepresentation.charAt(pos) == '\r') {
|
||||
if (bitsPos > rowStartPos) {
|
||||
if(rowLength == -1) {
|
||||
if (rowLength == -1) {
|
||||
rowLength = bitsPos - rowStartPos;
|
||||
}
|
||||
else if (bitsPos - rowStartPos != rowLength) {
|
||||
} else if (bitsPos - rowStartPos != rowLength) {
|
||||
throw new IllegalArgumentException("row lengths do not match");
|
||||
}
|
||||
rowStartPos = bitsPos;
|
||||
nRows++;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
else if (stringRepresentation.substring(pos, pos + setString.length()).equals(setString)) {
|
||||
} else if (stringRepresentation.substring(pos, pos + setString.length()).equals(setString)) {
|
||||
pos += setString.length();
|
||||
bits[bitsPos] = true;
|
||||
bitsPos++;
|
||||
}
|
||||
else if (stringRepresentation.substring(pos, pos + unsetString.length()).equals(unsetString)) {
|
||||
} else if (stringRepresentation.substring(pos, pos + unsetString.length()).equals(unsetString)) {
|
||||
pos += unsetString.length();
|
||||
bits[bitsPos] = false;
|
||||
bitsPos++;
|
||||
|
|
|
@ -115,7 +115,7 @@ public final class DataMatrixWriter implements Writer {
|
|||
for (int y = 0; y < symbolHeight; y++) {
|
||||
// Fill the top edge with alternate 0 / 1
|
||||
int matrixX;
|
||||
if ((y % symbolInfo.matrixHeight) == 0) {
|
||||
if ((y % symbolInfo.getMatrixHeight()) == 0) {
|
||||
matrixX = 0;
|
||||
for (int x = 0; x < symbolInfo.getSymbolWidth(); x++) {
|
||||
matrix.set(matrixX, matrixY, (x % 2) == 0);
|
||||
|
@ -126,21 +126,21 @@ public final class DataMatrixWriter implements Writer {
|
|||
matrixX = 0;
|
||||
for (int x = 0; x < symbolWidth; x++) {
|
||||
// Fill the right edge with full 1
|
||||
if ((x % symbolInfo.matrixWidth) == 0) {
|
||||
if ((x % symbolInfo.getMatrixWidth()) == 0) {
|
||||
matrix.set(matrixX, matrixY, true);
|
||||
matrixX++;
|
||||
}
|
||||
matrix.set(matrixX, matrixY, placement.getBit(x, y));
|
||||
matrixX++;
|
||||
// Fill the right edge with alternate 0 / 1
|
||||
if ((x % symbolInfo.matrixWidth) == symbolInfo.matrixWidth - 1) {
|
||||
if ((x % symbolInfo.getMatrixWidth()) == symbolInfo.getMatrixWidth() - 1) {
|
||||
matrix.set(matrixX, matrixY, (y % 2) == 0);
|
||||
matrixX++;
|
||||
}
|
||||
}
|
||||
matrixY++;
|
||||
// Fill the bottom edge with full 1
|
||||
if ((y % symbolInfo.matrixHeight) == symbolInfo.matrixHeight - 1) {
|
||||
if ((y % symbolInfo.getMatrixHeight()) == symbolInfo.getMatrixHeight() - 1) {
|
||||
matrixX = 0;
|
||||
for (int x = 0; x < symbolInfo.getSymbolWidth(); x++) {
|
||||
matrix.set(matrixX, matrixY, true);
|
||||
|
|
|
@ -75,8 +75,8 @@ public class SymbolInfo {
|
|||
private final boolean rectangular;
|
||||
private final int dataCapacity;
|
||||
private final int errorCodewords;
|
||||
public final int matrixWidth;
|
||||
public final int matrixHeight;
|
||||
private final int matrixWidth;
|
||||
private final int matrixHeight;
|
||||
private final int dataRegions;
|
||||
private final int rsBlockData;
|
||||
private final int rsBlockError;
|
||||
|
@ -186,6 +186,14 @@ public class SymbolInfo {
|
|||
}
|
||||
}
|
||||
|
||||
public int getMatrixWidth() {
|
||||
return matrixWidth;
|
||||
}
|
||||
|
||||
public int getMatrixHeight() {
|
||||
return matrixHeight;
|
||||
}
|
||||
|
||||
public final int getSymbolDataWidth() {
|
||||
return getHorizontalDataRegions() * matrixWidth;
|
||||
}
|
||||
|
|
|
@ -294,9 +294,6 @@ public final class ITFReader extends OneDReader {
|
|||
private static int[] findGuardPattern(BitArray row,
|
||||
int rowOffset,
|
||||
int[] pattern) throws NotFoundException {
|
||||
|
||||
// TODO: This is very similar to implementation in UPCEANReader. Consider if they can be
|
||||
// merged to a single method.
|
||||
int patternLength = pattern.length;
|
||||
int[] counters = new int[patternLength];
|
||||
int width = row.getSize();
|
||||
|
|
|
@ -110,15 +110,12 @@ public final class RSSExpandedReader extends AbstractRSSReader {
|
|||
{ FINDER_PAT_A, FINDER_PAT_A, FINDER_PAT_B, FINDER_PAT_B, FINDER_PAT_C, FINDER_PAT_D, FINDER_PAT_D, FINDER_PAT_E, FINDER_PAT_E, FINDER_PAT_F, FINDER_PAT_F },
|
||||
};
|
||||
|
||||
//private static final int LONGEST_SEQUENCE_SIZE = FINDER_PATTERN_SEQUENCES[FINDER_PATTERN_SEQUENCES.length - 1].length;
|
||||
|
||||
private static final int MAX_PAIRS = 11;
|
||||
|
||||
private final List<ExpandedPair> pairs = new ArrayList<>(MAX_PAIRS);
|
||||
private final List<ExpandedRow> rows = new ArrayList<>();
|
||||
private final int [] startEnd = new int[2];
|
||||
//private final int [] currentSequence = new int[LONGEST_SEQUENCE_SIZE];
|
||||
private boolean startFromEven = false;
|
||||
private boolean startFromEven;
|
||||
|
||||
@Override
|
||||
public Result decodeRow(int rowNumber,
|
||||
|
@ -153,7 +150,6 @@ public final class RSSExpandedReader extends AbstractRSSReader {
|
|||
while (true){
|
||||
ExpandedPair nextPair = retrieveNextPair(row, this.pairs, rowNumber);
|
||||
this.pairs.add(nextPair);
|
||||
//System.out.println(this.pairs.size()+" pairs found so far on row "+rowNumber+": "+this.pairs);
|
||||
// exit this loop when retrieveNextPair() fails and throws
|
||||
}
|
||||
} catch (NotFoundException nfe) {
|
||||
|
@ -171,7 +167,7 @@ public final class RSSExpandedReader extends AbstractRSSReader {
|
|||
boolean wasReversed = false; // TODO: deal with reversed rows
|
||||
storeRow(rowNumber, wasReversed);
|
||||
if (tryStackedDecode) {
|
||||
// When the image is 180-rotated, then rows are sorted in wrong dirrection.
|
||||
// When the image is 180-rotated, then rows are sorted in wrong direction.
|
||||
// Try twice with both the directions.
|
||||
List<ExpandedPair> ps = checkRows(false);
|
||||
if (ps != null) {
|
||||
|
@ -189,7 +185,7 @@ public final class RSSExpandedReader extends AbstractRSSReader {
|
|||
private List<ExpandedPair> checkRows(boolean reverse) {
|
||||
// Limit number of rows we are checking
|
||||
// We use recursive algorithm with pure complexity and don't want it to take forever
|
||||
// Stacked barcode can have up to 11 rows, so 25 seems resonable enough
|
||||
// Stacked barcode can have up to 11 rows, so 25 seems reasonable enough
|
||||
if (this.rows.size() > 25) {
|
||||
this.rows.clear(); // We will never have a chance to get result, so clear it
|
||||
return null;
|
||||
|
@ -306,7 +302,7 @@ public final class RSSExpandedReader extends AbstractRSSReader {
|
|||
|
||||
// Remove all the rows that contains only specified pairs
|
||||
private static void removePartialRows(List<ExpandedPair> pairs, List<ExpandedRow> rows) {
|
||||
for (Iterator<ExpandedRow> iterator = rows.iterator(); iterator.hasNext(); ) {
|
||||
for (Iterator<ExpandedRow> iterator = rows.iterator(); iterator.hasNext();) {
|
||||
ExpandedRow r = iterator.next();
|
||||
if (r.getPairs().size() == pairs.size()) {
|
||||
continue;
|
||||
|
|
|
@ -88,7 +88,6 @@ final class BoundingBox {
|
|||
if (newMinY < 0) {
|
||||
newMinY = 0;
|
||||
}
|
||||
// TODO use existing points to better interpolate the new x positions
|
||||
ResultPoint newTop = new ResultPoint(top.getX(), newMinY);
|
||||
if (isLeft) {
|
||||
newTopLeft = newTop;
|
||||
|
@ -103,7 +102,6 @@ final class BoundingBox {
|
|||
if (newMaxY >= image.getHeight()) {
|
||||
newMaxY = image.getHeight() - 1;
|
||||
}
|
||||
// TODO use existing points to better interpolate the new x positions
|
||||
ResultPoint newBottom = new ResultPoint(bottom.getX(), newMaxY);
|
||||
if (isLeft) {
|
||||
newBottomLeft = newBottom;
|
||||
|
|
|
@ -261,7 +261,7 @@ public class Detector {
|
|||
/**
|
||||
* See {@link #sizeOfBlackWhiteBlackRun(int, int, int, int)}; computes the total width of
|
||||
* a finder pattern by looking for a black-white-black run from the center in the direction
|
||||
* of another point (another finder pattern center), and in the opposite direction too.</p>
|
||||
* of another point (another finder pattern center), and in the opposite direction too.
|
||||
*/
|
||||
private float sizeOfBlackWhiteBlackRunBothWays(int fromX, int fromY, int toX, int toY) {
|
||||
|
||||
|
|
|
@ -29,29 +29,29 @@ public final class SymbolInfoTestCase extends Assert {
|
|||
public void testSymbolInfo() {
|
||||
SymbolInfo info = SymbolInfo.lookup(3);
|
||||
assertEquals(5, info.getErrorCodewords());
|
||||
assertEquals(8, info.matrixWidth);
|
||||
assertEquals(8, info.matrixHeight);
|
||||
assertEquals(8, info.getMatrixWidth());
|
||||
assertEquals(8, info.getMatrixHeight());
|
||||
assertEquals(10, info.getSymbolWidth());
|
||||
assertEquals(10, info.getSymbolHeight());
|
||||
|
||||
info = SymbolInfo.lookup(3, SymbolShapeHint.FORCE_RECTANGLE);
|
||||
assertEquals(7, info.getErrorCodewords());
|
||||
assertEquals(16, info.matrixWidth);
|
||||
assertEquals(6, info.matrixHeight);
|
||||
assertEquals(16, info.getMatrixWidth());
|
||||
assertEquals(6, info.getMatrixHeight());
|
||||
assertEquals(18, info.getSymbolWidth());
|
||||
assertEquals(8, info.getSymbolHeight());
|
||||
|
||||
info = SymbolInfo.lookup(9);
|
||||
assertEquals(11, info.getErrorCodewords());
|
||||
assertEquals(14, info.matrixWidth);
|
||||
assertEquals(6, info.matrixHeight);
|
||||
assertEquals(14, info.getMatrixWidth());
|
||||
assertEquals(6, info.getMatrixHeight());
|
||||
assertEquals(32, info.getSymbolWidth());
|
||||
assertEquals(8, info.getSymbolHeight());
|
||||
|
||||
info = SymbolInfo.lookup(9, SymbolShapeHint.FORCE_SQUARE);
|
||||
assertEquals(12, info.getErrorCodewords());
|
||||
assertEquals(14, info.matrixWidth);
|
||||
assertEquals(14, info.matrixHeight);
|
||||
assertEquals(14, info.getMatrixWidth());
|
||||
assertEquals(14, info.getMatrixHeight());
|
||||
assertEquals(16, info.getSymbolWidth());
|
||||
assertEquals(16, info.getSymbolHeight());
|
||||
|
||||
|
|
37
pom.xml
37
pom.xml
|
@ -123,6 +123,14 @@
|
|||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>clirr-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
|
@ -333,7 +341,7 @@
|
|||
<plugin>
|
||||
<groupId>com.simpligility.maven.plugins</groupId>
|
||||
<artifactId>android-maven-plugin</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.2.1</version>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
|
@ -398,6 +406,24 @@
|
|||
<artifactId>maven-jxr-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>2.15</version>
|
||||
<configuration>
|
||||
<headerLocation>src/checkstyle/header-file.txt</headerLocation>
|
||||
<configLocation>src/checkstyle/checkstyle.xml</configLocation>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>validate</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
|
@ -419,6 +445,7 @@
|
|||
<exclude>**/*.yaml</exclude>
|
||||
<exclude>**/gen/**</exclude>
|
||||
<exclude>**/resources/**</exclude>
|
||||
<exclude>**/symbolMaps/**</exclude>
|
||||
<exclude>**/target/**</exclude>
|
||||
<exclude>**/dependency-reduced-pom.xml</exclude>
|
||||
<exclude>private/**</exclude>
|
||||
|
@ -426,6 +453,14 @@
|
|||
<excludeSubProjects>false</excludeSubProjects>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
|
174
src/checkstyle/checkstyle.xml
Normal file
174
src/checkstyle/checkstyle.xml
Normal file
|
@ -0,0 +1,174 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
|
||||
<!--
|
||||
Derived from checkstlye's Sun code style config
|
||||
-->
|
||||
<module name="Checker">
|
||||
<!--
|
||||
If you set the basedir property below, then all reported file
|
||||
names will be relative to the specified directory. See
|
||||
http://checkstyle.sourceforge.net/5.x/config.html#Checker
|
||||
|
||||
<property name="basedir" value="${basedir}"/>
|
||||
-->
|
||||
|
||||
<!-- Checks that each Java package has a Javadoc file used for commenting. -->
|
||||
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
|
||||
<!-- <module name="JavadocPackage"/> -->
|
||||
|
||||
<!-- Checks whether files end with a new line. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
|
||||
<!--<module name="NewlineAtEndOfFile"/>-->
|
||||
|
||||
<!-- Checks that property files contain the same keys. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
|
||||
<module name="Translation"/>
|
||||
|
||||
<module name="FileLength"/>
|
||||
|
||||
<!-- Following interprets the header file as regular expressions. -->
|
||||
<!-- <module name="RegexpHeader"/> -->
|
||||
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<!--
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="\s+$"/>
|
||||
<property name="message" value="Line has trailing spaces."/>
|
||||
</module>
|
||||
-->
|
||||
|
||||
<module name="TreeWalker">
|
||||
|
||||
<property name="cacheFile" value="${checkstyle.cache.file}"/>
|
||||
|
||||
<!-- required for SuppressWarningsFilter (and other Suppress* rules not used here) -->
|
||||
<!-- see http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder -->
|
||||
<module name="SuppressWarningsHolder"/>
|
||||
|
||||
<!-- Checks for Javadoc comments. -->
|
||||
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
|
||||
<!--
|
||||
<module name="JavadocMethod">
|
||||
<property name="scope" value="protected"/>
|
||||
</module>
|
||||
-->
|
||||
<!--
|
||||
<module name="JavadocType">
|
||||
<property name="scope" value="protected"/>
|
||||
</module>
|
||||
-->
|
||||
<!--<module name="JavadocVariable"/>-->
|
||||
<module name="JavadocStyle">
|
||||
<property name="checkFirstSentence" value="false"/>
|
||||
</module>
|
||||
|
||||
|
||||
<!-- Checks for Naming Conventions. -->
|
||||
<!-- See http://checkstyle.sf.net/config_naming.html -->
|
||||
<!-- <module name="ConstantName"/> -->
|
||||
<module name="LocalFinalVariableName"/>
|
||||
<!-- <module name="LocalVariableName"/> -->
|
||||
<module name="MemberName"/>
|
||||
<module name="MethodName"/>
|
||||
<module name="PackageName"/>
|
||||
<!-- <module name="ParameterName"/> -->
|
||||
<module name="StaticVariableName"/>
|
||||
<module name="TypeName"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Checks for imports -->
|
||||
<!-- See http://checkstyle.sf.net/config_import.html -->
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
|
||||
<module name="RedundantImport"/>
|
||||
<module name="UnusedImports"/>
|
||||
|
||||
|
||||
<!-- Checks for Size Violations. -->
|
||||
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
||||
<!--
|
||||
<module name="LineLength">
|
||||
<property name="max" value="120"/>
|
||||
</module>
|
||||
-->
|
||||
<!-- <module name="MethodLength"/> -->
|
||||
<!-- <module name="ParameterNumber"/> -->
|
||||
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<module name="EmptyForIteratorPad"/>
|
||||
<module name="MethodParamPad"/>
|
||||
<!-- <module name="NoWhitespaceAfter"/> -->
|
||||
<!-- <module name="NoWhitespaceBefore"/> -->
|
||||
<!-- <module name="OperatorWrap"/> -->
|
||||
<module name="ParenPad"/>
|
||||
<module name="TypecastParenPad"/>
|
||||
<!-- <module name="WhitespaceAfter"/> -->
|
||||
<!-- <module name="WhitespaceAround"/> -->
|
||||
|
||||
|
||||
<!-- Modifier Checks -->
|
||||
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
|
||||
<module name="ModifierOrder"/>
|
||||
<module name="RedundantModifier"/>
|
||||
|
||||
|
||||
<!-- Checks for blocks. You know, those {}'s -->
|
||||
<!-- See http://checkstyle.sf.net/config_blocks.html -->
|
||||
<module name="AvoidNestedBlocks"/>
|
||||
<module name="EmptyBlock">
|
||||
<property name="option" value="text"/>
|
||||
</module>
|
||||
<module name="LeftCurly"/>
|
||||
<module name="NeedBraces"/>
|
||||
<module name="RightCurly"/>
|
||||
|
||||
|
||||
<!-- Checks for common coding problems -->
|
||||
<!-- See http://checkstyle.sf.net/config_coding.html -->
|
||||
<!--<module name="AvoidInlineConditionals"/>-->
|
||||
<module name="EmptyStatement"/>
|
||||
<module name="EqualsHashCode"/>
|
||||
<!--<module name="HiddenField"/>-->
|
||||
<module name="IllegalInstantiation"/>
|
||||
<!-- <module name="InnerAssignment"/> -->
|
||||
<!-- <module name="MagicNumber"/> -->
|
||||
<!-- <module name="MissingSwitchDefault"/> -->
|
||||
<module name="SimplifyBooleanExpression"/>
|
||||
<module name="SimplifyBooleanReturn"/>
|
||||
|
||||
<!-- Checks for class design -->
|
||||
<!-- See http://checkstyle.sf.net/config_design.html -->
|
||||
<!-- <module name="DesignForExtension"/> -->
|
||||
<module name="FinalClass"/>
|
||||
<module name="HideUtilityClassConstructor"/>
|
||||
<module name="InterfaceIsType"/>
|
||||
<!-- <module name="VisibilityModifier"/> -->
|
||||
|
||||
|
||||
<!-- Miscellaneous other checks. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
||||
<module name="ArrayTypeStyle"/>
|
||||
<!--<module name="FinalParameters"/>-->
|
||||
<!-- <module name="TodoComment"/> -->
|
||||
<module name="UpperEll"/>
|
||||
|
||||
</module>
|
||||
|
||||
<!-- Support @SuppressWarnings (added in Checkstyle 5.7) -->
|
||||
<!-- see http://checkstyle.sourceforge.net/config.html#SuppressWarningsFilter -->
|
||||
<module name="SuppressWarningsFilter"/>
|
||||
|
||||
<!-- Checks properties file for a duplicated properties. -->
|
||||
<!-- See http://checkstyle.sourceforge.net/config_misc.html#UniqueProperties -->
|
||||
<module name="UniqueProperties"/>
|
||||
|
||||
</module>
|
|
@ -118,7 +118,7 @@ public final class CalendarEventGenerator implements GeneratorSource {
|
|||
|
||||
private void buildTimeZoneList() {
|
||||
for (TimeZoneInfo info : TimeZoneList.TIMEZONES) {
|
||||
timeZones.addItem(info.getGMTRelative() + ' ' + info.getAbreviation(),
|
||||
timeZones.addItem(info.getGmtRelative() + ' ' + info.getAbbreviation(),
|
||||
String.valueOf(info.getGmtDiff()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,28 +18,28 @@ package com.google.zxing.web.generator.client;
|
|||
|
||||
final class TimeZoneInfo {
|
||||
|
||||
private final String abreviation;
|
||||
private final String abbreviation;
|
||||
private final String longName;
|
||||
private final String GMTRelative;
|
||||
private final String gmtRelative;
|
||||
private final long gmtDiff;
|
||||
|
||||
TimeZoneInfo(String abreviation, String longName, String relative, long gmtDiff) {
|
||||
GMTRelative = relative;
|
||||
this.abreviation = abreviation;
|
||||
TimeZoneInfo(String abbreviation, String longName, String relative, long gmtDiff) {
|
||||
gmtRelative = relative;
|
||||
this.abbreviation = abbreviation;
|
||||
this.gmtDiff = gmtDiff;
|
||||
this.longName = longName;
|
||||
}
|
||||
|
||||
String getAbreviation() {
|
||||
return abreviation;
|
||||
String getAbbreviation() {
|
||||
return abbreviation;
|
||||
}
|
||||
|
||||
String getLongName() {
|
||||
return longName;
|
||||
}
|
||||
|
||||
String getGMTRelative() {
|
||||
return GMTRelative;
|
||||
String getGmtRelative() {
|
||||
return gmtRelative;
|
||||
}
|
||||
|
||||
long getGmtDiff() {
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>9.3.0.M2</version>
|
||||
<version>9.3.0.RC0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
Loading…
Reference in a new issue