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

java.lang.IllegalArgumentException: character to be escaped is missing #2

Closed
RichardCao06 opened this issue Apr 20, 2021 · 4 comments
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@RichardCao06
Copy link

你好,我在尝试使用D8gerAutoCode(v4.0)版本的时候遇到了一些问题,当我在选择好类名并按下shift+ctrl+alt+D后,IDEA抛出了java.lang.IllegalArgumentException: character to be escaped is missing的异常,我猜测是不是和我使用windows系统的文件路径分隔符有关,但是还没有用Mac os尝试会不会仍然有这个问题,想请教一下怎么处理。详细的exception信息如下:

java.lang.IllegalArgumentException: character to be escaped is missing
at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1020)
at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:998)
at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1182)
at com.xyz.caofancpu.d8ger.util.VerbalExpressionUtil.executePatternRex(VerbalExpressionUtil.java:205)
at com.xyz.caofancpu.d8ger.util.VerbalExpressionUtil.correctUrl(VerbalExpressionUtil.java:251)
at com.xyz.caofancpu.d8ger.util.IdeaPlatformFileTreeUtil.getOrCreateSubDirByPath(IdeaPlatformFileTreeUtil.java:131)
at com.xyz.caofancpu.d8ger.core.D8gerAutoCoding.lambda$initCustomConfigAutoCodeDirMap$0(D8gerAutoCoding.java:182)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
at com.xyz.caofancpu.d8ger.core.D8gerAutoCoding.initCustomConfigAutoCodeDirMap(D8gerAutoCoding.java:176)
at com.xyz.caofancpu.d8ger.core.D8gerAutoCoding.build(D8gerAutoCoding.java:131)
at com.xyz.caofancpu.d8ger.core.ProjectEnvHandler.checkAndInitEnv(ProjectEnvHandler.java:54)
at com.xyz.caofancpu.d8ger.action.D8gerAutoCodeAction.actionPerformed(D8gerAutoCodeAction.java:39)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:298)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:315)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:604)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$3(IdeKeyEventDispatcher.java:657)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:656)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:517)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:472)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:221)
at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:830)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:775)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

@caofanCPU
Copy link
Owner

你好,能提供下你的具体路径配置吗。
或者你根据如下三行的工具类调试下对应路径,
at com.xyz.caofancpu.d8ger.util.VerbalExpressionUtil.executePatternRex(VerbalExpressionUtil.java:205)
at com.xyz.caofancpu.d8ger.util.VerbalExpressionUtil.correctUrl(VerbalExpressionUtil.java:251)
at com.xyz.caofancpu.d8ger.util.IdeaPlatformFileTreeUtil.getOrCreateSubDirByPath(IdeaPlatformFileTreeUtil.java:131)

@RichardCao06
Copy link
Author

RichardCao06 commented Apr 22, 2021

你好,我在VerlbalExpressionUtil中调用了correctUrl方法,结果抛出java.lang.IllegalArgumentException: character to be escaped is missing。
调用方法如下:
String s = correctUrl("D:\\myProject\\common\\src\\main\\java\\com\\cy\\common\\model\\Student.java");
路径是使用idea的absolute path。
完整异常信息如下:
Exception in thread "main" java.lang.IllegalArgumentException: character to be escaped is missing
at java.util.regex.Matcher.appendReplacement(Matcher.java:809)
at java.util.regex.Matcher.replaceAll(Matcher.java:955)
at com.cy.common.util.VerbalExpressionUtil.executePatternRex(VerbalExpressionUtil.java:210)
at com.cy.common.util.VerbalExpressionUtil.correctUrl(VerbalExpressionUtil.java:256)
at com.cy.common.util.VerbalExpressionUtil.main(VerbalExpressionUtil.java:327)

@caofanCPU
Copy link
Owner

你好,该问题原因确实是没有考虑到不同系统文件路径的差异,这是一个BUG,我会尽快在下一个版本修复。
当前情况下,你可以不使用路径配置的功能,先在当前类下生成其他代码文件,然后手动拖到对应目录中去。

@caofanCPU caofanCPU added bug Something isn't working good first issue Good for newcomers labels Apr 26, 2021
@caofanCPU
Copy link
Owner

4.1版本已修复,待JetBrains官方审核通过后更新插件即可。大概5月10号完成更新

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants
@caofanCPU @RichardCao06 and others