fix comment

This commit is contained in:
Looly
2021-01-26 19:41:04 +08:00
parent 03511298c2
commit e71cc5bc32
7 changed files with 29 additions and 14 deletions

View File

@@ -29,6 +29,7 @@
* 【core 】 修复UrlBuilder.of的query中含有?丢失问题issue#I2CNPS@Gitee
* 【crypto 】 修复BCrypt.checkpw报错问题issue#1377@Github
* 【extra 】 修复Fftp中cd失败导致的问题issue#1371@Github
* 【core 】 修复Fftp中cd失败导致的问题issue#1371@Github
-------------------------------------------------------------------------------------------------------------

View File

@@ -39,6 +39,17 @@ public class CompilerUtil {
return SYSTEM_COMPILER.getStandardFileManager(null, null, null);
}
/**
* 获取{@link StandardJavaFileManager}
*
* @param diagnosticListener 异常收集器
* @return {@link StandardJavaFileManager}
* @since 5.5.8
*/
public static StandardJavaFileManager getFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener) {
return SYSTEM_COMPILER.getStandardFileManager(null, null, null);
}
/**
* 新建编译任务
*

View File

@@ -1,5 +1,6 @@
package cn.hutool.core.compiler;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.io.resource.FileResource;
@@ -182,9 +183,9 @@ public class JavaSourceCompiler {
// classpath
final List<String> options = new ArrayList<>();
if (false == classPath.isEmpty()) {
final List<String> cp = classPath.stream().map(File::getAbsolutePath).collect(Collectors.toList());
final List<String> cp = CollUtil.map(classPath, File::getAbsolutePath, true);
options.add("-cp");
options.addAll(cp);
options.add(CollUtil.join(cp, FileUtil.isWindows() ? ";" : ":"));
}
// 编译文件

View File

@@ -33,6 +33,7 @@ public class JavaSourceCompilerTest {
.addSource(FileUtil.file("test-compile/b/B.java"))
.addSource("c.C", FileUtil.readUtf8String("test-compile/c/C.java"))
.addLibrary(libFile)
// .addLibrary(FileUtil.file("D:\\m2_repo\\cn\\hutool\\hutool-all\\5.5.7\\hutool-all-5.5.7.jar"))
.compile();
final Class<?> clazz = classLoader.loadClass("c.C");
Object obj = ReflectUtil.newInstance(clazz);

View File

@@ -9,11 +9,11 @@ import org.junit.Test;
public class ExtractorTest {
@Test
@Ignore
// @Ignore
public void zipTest(){
Extractor extractor = CompressUtil.createExtractor(
CharsetUtil.defaultCharset(),
FileUtil.file("d:/test/compress/test.zip"));
FileUtil.file("d:/test/c_1344112734760931330_20201230104703032.zip"));
extractor.extract(FileUtil.file("d:/test/compress/test2/"));
}

View File

@@ -35,8 +35,8 @@ public class XMLTokener extends JSONTokener {
/**
* Get the text in the CDATA block.
*
* @return The string up to the <code>]]&gt;</code>.
* @throws JSONException If the <code>]]&gt;</code> is not found.
* @return The string up to the {@code ]]>}.
* @throws JSONException If the {@code ]]>} is not found.
*/
public String nextCDATA() throws JSONException {
char c;
@@ -91,7 +91,7 @@ public class XMLTokener extends JSONTokener {
}
/**
* Return the next entity. These entities are translated to Characters: <code>&amp; ' &gt; &lt; &quot;</code>.
* Return the next entity. These entities are translated to Characters: {@code & ' > < "}.
*
* @param ampersand An ampersand character.
* @return A Character or an entity String if the entity is not recognized.
@@ -117,7 +117,7 @@ public class XMLTokener extends JSONTokener {
/**
* Returns the next XML meta token. This is used for skipping over &lt;!...&gt; and &lt;?...?&gt; structures.
*
* @return Syntax characters (<code>&lt; &gt; / = ! ?</code>) are returned as Character, and strings and names are returned as Boolean. We don't care what the values actually are.
* @return Syntax characters ({@code < > / = ! ?}) are returned as Character, and strings and names are returned as Boolean. We don't care what the values actually are.
* @throws JSONException 字符串中属性未关闭或XML结构错误抛出此异常。If a string is not properly closed or if the XML is badly structured.
*/
public Object nextMeta() throws JSONException {
@@ -177,7 +177,8 @@ public class XMLTokener extends JSONTokener {
}
/**
* Get the next XML Token. These tokens are found inside of angle brackets. It may be one of these characters: <code>/ &gt; = ! ?</code> or it may be a string wrapped in single quotes or double
* Get the next XML Token. These tokens are found inside of angle brackets. <br>
* It may be one of these characters: {@code / > = ! ?} or it may be a string wrapped in single quotes or double
* quotes, or it may be a name.
*
* @return a String or a Character.