deason 5 жил өмнө
parent
commit
578c129847

+ 4 - 9
examcloud-core-questions-base/src/main/java/cn/com/qmth/examcloud/core/questions/base/CombinationUtils.java

@@ -10,18 +10,21 @@ public class CombinationUtils {
     public static List<Integer> combiantion(List<Integer> numbers, int needNum, int needNestNum) {
         List<Integer> returnList = new ArrayList<>();
         if (numbers == null || numbers.size() == 0) {
-            return null;
+            return returnList;
         }
+
         List<Integer> list = new ArrayList<>();
         for (int i = 1; i <= numbers.size(); i++) {
             combine(numbers, 0, i, list);
         }
+
         for (String str : combineList) {
             returnList = sum(str, needNum, needNestNum);
             if (returnList.size() > 0) {
                 break;
             }
         }
+
         return returnList;
     }
 
@@ -40,14 +43,6 @@ public class CombinationUtils {
         combine(cs, begin + 1, number, list);
     }
 
-    public static void main(String args[]) {
-        // List<Integer> list = new ArrayList<>();
-        // list.add(3);
-        // list.add(4);
-        // list.add(5);
-        // combiantion(list);
-    }
-
     private static List<Integer> sum(String str, int needNum, int needNestNum) {
         List<Integer> list = new ArrayList<>();
         List<Integer> tempList = new ArrayList<>();

+ 3 - 3
examcloud-core-questions-base/src/main/java/cn/com/qmth/examcloud/core/questions/base/CommonUtils.java

@@ -582,7 +582,7 @@ public final class CommonUtils {
         }
         while (htmlStr.toLowerCase().contains("<br ")) {
             int index1 = htmlStr.toLowerCase().indexOf("<br ");
-            int index2 = htmlStr.toLowerCase().indexOf(">", index1 + 1);
+            int index2 = htmlStr.toLowerCase().indexOf('>', index1 + 1);
             htmlStr = htmlStr.substring(0, index1) + "<br/>" + htmlStr.substring(index2 + 1);
         }
         while (htmlStr.toLowerCase().endsWith("<br>") || htmlStr.toLowerCase().endsWith("<br/>")) {
@@ -597,7 +597,7 @@ public final class CommonUtils {
         {//补全META标签
             int imgIndex = indexOfRegex(htmlStr, "<((meta)|(META)) ");
             while (imgIndex > 0) {
-                int flag = htmlStr.indexOf(">", imgIndex);
+                int flag = htmlStr.indexOf('>', imgIndex);
                 if (htmlStr.charAt(flag - 1) != '/') {
                     htmlStr = htmlStr.substring(0, flag) + "/" + htmlStr.substring(flag);
                 }
@@ -608,7 +608,7 @@ public final class CommonUtils {
         {//补全img标签
             int imgIndex = indexOfRegex(htmlStr, "<((img)|(IMG)) ");
             while (imgIndex > 0) {
-                int flag = htmlStr.indexOf(">", imgIndex);
+                int flag = htmlStr.indexOf('>', imgIndex);
                 if (htmlStr.charAt(flag - 1) != '/') {
                     htmlStr = htmlStr.substring(0, flag) + "/" + htmlStr.substring(flag);
                 }