[Bug] PatternSyntaxException: Unexpected internal error near index 1 in the MagentoBasePathUtil.isMagentoFolderValid:35
See original GitHub issueDescribe the bug (*)
A clear and concise description of what the bug is.
java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
at java.base/java.util.regex.Pattern.error(Pattern.java:2027)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1788)
at java.base/java.util.regex.Pattern.<init>(Pattern.java:1428)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1068)
at java.base/java.lang.String.split(String.java:2317)
at java.base/java.lang.String.split(String.java:2364)
at com.magento.idea.magento2plugin.util.magento.MagentoBasePathUtil.isMagentoFolderValid(MagentoBasePathUtil.java:35)
at com.magento.idea.magento2plugin.project.ProjectDetector.lambda$configureProject$0(ProjectDetector.java:36)
at com.intellij.openapi.project.DumbServiceImpl.lambda$smartInvokeLater$9(DumbServiceImpl.java:530)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
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)
To Reproduce (*)
Steps to reproduce the behavior:
- Go to ‘…’
- Click on ‘…’
- Scroll down to ‘…’
- See error
Expected behavior (*)
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information: (*)
- OS: Windows 11 10.0
- PhpStorm/Intellij version: 2021.3.3
- Plugin Version: 4.3.0
Additional context
Mainline branch: 4.3.1-develop
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Unexpected internal error near index 1 for `.split(File.separator ...
The problem is that the backslash is a special character using regexes (escape character for other special characters). You should use
Read more >java.util.regex.PatternSyntaxException: Unexpected internal ...
PatternSyntaxException : Unexpected internal error near index 1. The backward slash “\” is used to escape characters in the java string.
Read more >1317001 – replaceAll causes Unexpected internal error
PatternSyntaxException : Unexpected internal error near index 1 \ ^ at java.util.regex.Pattern.error(Pattern.java:1955) at java.util.regex.
Read more >Unexpected internal error near index 1 \ | Mendix Forum
When performing a change variable action, with the following expression: replaceAll($Variable,'\','') The following error occurs: at ...
Read more >String.split("\\"); throws PatternSyntaxException? - Daniweb
I guess java automatically throws in another \ on its own every time it sees only 1 \ so \\\\ works. Thank you....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, @Taral-Patoliya!
This fix has been already released. Please, update your plugin version to the latest available: 4.3.1.
cc., @bashari10, @kanevbg, @twtoolsnet, @Bashev, @spyrmp, @miljkovic5, @Hoszi, @lucasmichel13, @artmouse, @pisicabogdan, @rnoboa, @aletoropov, @Justinschouten97, @bgushurst.
Regards,
Hi @bohdan-harniuk I did pre-test and reproduce the bug on the 4.3.0-develop branch After testing on the 1058-fix-file-separator-for-windows branch, I was unable to reproduce this error
For testing, I specifically deployed and configured the environment on Windows 10 Pro
Approve. Good job!