Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaSourceCompiler.addSource(),传入目录时,未对目录内文件进行处理。 #3425

Closed
luomiwhy opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@luomiwhy
Copy link

版本情况

JDK版本: openjdk_17
hutool版本: 5.8.18(请确保最新尝试是否还有问题)

问题描述(包括截图)

  1. 复现代码
Path filePath = xxx
ClassLoader classLoader = CompilerUtil.getCompiler(null)
                                .addSource(filePath.getParent().toFile())   // 这里用目录
                                .compile();
  1. 堆栈信息
    Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalStateException: 错误: 无源文件
image image

实际这两个地方都未对目录进行处理,第一个截图的地方,参数用subFile就好了。

@luomiwhy luomiwhy changed the title JavaSourceCompiler..addSource(目录)。 JavaSourceCompiler..addSource(),传入目录时,未对目录内文件进行处理。 Dec 13, 2023
@looly looly added the bug label Dec 13, 2023
@looly
Copy link
Member

looly commented Dec 13, 2023

5.8.24修复此问题,感谢~~

@looly looly closed this as completed Dec 13, 2023
@looly looly changed the title JavaSourceCompiler..addSource(),传入目录时,未对目录内文件进行处理。 JavaSourceCompiler.addSource(),传入目录时,未对目录内文件进行处理。 Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants