mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Tiny fixes from coverity; fix SuppressWarnings for deprecation; just one Java 7 build now
This commit is contained in:
parent
61f7f9f196
commit
0fc1a267c0
|
@ -2,12 +2,11 @@ language: java
|
|||
before_install: sudo pip install codecov
|
||||
script: mvn -Pjacoco test
|
||||
jdk:
|
||||
- oraclejdk7
|
||||
- openjdk7
|
||||
- oraclejdk8
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
git:
|
||||
depth: 1
|
||||
depth: 3
|
||||
after_success: codecov
|
||||
|
|
|
@ -67,12 +67,12 @@ public final class DataMatrixWriter implements Writer {
|
|||
if (requestedShape != null) {
|
||||
shape = requestedShape;
|
||||
}
|
||||
@SuppressWarnings("deprecated")
|
||||
@SuppressWarnings("deprecation")
|
||||
Dimension requestedMinSize = (Dimension) hints.get(EncodeHintType.MIN_SIZE);
|
||||
if (requestedMinSize != null) {
|
||||
minSize = requestedMinSize;
|
||||
}
|
||||
@SuppressWarnings("deprecated")
|
||||
@SuppressWarnings("deprecation")
|
||||
Dimension requestedMaxSize = (Dimension) hints.get(EncodeHintType.MAX_SIZE);
|
||||
if (requestedMaxSize != null) {
|
||||
maxSize = requestedMaxSize;
|
||||
|
|
|
@ -36,9 +36,10 @@ public final class CalendarParsedResultTestCase extends Assert {
|
|||
|
||||
private static final double EPSILON = 0.0000000001;
|
||||
|
||||
private static final DateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'", Locale.ENGLISH);
|
||||
static {
|
||||
DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
private static DateFormat makeGMTFormat() {
|
||||
DateFormat format = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'", Locale.ENGLISH);
|
||||
format.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
return format;
|
||||
}
|
||||
|
||||
@Before
|
||||
|
@ -229,8 +230,9 @@ public final class CalendarParsedResultTestCase extends Assert {
|
|||
assertEquals(description, calResult.getDescription());
|
||||
assertEquals(summary, calResult.getSummary());
|
||||
assertEquals(location, calResult.getLocation());
|
||||
assertEquals(startString, DATE_TIME_FORMAT.format(calResult.getStart()));
|
||||
assertEquals(endString, calResult.getEnd() == null ? null : DATE_TIME_FORMAT.format(calResult.getEnd()));
|
||||
DateFormat dateFormat = makeGMTFormat();
|
||||
assertEquals(startString, dateFormat.format(calResult.getStart()));
|
||||
assertEquals(endString, calResult.getEnd() == null ? null : dateFormat.format(calResult.getEnd()));
|
||||
assertEquals(organizer, calResult.getOrganizer());
|
||||
assertArrayEquals(attendees, calResult.getAttendees());
|
||||
assertEqualOrNaN(latitude, calResult.getLatitude());
|
||||
|
|
|
@ -125,7 +125,7 @@ public final class ContactInfoGenerator implements GeneratorSource {
|
|||
}
|
||||
|
||||
private static void maybeAppendMECARD(StringBuilder output, String prefix, String value) {
|
||||
if (!value.isEmpty()) {
|
||||
if (value != null && !value.isEmpty()) {
|
||||
value = value.replaceAll("([\\\\:;])", "\\\\$1");
|
||||
value = value.replaceAll("\\n", "");
|
||||
output.append(prefix).append(':').append(value).append(';');
|
||||
|
|
Loading…
Reference in a new issue