Skip to content

Commit c79814c

Browse files
authored
Merge pull request #109 from salesforce/feature/java-11
Java 11 compilation compatibility
2 parents 0b253d7 + 2127ea1 commit c79814c

File tree

9 files changed

+137
-87
lines changed

9 files changed

+137
-87
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: java
22
jdk:
33
- oraclejdk8
4+
- oraclejdk11
45

56
after_success:
67
- bash <(curl -s https://codecov.io/bash)

checkstyle.xml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,18 @@
4747
<property name="fileExtensions" value="java"/>
4848
</module>
4949

50-
<module name="SuppressionCommentFilter"/>
51-
52-
<module name="SuppressWithNearbyCommentFilter">
53-
<property name="commentFormat" value="CHECKSTYLE DISABLE ([\w\|]+) FOR (-?\d+) LINES"/>
54-
<property name="checkFormat" value="$1"/>
55-
<property name="influenceFormat" value="$2"/>
56-
</module>
57-
58-
5950
<module name="TreeWalker">
51+
<module name="SuppressionCommentFilter">
52+
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
53+
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
54+
<property name="checkFormat" value="$1"/>
55+
</module>
6056

61-
<module name="FileContentsHolder"/>
62-
57+
<module name="SuppressWithNearbyCommentFilter">
58+
<property name="commentFormat" value="CHECKSTYLE DISABLE ([\w\|]+) FOR (-?\d+) LINES"/>
59+
<property name="checkFormat" value="$1"/>
60+
<property name="influenceFormat" value="$2"/>
61+
</module>
6362

6463
<!-- Checks for Javadoc comments. -->
6564
<!-- See http://checkstyle.sf.net/config_javadoc.html -->

contrib/grpc-contrib/src/main/java/com/salesforce/grpc/contrib/MoreMetadata.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ private MoreMetadata() { }
3535
* @param clazz the type to serialize
3636
* @param <T>
3737
*/
38-
public static final <T> Metadata.AsciiMarshaller<T> JSON_MARSHALLER(Class<T> clazz) {
38+
public static <T> Metadata.AsciiMarshaller<T> JSON_MARSHALLER(Class<T> clazz) {
3939
return new Metadata.AsciiMarshaller<T>() {
40-
TypeToken<T> typeToken = TypeToken.of(clazz);
40+
private TypeToken<T> typeToken = TypeToken.of(clazz);
4141
private Gson gson = new Gson();
4242

4343
@Override

contrib/grpc-contrib/src/main/java/com/salesforce/grpc/contrib/Statuses.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
* stub.someServiceOperation(...);
3232
* } catch (Throwable t) {
3333
* if (hasStatusCode(t, Status.Code.UNAUTHENTICATED)) {
34-
* doWithStatus(t, (status, metadata) -> showLoginPrompt());
34+
* doWithStatus(t, (status, metadata) showLoginPrompt());
3535
* } else if (hasStatus(t) {
36-
* doWithStatus(t, (status, metadata) -> handleGrpcProblem(status));
36+
* doWithStatus(t, (status, metadata) handleGrpcProblem(status));
3737
* } else {
3838
* throw t;
3939
* }

contrib/grpc-spring/src/main/java/com/salesforce/grpc/contrib/spring/GuavaLFReturnValueHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* {@literal @}Controller
4646
* public class MyController {
4747
* {@literal @}RequestMapping(method = RequestMethod.GET, value = "/home")
48-
* ListenableFuture<ModelAndView> home(HttpServletRequest request, Model model) {
48+
* ListenableFuture&lt;ModelAndView&gt; home(HttpServletRequest request, Model model) {
4949
* // work that returns a ListenableFuture...
5050
* }
5151
* }

contrib/pom.xml

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<assertj.version>3.6.2</assertj.version>
7272
<commons-lang.version>2.6</commons-lang.version>
7373
<awaitility.version>2.0.0</awaitility.version>
74-
<mockito.version>2.7.5</mockito.version>
74+
<mockito.version>2.27.0</mockito.version>
7575

7676
<java.version>1.8</java.version>
7777
<maven.compiler.source>${java.version}</maven.compiler.source>
@@ -84,6 +84,14 @@
8484
<developerConnection>${gitRepo}</developerConnection>
8585
</scm>
8686

87+
<dependencies>
88+
<dependency>
89+
<groupId>javax.annotation</groupId>
90+
<artifactId>javax.annotation-api</artifactId>
91+
<version>1.3.2</version>
92+
</dependency>
93+
</dependencies>
94+
8795
<dependencyManagement>
8896
<dependencies>
8997
<!--
@@ -227,15 +235,23 @@
227235
</configuration>
228236
</plugin>
229237

238+
<plugin>
239+
<artifactId>maven-surefire-plugin</artifactId>
240+
<version>3.0.0-M3</version>
241+
<configuration>
242+
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
243+
</configuration>
244+
</plugin>
245+
230246
<plugin>
231247
<groupId>org.apache.maven.plugins</groupId>
232248
<artifactId>maven-checkstyle-plugin</artifactId>
233-
<version>2.17</version>
249+
<version>3.0.0</version>
234250
<dependencies>
235251
<dependency>
236252
<groupId>com.puppycrawl.tools</groupId>
237253
<artifactId>checkstyle</artifactId>
238-
<version>7.1.2</version>
254+
<version>8.21</version>
239255
</dependency>
240256
</dependencies>
241257
<executions>
@@ -274,6 +290,42 @@
274290
</execution>
275291
</executions>
276292
</plugin>
293+
294+
<plugin>
295+
<groupId>org.apache.maven.plugins</groupId>
296+
<artifactId>maven-javadoc-plugin</artifactId>
297+
<version>3.1.0</version>
298+
<configuration>
299+
<author>false</author>
300+
<breakiterator>true</breakiterator>
301+
<doclint>accessibility,html,reference,syntax</doclint>
302+
<keywords>true</keywords>
303+
<version>false</version>
304+
<source>8</source>
305+
</configuration>
306+
<executions>
307+
<execution>
308+
<id>attach-javadocs</id>
309+
<goals>
310+
<goal>jar</goal>
311+
</goals>
312+
</execution>
313+
</executions>
314+
</plugin>
315+
316+
<plugin>
317+
<groupId>org.apache.maven.plugins</groupId>
318+
<artifactId>maven-source-plugin</artifactId>
319+
<version>3.0.1</version>
320+
<executions>
321+
<execution>
322+
<id>attach-sources</id>
323+
<goals>
324+
<goal>jar</goal>
325+
</goals>
326+
</execution>
327+
</executions>
328+
</plugin>
277329
</plugins>
278330
</build>
279331

@@ -293,37 +345,6 @@
293345
<id>public-release</id>
294346
<build>
295347
<plugins>
296-
<plugin>
297-
<groupId>org.apache.maven.plugins</groupId>
298-
<artifactId>maven-javadoc-plugin</artifactId>
299-
<version>2.10.4</version>
300-
<configuration>
301-
<additionalparam>-Xdoclint:none</additionalparam>
302-
</configuration>
303-
<executions>
304-
<execution>
305-
<id>attach-javadocs</id>
306-
<goals>
307-
<goal>jar</goal>
308-
</goals>
309-
</execution>
310-
</executions>
311-
</plugin>
312-
313-
<plugin>
314-
<groupId>org.apache.maven.plugins</groupId>
315-
<artifactId>maven-source-plugin</artifactId>
316-
<version>3.0.1</version>
317-
<executions>
318-
<execution>
319-
<id>attach-sources</id>
320-
<goals>
321-
<goal>jar</goal>
322-
</goals>
323-
</execution>
324-
</executions>
325-
</plugin>
326-
327348
<plugin>
328349
<groupId>org.apache.maven.plugins</groupId>
329350
<artifactId>maven-gpg-plugin</artifactId>

demos/grpc-java-contrib-demo/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
<module>time-service-demo</module>
2424
</modules>
2525

26+
<dependencies>
27+
<dependency>
28+
<groupId>javax.annotation</groupId>
29+
<artifactId>javax.annotation-api</artifactId>
30+
<version>1.3.2</version>
31+
</dependency>
32+
</dependencies>
33+
2634
<dependencyManagement>
2735
<dependencies>
2836
<dependency>

demos/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<assertj.version>3.6.2</assertj.version>
7272
<commons-lang.version>2.6</commons-lang.version>
7373
<awaitility.version>2.0.0</awaitility.version>
74-
<mockito.version>2.7.5</mockito.version>
74+
<mockito.version>2.27.0</mockito.version>
7575

7676
<java.version>1.8</java.version>
7777
<maven.compiler.source>${java.version}</maven.compiler.source>
@@ -157,12 +157,12 @@
157157
<plugin>
158158
<groupId>org.apache.maven.plugins</groupId>
159159
<artifactId>maven-checkstyle-plugin</artifactId>
160-
<version>2.17</version>
160+
<version>3.0.0</version>
161161
<dependencies>
162162
<dependency>
163163
<groupId>com.puppycrawl.tools</groupId>
164164
<artifactId>checkstyle</artifactId>
165-
<version>7.1.2</version>
165+
<version>8.21</version>
166166
</dependency>
167167
</dependencies>
168168
<executions>

jprotoc/pom.xml

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<assertj.version>3.6.2</assertj.version>
7373
<commons-lang.version>2.6</commons-lang.version>
7474
<awaitility.version>2.0.0</awaitility.version>
75-
<mockito.version>2.7.5</mockito.version>
75+
<mockito.version>2.27.0</mockito.version>
7676

7777
<java.version>1.8</java.version>
7878
<maven.compiler.source>${java.version}</maven.compiler.source>
@@ -85,6 +85,14 @@
8585
<developerConnection>${gitRepo}</developerConnection>
8686
</scm>
8787

88+
<dependencies>
89+
<dependency>
90+
<groupId>javax.annotation</groupId>
91+
<artifactId>javax.annotation-api</artifactId>
92+
<version>1.3.2</version>
93+
</dependency>
94+
</dependencies>
95+
8896
<dependencyManagement>
8997
<dependencies>
9098
<!--
@@ -184,15 +192,23 @@
184192
</configuration>
185193
</plugin>
186194

195+
<plugin>
196+
<artifactId>maven-surefire-plugin</artifactId>
197+
<version>3.0.0-M3</version>
198+
<configuration>
199+
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
200+
</configuration>
201+
</plugin>
202+
187203
<plugin>
188204
<groupId>org.apache.maven.plugins</groupId>
189205
<artifactId>maven-checkstyle-plugin</artifactId>
190-
<version>2.17</version>
206+
<version>3.0.0</version>
191207
<dependencies>
192208
<dependency>
193209
<groupId>com.puppycrawl.tools</groupId>
194210
<artifactId>checkstyle</artifactId>
195-
<version>7.1.2</version>
211+
<version>8.21</version>
196212
</dependency>
197213
</dependencies>
198214
<executions>
@@ -231,6 +247,42 @@
231247
</execution>
232248
</executions>
233249
</plugin>
250+
251+
<plugin>
252+
<groupId>org.apache.maven.plugins</groupId>
253+
<artifactId>maven-javadoc-plugin</artifactId>
254+
<version>3.1.0</version>
255+
<configuration>
256+
<author>false</author>
257+
<breakiterator>true</breakiterator>
258+
<doclint>accessibility,html,reference,syntax</doclint>
259+
<keywords>true</keywords>
260+
<version>false</version>
261+
<source>8</source>
262+
</configuration>
263+
<executions>
264+
<execution>
265+
<id>attach-javadocs</id>
266+
<goals>
267+
<goal>jar</goal>
268+
</goals>
269+
</execution>
270+
</executions>
271+
</plugin>
272+
273+
<plugin>
274+
<groupId>org.apache.maven.plugins</groupId>
275+
<artifactId>maven-source-plugin</artifactId>
276+
<version>3.0.1</version>
277+
<executions>
278+
<execution>
279+
<id>attach-sources</id>
280+
<goals>
281+
<goal>jar</goal>
282+
</goals>
283+
</execution>
284+
</executions>
285+
</plugin>
234286
</plugins>
235287
</build>
236288

@@ -250,37 +302,6 @@
250302
<id>public-release</id>
251303
<build>
252304
<plugins>
253-
<plugin>
254-
<groupId>org.apache.maven.plugins</groupId>
255-
<artifactId>maven-javadoc-plugin</artifactId>
256-
<version>2.10.4</version>
257-
<configuration>
258-
<additionalparam>-Xdoclint:none</additionalparam>
259-
</configuration>
260-
<executions>
261-
<execution>
262-
<id>attach-javadocs</id>
263-
<goals>
264-
<goal>jar</goal>
265-
</goals>
266-
</execution>
267-
</executions>
268-
</plugin>
269-
270-
<plugin>
271-
<groupId>org.apache.maven.plugins</groupId>
272-
<artifactId>maven-source-plugin</artifactId>
273-
<version>3.0.1</version>
274-
<executions>
275-
<execution>
276-
<id>attach-sources</id>
277-
<goals>
278-
<goal>jar</goal>
279-
</goals>
280-
</execution>
281-
</executions>
282-
</plugin>
283-
284305
<plugin>
285306
<groupId>org.apache.maven.plugins</groupId>
286307
<artifactId>maven-gpg-plugin</artifactId>

0 commit comments

Comments
 (0)