You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/10/10 03:54:23 UTC
[incubator-servicecomb-java-chassis] 03/09: [SCB-918] resolve
eclipse compile warnings
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit 90c48706b6edcd7f1e65b127a239aedcde857093
Author: wujimin <wu...@huawei.com>
AuthorDate: Fri Sep 28 11:11:04 2018 +0800
[SCB-918] resolve eclipse compile warnings
---
.../common/utils/LambdaMetafactoryUtils.java | 10 +++---
.../foundation/vertx/VertxTLSBuilder.java | 1 -
.../testcase/TestDefaultJsonValueJaxrsSchema.java | 3 +-
.../testcase/TestRequestBodySpringMvcSchema.java | 6 ++--
.../servicecomb/it/testcase/base/TestDownload.java | 6 ++--
.../it-producer-deploy-springboot2-servlet/pom.xml | 21 +++++++++--
.../pom.xml | 21 +++++++++--
java-chassis-dependencies-springboot2/pom.xml | 41 ++++++++++++++++++++--
spring-boot2-starter-parent/pom.xml | 1 -
9 files changed, 89 insertions(+), 21 deletions(-)
diff --git a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/LambdaMetafactoryUtils.java b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/LambdaMetafactoryUtils.java
index 3e85787..ef18209 100644
--- a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/LambdaMetafactoryUtils.java
+++ b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/LambdaMetafactoryUtils.java
@@ -45,7 +45,6 @@ public final class LambdaMetafactoryUtils {
return null;
}
- @SuppressWarnings("unchecked")
public static <T> T createLambda(Object instance, Method instanceMethod, Class<?> functionalIntfCls)
throws Throwable {
Method intfMethod = findAbstractMethod(functionalIntfCls);
@@ -60,13 +59,12 @@ public final class LambdaMetafactoryUtils {
MethodType.methodType(functionalIntfCls, instance.getClass()),
intfMethodType,
methodHandle,
- instanceMethodType
- );
+ instanceMethodType);
+ //noinspection unchecked
return (T) callSite.getTarget().bindTo(instance).invoke();
}
- @SuppressWarnings("unchecked")
public static <T> T createLambda(Method instanceMethod, Class<?> functionalIntfCls)
throws Throwable {
Method intfMethod = findAbstractMethod(functionalIntfCls);
@@ -80,9 +78,9 @@ public final class LambdaMetafactoryUtils {
MethodType.methodType(functionalIntfCls),
intfMethodType,
methodHandle,
- instanceMethodType
- );
+ instanceMethodType);
+ //noinspection unchecked
return (T) callSite.getTarget().invoke();
}
diff --git a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxTLSBuilder.java b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxTLSBuilder.java
index ddc4709..790c764 100644
--- a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxTLSBuilder.java
+++ b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxTLSBuilder.java
@@ -20,7 +20,6 @@ package org.apache.servicecomb.foundation.vertx;
import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.Set;
import org.apache.servicecomb.foundation.ssl.SSLCustom;
import org.apache.servicecomb.foundation.ssl.SSLManager;
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDefaultJsonValueJaxrsSchema.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDefaultJsonValueJaxrsSchema.java
index 1e966a6..44b485e 100644
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDefaultJsonValueJaxrsSchema.java
+++ b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDefaultJsonValueJaxrsSchema.java
@@ -43,6 +43,7 @@ public class TestDefaultJsonValueJaxrsSchema {
Assert.assertEquals(result, "expected:0:null");
}
+ @SuppressWarnings("unchecked")
@Test
public void invokeFromEdgeWithRawJson() {
HttpHeaders headers = new HttpHeaders();
@@ -50,7 +51,7 @@ public class TestDefaultJsonValueJaxrsSchema {
Map<String, Object> body = new HashMap<>();
body.put("type", 100);
HttpEntity<Map<String, Object>> entity = new HttpEntity<>(body, headers);
- Map result =
+ Map<String, Object> result =
client.postForObject("/jsonInput", entity, Map.class);
Assert.assertEquals(result.get("type"), 100);
Assert.assertEquals(result.get("message"), "expected:null:null");
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRequestBodySpringMvcSchema.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRequestBodySpringMvcSchema.java
index ac292b2..f630611 100644
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRequestBodySpringMvcSchema.java
+++ b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestRequestBodySpringMvcSchema.java
@@ -54,7 +54,8 @@ public class TestRequestBodySpringMvcSchema {
request.put("extendedMessage", "hi");
HttpEntity<Map<String, Object>> entity = new HttpEntity<>(request, headers);
- Map result =
+ @SuppressWarnings("unchecked")
+ Map<String, Object> result =
edgeClient.postForObject("/base", entity, Map.class);
Assert.assertEquals(result.size(), 6);
Assert.assertEquals(result.get("type"), 0);
@@ -77,7 +78,8 @@ public class TestRequestBodySpringMvcSchema {
request.put("extendedMessage", "hi");
HttpEntity<Map<String, Object>> entity = new HttpEntity<>(request, headers);
- Map result =
+ @SuppressWarnings("unchecked")
+ Map<String, Object> result =
edgeClient.postForObject("/base", entity, Map.class);
Assert.assertEquals(result.size(), request.size());
Assert.assertEquals(result.get("type"), request.get("type"));
diff --git a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDownload.java b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDownload.java
index b84c0a4..1c6588d 100644
--- a/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDownload.java
+++ b/integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/base/TestDownload.java
@@ -16,14 +16,12 @@
*/
package org.apache.servicecomb.it.testcase.base;
-import org.apache.servicecomb.it.testcase.support.DownloadSchemaIntf;
-import org.apache.servicecomb.provider.pojo.Invoker;
import org.junit.Assert;
import org.junit.Test;
public class TestDownload {
- private static DownloadSchemaIntf intf = Invoker
- .createProxy("it-producer", "download", DownloadSchemaIntf.class);
+ // private static DownloadSchemaIntf intf = Invoker
+ // .createProxy("it-producer", "download", DownloadSchemaIntf.class);
static int x;
diff --git a/integration-tests/it-producer-deploy-springboot2-servlet/pom.xml b/integration-tests/it-producer-deploy-springboot2-servlet/pom.xml
index 1cdac73..b108822 100644
--- a/integration-tests/it-producer-deploy-springboot2-servlet/pom.xml
+++ b/integration-tests/it-producer-deploy-springboot2-servlet/pom.xml
@@ -16,8 +16,7 @@
~ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -49,6 +48,24 @@
</dependency>
</dependencies>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <compilerArgument>-parameters</compilerArgument>
+ <encoding>UTF-8</encoding>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
<properties>
<it.main>org.apache.servicecomb.it.SpringBoot2ServletApplication</it.main>
</properties>
diff --git a/integration-tests/it-producer-deploy-springboot2-standalone/pom.xml b/integration-tests/it-producer-deploy-springboot2-standalone/pom.xml
index ae9b417..0a3ea8d 100644
--- a/integration-tests/it-producer-deploy-springboot2-standalone/pom.xml
+++ b/integration-tests/it-producer-deploy-springboot2-standalone/pom.xml
@@ -16,8 +16,7 @@
~ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -49,6 +48,24 @@
</dependency>
</dependencies>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <compilerArgument>-parameters</compilerArgument>
+ <encoding>UTF-8</encoding>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
<properties>
<it.main>org.apache.servicecomb.it.SpringBoot2StandaloneApplication</it.main>
</properties>
diff --git a/java-chassis-dependencies-springboot2/pom.xml b/java-chassis-dependencies-springboot2/pom.xml
index 2033c07..8f4884d 100644
--- a/java-chassis-dependencies-springboot2/pom.xml
+++ b/java-chassis-dependencies-springboot2/pom.xml
@@ -16,8 +16,7 @@
~ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>java-chassis</artifactId>
@@ -32,6 +31,12 @@
<packaging>pom</packaging>
<properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <java.version>1.8</java.version>
+
+ <argLine>-Dfile.encoding=UTF-8</argLine>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
<spring.version>5.0.4.RELEASE</spring.version>
<spring.boot.version>2.0.0.RELEASE</spring.boot.version>
<spring.data.version>2.0.5.RELEASE</spring.data.version>
@@ -170,4 +175,36 @@
</dependencies>
</dependencyManagement>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!-- Fixed the m2e warning of remote resources plugin -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <versionRange>[1.0,)</versionRange>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore>
+ </ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
</project>
\ No newline at end of file
diff --git a/spring-boot2-starter-parent/pom.xml b/spring-boot2-starter-parent/pom.xml
index 036ad3e..ab0104d 100644
--- a/spring-boot2-starter-parent/pom.xml
+++ b/spring-boot2-starter-parent/pom.xml
@@ -29,7 +29,6 @@
<artifactId>spring-boot2-starter-parent</artifactId>
<packaging>pom</packaging>
- <version>1.1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>