You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/06/21 07:09:52 UTC

[servicecomb-toolkit] 36/49: Bug fix and warning clear

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

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-toolkit.git

commit 0293eb990409b6241b879775a47150b077329e44
Author: MabinGo <bi...@huawei.com>
AuthorDate: Sun Jun 2 02:01:26 2019 +0800

    Bug fix and warning clear
    
    Signed-off-by: MabinGo <bi...@huawei.com>
---
 .../org/apache/servicecomb/toolkit/common/MyersAlgorithm.java  | 10 +++-------
 .../org/apache/servicecomb/toolkit/common/TextCompareTest.java |  2 +-
 common/src/test/resources/compare/HelloEndPoint2.yaml          |  9 ++++-----
 pom.xml                                                        |  1 +
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/common/src/main/java/org/apache/servicecomb/toolkit/common/MyersAlgorithm.java b/common/src/main/java/org/apache/servicecomb/toolkit/common/MyersAlgorithm.java
index 6300b38..17ff7d1 100755
--- a/common/src/main/java/org/apache/servicecomb/toolkit/common/MyersAlgorithm.java
+++ b/common/src/main/java/org/apache/servicecomb/toolkit/common/MyersAlgorithm.java
@@ -34,13 +34,9 @@ public class MyersAlgorithm implements CompareAlgorithm {
   @Override
   public List<Comparison> compare(String source, String dest) {
 
-    if (source == null) {
-      LOGGER.error("source must not be null");
-      throw new RuntimeException("source must not be null");
-    }
-    if (source == null) {
-      LOGGER.error("dest must not be null");
-      throw new RuntimeException("dest must not be null");
+    if ((source == null) || (dest == null)) {
+      LOGGER.error("source is {} and dest is {}", source, dest);
+      throw new RuntimeException("source and dest must not be null");
     }
 
     EditList diffList = new EditList();
diff --git a/common/src/test/java/org/apache/servicecomb/toolkit/common/TextCompareTest.java b/common/src/test/java/org/apache/servicecomb/toolkit/common/TextCompareTest.java
index e1a0d98..4a8ebbc 100755
--- a/common/src/test/java/org/apache/servicecomb/toolkit/common/TextCompareTest.java
+++ b/common/src/test/java/org/apache/servicecomb/toolkit/common/TextCompareTest.java
@@ -126,7 +126,7 @@ public class TextCompareTest {
       assertEquals(MyersAlgorithm.class, contractComparator.getAlgorithm().getClass());
       contractComparator.splitPrint(bout);
     } catch (RuntimeException e) {
-      assertEquals("source must not be null", e.getMessage());
+      assertEquals("source and dest must not be null", e.getMessage());
     }
   }
 }
diff --git a/common/src/test/resources/compare/HelloEndPoint2.yaml b/common/src/test/resources/compare/HelloEndPoint2.yaml
index b849778..66b2866 100755
--- a/common/src/test/resources/compare/HelloEndPoint2.yaml
+++ b/common/src/test/resources/compare/HelloEndPoint2.yaml
@@ -16,10 +16,9 @@
 ## ---------------------------------------------------------------------------
 
 ---
-aaswagfger: "2.066"
-ccc
+swagger: "2.0"
 info:
-  version: "1.0.02"
+  version: "1.0.1"
   title: "swagger definition for HelloEndPoint"
   x-java-interface: "gen.swagger.HelloEndPointIntf"
 basePath: "/hello"
@@ -40,7 +39,7 @@ paths:
         in: "query"
         required: false
         type: "number"
-        format: "double"
+        format: "int"
       - name: "instanceId"
         in: "query"
         required: false
@@ -64,7 +63,7 @@ paths:
         type: "string"
       - name: "Authorization"
         in: "header"
-        description: "aa"
+        description: "abc"
         required: true
         type: "string"
       responses:
diff --git a/pom.xml b/pom.xml
index e457098..1ec4144 100755
--- a/pom.xml
+++ b/pom.xml
@@ -45,6 +45,7 @@
       <plugin>
         <groupId>org.apache.rat</groupId>
         <artifactId>apache-rat-plugin</artifactId>
+        <version>0.13</version>
         <configuration>
           <excludes>
             <exclude>DISCLAIMER</exclude>