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

Using regex results in exception #848

Open
delanym opened this issue Oct 17, 2023 · 1 comment
Open

Using regex results in exception #848

delanym opened this issue Oct 17, 2023 · 1 comment

Comments

@delanym
Copy link

delanym commented Oct 17, 2023

With this configuration: -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=[a-zA-Z0-9.]*

nullaway 0.10.14
maven 3.9.5
jdk21

I get this exception

[ERROR]      error-prone version: 2.22.0                                                                  
[ERROR]      BugPattern: NullAway                                                                         
[ERROR]      Stack Trace:                                                                                 
[ERROR]      java.lang.IndexOutOfBoundsException: Index: 1, Size: 0                                                                                                                                                 
[ERROR]         at jdk.compiler/com.sun.tools.javac.util.List.get(List.java:490)                                                                                                                                    
[ERROR]         at com.uber.nullaway.NullAway.handleInvocation(NullAway.java:1629)                                                                                                                                  
[ERROR]         at com.uber.nullaway.NullAway.matchMethodInvocation(NullAway.java:407)                                                                                                                              
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:449)                                                                                                      
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:746)                                                                                                
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitMethodInvocation(ErrorProneScanner.java:150)                                                                                                
[ERROR]         at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1833)                                                                                                         
[ERROR]         at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)                                                                                                                   
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)                                                                                                                                      
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)                                                                                                                                      
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.visitExpressionStatement(TreeScanner.java:502)                                                                                                      
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitExpressionStatement(ErrorProneScanner.java:633)                                                                                             
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitExpressionStatement(ErrorProneScanner.java:150)                                                                                             
[ERROR]         at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1612)                                                                                                      
[ERROR]         at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)                                                                                                                   
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)                                                                                                                                      
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)                                                                                                                                      
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)                                                                                                                          
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:272)                                                                                                                    
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:520)                                                                                                           
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitBlock(ErrorProneScanner.java:150)                                                                                                           
[ERROR]         at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1100)                                                                                                                    
[ERROR]         at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)                                                                                                                   
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)                                                                                                                                      
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)                                                                                                                                      
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)                                                                                                                  
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:224)                                                                                                                   
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:740)                                                                                                          
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:150)                                                                                                                                                                                                                                                                                                                              
[ERROR]         at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:944)                                                                                                                
[ERROR]         at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)                                                                                                                   
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)                                                                                                                                      
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)                                                                                                                                      
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:96)                                                                                                                  
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)                                                                                                                          
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:119)                                                                                                                 
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:203)                                                                                                                    
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:548)                                                                                                           
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:150)                                                                                                           
[ERROR]         at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:851)                                                                                                                 
[ERROR]         at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:92)                                                                                                                   
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:74)                                                                                                                                      
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:48)                                                                                                                                      
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:111)                                                                                                                          
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:119)                                                                                                                 
[ERROR]         at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:152)                                                                                                          
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:560)                                                                                                 
[ERROR]         at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:150)                                                                                                 
[ERROR]         at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:619)                                                                                                           
[ERROR]         at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:66)                                                                                                                   
[ERROR]         at com.google.errorprone.scanner.Scanner.scan(Scanner.java:58)                                                                                                                                      
[ERROR]         at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)                                                                                           
[ERROR]         at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:156)                                                                                                                   
[ERROR]         at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:132)                                                                                                      
[ERROR]         at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1408)                                                                                                                  
[ERROR]         at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1355)                                                                                                                  
[ERROR]         at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:947)                                                                                                                
[ERROR]         at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)                                                                                                       
[ERROR]         at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)                                                                                                      
[ERROR]         at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)                                                                                                                
[ERROR]         at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)                                                                                                                   
[ERROR]         at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:136)                                                                                              
[ERROR]         at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:183)                                                                                                          
[ERROR]         at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1140)                                                                                                    
[ERROR]         at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:193)                                                                                                                     
[ERROR]         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)                                                                                                
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)                                                                                                               
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)                                                                                                                
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)                                                                                                                  
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)                                                                                                                  
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)                                                                                                                
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)                                                                                                                    
[ERROR]         at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)                                                                                             
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)                                                                                                                  
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)                                                                                         
[ERROR]         at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:193)                                                                                                                                                                                                                                                                                                 
[ERROR]         at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:180)                                                                                                                                                                                                                                                                                                 
[ERROR]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)                                                                                                                               
[ERROR]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)                                                                                                                
[ERROR]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)                                                                                                                               
[ERROR]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)                                                                                                        
[ERROR]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)                                                                                                        
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:1623)
@msridhar
Copy link
Collaborator

Looking at the code doing the bad list access it seems this is not exactly about the regex for package names, but it's some other issue. We'd love to track this down. Can you give more information on what type of code is being processed when this error occurs, like a reduced example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants