[Bug] PatternSyntaxException: Stack overflow during pattern compilation near index 2
See original GitHub issueDescribe the bug (*)
A clear and concise description of what the bug is.
java.util.regex.PatternSyntaxException: Stack overflow during pattern compilation near index 2
(([A-Z][a-zA-Z0-9]+)_([A-Z][a-zA-Z0-9]+))
^
at java.base/java.util.regex.Pattern.error(Pattern.java:2027)
at java.base/java.util.regex.Pattern.<init>(Pattern.java:1430)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1068)
at com.magento.idea.magento2plugin.reference.provider.util.GetModuleNameUtil.execute(GetModuleNameUtil.java:24)
at com.magento.idea.magento2plugin.reference.provider.util.GetFilePathUtil.execute(GetFilePathUtil.java:24)
at com.magento.idea.magento2plugin.reference.provider.FilePathReferenceProvider.getFiles(FilePathReferenceProvider.java:110)
at com.magento.idea.magento2plugin.reference.provider.FilePathReferenceProvider.getReferencesByElement(FilePathReferenceProvider.java:38)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:199)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:162)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:141)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:39)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:230)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:38)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:31)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.createRefs(JSLiteralExpressionImpl.java:103)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.lambda$static$0(JSLiteralExpressionImpl.java:78)
at com.intellij.psi.impl.PsiParameterizedCachedValue.doCompute(PsiParameterizedCachedValue.java:46)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:230)
at com.intellij.psi.impl.PsiParameterizedCachedValue.getValue(PsiParameterizedCachedValue.java:35)
at com.intellij.psi.util.CachedValuesManager.getParameterizedCachedValue(CachedValuesManager.java:82)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.getReferences(JSLiteralExpressionImpl.java:88)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.getReference(JSLiteralExpressionImpl.java:83)
at com.intellij.react.css.modules.psi.CssModulesUtil.getCssClassNamesImportOrRequireDeclaration(CssModulesUtil.java:171)
at com.intellij.react.css.modules.psi.CssModulesIndexedStylesVarPsiReferenceContributor$1.getReferencesByElement(CssModulesIndexedStylesVarPsiReferenceContributor.java:33)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:199)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:162)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:141)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:39)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:230)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:38)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:31)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.createRefs(JSLiteralExpressionImpl.java:103)
at com.intellij.lang.javascript.psi.impl.JSLiteralExpressionImpl.lambda$static$0(JSLiteralExpressionImpl.java:78)
at com.intellij.psi.impl.PsiParameterizedCachedValue.doCompute(PsiParameterizedCachedValue.java:46)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:230)
at com.intellij.psi.impl.PsiParameterizedCachedValue.getValue(PsiParameterizedCach
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: Mac OS X 12.0.1
- PhpStorm/Intellij version: 2021.2.3
- Plugin Version: 4.1.0
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
java - What is wrong with : Pattern pattern = Pattern.compile("\\")
PatternSyntaxException: Unexpected internal error near index 1 \ ) ... the regex in a Java String you must double the slashes again.
Read more >Crafting regexes to avoid stack overflows - SonarSource Blog
We've been working recently on adding rules to help write better regular expressions in Java. I've talked already about rules to find errors ......
Read more >java regular expression giving stack overflow - CodeRanch
I'm having a very difficult time trying to get this regular expression in java to work. I just don't understand why it is...
Read more >stack overflow in regex matching quantified alternation
Type: Bug. Status: Open ... I ran into this StackOverflowError while developing ... Pattern$BmpCharProperty.match(Pattern.java:3966)
Read more >92e33d7e684469ef294d5517e6...
Pattern.compile(Pattern.java:374) After: Caused by: java.util.regex.PatternSyntaxException: Missing closing bracket in character class near index 6: hello[ ...
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
Hi @lukpeta I can’t seem to get the error to reproduce. Can you please describe pains and detailed steps for this
Hello, @lukpeta!
I am closing this issue. Update your plugin to the latest available version. Please, reopen it or create new one if you will faced this problem again. Also, please, add steps to reproduce to it if it appears.
Regards,