瀏覽代碼

coding => 处理nested:/路径

JustryDeng 2 年之前
父節點
當前提交
08f7c31bb1

+ 7 - 0
class-winter-core/src/main/java/winter/com/ideaaedi/classwinter/Reverses.java

@@ -141,6 +141,13 @@ public class Reverses {
                                 + " projectPath -> " + projectPath + ", e.getMessage() -> " + e.getMessage());
                         return classfileBuffer;
                     }
+                    // 自动去掉嵌套路径前'nested:/',后'/'
+                    if (projectPath != null && projectPath.startsWith(Constant.NESTED_PREFIX)) {
+                        projectPath = projectPath.substring(Constant.NESTED_PREFIX.length());
+                        if (projectPath.endsWith(Constant.LINUX_FILE_SEPARATOR)) {
+                            projectPath = projectPath.substring(0, projectPath.length() - 1);
+                        }
+                    }
                     if (!projectPathSet.contains(projectPath)) {
                         Logger.debug(Reverses.class, "Exist projectPath -> " +  projectPath);
                         projectPathSet.add(projectPath);

+ 1 - 1
class-winter-core/src/main/java/winter/com/ideaaedi/classwinter/executor/DecryptExecutor.java

@@ -250,7 +250,7 @@ public class DecryptExecutor {
                 classWinterInfoDir + Constant.USER_IF_INPUT_PWD_SIMPLE_NAME);
         if (userIfInputPwdWhileEncryptFlag == null) {
             Logger.debug(DecryptExecutor.class, "\n\tworkbenchRoot -> "
-                    + projectPath + "\n\t relativeFilePath -> " + (classWinterInfoDir + Constant.USER_IF_INPUT_PWD_SIMPLE_NAME)
+                    + projectPath + "\n\trelativeFilePath -> " + (classWinterInfoDir + Constant.USER_IF_INPUT_PWD_SIMPLE_NAME)
             );
             throw new ClassWinterException("Not found content  of 'userIfInputPwd.winter'.");
         }

+ 11 - 3
class-winter-core/src/main/java/winter/com/ideaaedi/classwinter/util/Constant.java

@@ -263,10 +263,18 @@ public interface Constant {
      */
     String TO_CLEAN_FIELD_ANNOTATION_PREFIX = "caPrefix";
     
-    /** Load external dtd when nonvalidating feature ("nonvalidating/load-external-dtd"). */
-    String LOAD_EXTERNAL_DTD_FEATURE = "nonvalidating/load-external-dtd";
+    /*
+     * 部分projectpath识别出来会多一个nested:/前缀
+     */
+    String NESTED_PREFIX = "nested:/";
     
+    /*
+     * Load external dtd when nonvalidating feature ("nonvalidating/load-external-dtd").
+     */
+    String LOAD_EXTERNAL_DTD_FEATURE = "nonvalidating/load-external-dtd";
     
-    /** Xerces features prefix ("http://apache.org/xml/features/"). */
+    /*
+     * Xerces features prefix ("http://apache.org/xml/features/")
+     */
     String XERCES_FEATURE_PREFIX = "http://apache.org/xml/features/";
 }