Skip to content

Commit 72ad870

Browse files
committed
Support for compatibility with JDK 1.6
1 parent c221fa2 commit 72ad870

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ script: mvn clean install -Pci
44
notifications:
55
email: false
66
jdk:
7+
- openjdk6
78
- openjdk7
8-
- oraclejdk8
99
- oraclejdk7
10+
- oraclejdk8

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<groupId>pl.wavesoftware</groupId>
1212
<artifactId>eid-exceptions</artifactId>
13-
<version>0.1.1-SNAPSHOT</version>
13+
<version>1.0.0-SNAPSHOT</version>
1414
<packaging>jar</packaging>
1515

1616
<name>EID Runtime Exceptions and Utilities</name>
@@ -23,8 +23,8 @@
2323
<netbeans.hint.license>apache20</netbeans.hint.license>
2424
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2525
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
26-
<maven.compiler.source>1.7</maven.compiler.source>
27-
<maven.compiler.target>1.7</maven.compiler.target>
26+
<maven.compiler.source>1.6</maven.compiler.source>
27+
<maven.compiler.target>1.6</maven.compiler.target>
2828
<coveralls.skip>${skipTests}</coveralls.skip>
2929
</properties>
3030

@@ -58,7 +58,7 @@
5858
<dependency>
5959
<groupId>org.assertj</groupId>
6060
<artifactId>assertj-core</artifactId>
61-
<version>2.1.0</version>
61+
<version>1.7.1</version> <!-- For compatibility with JDK 1.6 -->
6262
<scope>test</scope>
6363
</dependency>
6464
<dependency>
@@ -86,7 +86,7 @@
8686
<plugin>
8787
<groupId>org.jacoco</groupId>
8888
<artifactId>jacoco-maven-plugin</artifactId>
89-
<version>0.7.4.201502262128</version>
89+
<version>0.7.4.201502262128</version> <!-- 0.7.5 fails on SONAR -->
9090

9191
<executions>
9292
<execution>

src/main/java/pl/wavesoftware/eid/exceptions/Eid.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private static void validateFormat(String format, int numSpecifiers) {
195195
if (format == null) {
196196
throw new IllegalArgumentException("Format can't be null, but just received one");
197197
}
198-
List<String> specifiers = new ArrayList<>();
198+
List<String> specifiers = new ArrayList<String>();
199199
for (int i = 0; i < numSpecifiers; i++) {
200200
specifiers.add(i + "-test-id");
201201
}

src/test/java/pl/wavesoftware/eid/exceptions/ExceptionsTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ private static void addParameters(Map.Entry<Class<? extends EidRuntimeException>
104104
constructor,
105105
args
106106
});
107-
} catch (NoSuchMethodException | SecurityException ex) {
107+
} catch (NoSuchMethodException ex) {
108+
throw new RuntimeException(ex);
109+
} catch (SecurityException ex) {
108110
throw new RuntimeException(ex);
109111
}
110112
}
@@ -158,7 +160,13 @@ public void testConstruction() {
158160
private <T extends EidRuntimeException> T construct() {
159161
try {
160162
return (T) constructor.newInstance(arguments);
161-
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
163+
} catch (InstantiationException ex) {
164+
throw new RuntimeException(ex);
165+
} catch (IllegalAccessException ex) {
166+
throw new RuntimeException(ex);
167+
} catch (IllegalArgumentException ex) {
168+
throw new RuntimeException(ex);
169+
} catch (InvocationTargetException ex) {
162170
throw new RuntimeException(ex);
163171
}
164172
}

0 commit comments

Comments
 (0)