Tiny fixes from coverity; fix SuppressWarnings for deprecation; just one Java 7 build now

This commit is contained in:
Sean Owen 2015-01-11 16:15:14 +00:00
parent 61f7f9f196
commit 0fc1a267c0
4 changed files with 11 additions and 10 deletions

View file

@ -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

View file

@ -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;

View file

@ -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());

View file

@ -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(';');