You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by gu...@apache.org on 2022/04/06 05:39:11 UTC

[dubbo] branch 3.0 updated: Fix warn in compiler (#9897)

This is an automated email from the ASF dual-hosted git repository.

guohao pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 7827ca8d04 Fix warn in compiler (#9897)
7827ca8d04 is described below

commit 7827ca8d04bf5eae757e474afdb5cd5757f43b1a
Author: GuoHao <gu...@gmail.com>
AuthorDate: Wed Apr 6 13:38:43 2022 +0800

    Fix warn in compiler (#9897)
    
    * Remove static from interface
---
 compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache | 4 ++--
 compiler/src/main/resources/Dubbo3TripleStub.mustache          | 9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache b/compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache
index ddfdfd9628..9cc2e300fa 100644
--- a/compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache
+++ b/compiler/src/main/resources/Dubbo3TripleInterfaceStub.mustache
@@ -12,8 +12,8 @@ import java.util.concurrent.CompletableFuture;
 
 public interface {{interfaceClassName}} {
 
-    static final String JAVA_SERVICE_NAME = "{{packageName}}.{{serviceName}}";
-    static final String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}";
+    String JAVA_SERVICE_NAME = "{{packageName}}.{{serviceName}}";
+    String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}";
 
 {{#unaryMethods}}
     {{#javaDoc}}
diff --git a/compiler/src/main/resources/Dubbo3TripleStub.mustache b/compiler/src/main/resources/Dubbo3TripleStub.mustache
index 124c71259a..3d2212bc9c 100644
--- a/compiler/src/main/resources/Dubbo3TripleStub.mustache
+++ b/compiler/src/main/resources/Dubbo3TripleStub.mustache
@@ -35,14 +35,15 @@ public final class {{className}} {
     private static final StubServiceDescriptor serviceDescriptor = new StubServiceDescriptor(SERVICE_NAME,{{interfaceClassName}}.class);
 
     static {
-        StubSuppliers.addSupplier(SERVICE_NAME, i -> newStub((Invoker<{{interfaceClassName}}>) i));
-        StubSuppliers.addSupplier({{interfaceClassName}}.JAVA_SERVICE_NAME, i -> newStub((Invoker<{{interfaceClassName}}>) i));
+        StubSuppliers.addSupplier(SERVICE_NAME, {{className}}::newStub);
+        StubSuppliers.addSupplier({{interfaceClassName}}.JAVA_SERVICE_NAME,  {{className}}::newStub);
         StubSuppliers.addDescriptor(SERVICE_NAME, serviceDescriptor);
         StubSuppliers.addDescriptor({{interfaceClassName}}.JAVA_SERVICE_NAME, serviceDescriptor);
     }
 
-    public static {{interfaceClassName}} newStub(Invoker<{{interfaceClassName}}> invoker) {
-        return new {{interfaceClassName}}Stub(invoker);
+    @SuppressWarnings("all")
+    public static {{interfaceClassName}} newStub(Invoker<?> invoker) {
+        return new {{interfaceClassName}}Stub((Invoker<{{interfaceClassName}}>)invoker);
     }
 
 {{#unaryMethods}}