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

NumberFormatException thrown #209

Open
san-zrl opened this issue Jan 21, 2025 · 0 comments
Open

NumberFormatException thrown #209

san-zrl opened this issue Jan 21, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@san-zrl
Copy link
Member

san-zrl commented Jan 21, 2025

This issue is related to PR 98.

The attempt to scan

GitUrl: https://github.com/numpy/numpy
Branch: v2.2.0

led to an exception when scanning file https://github.com/numpy/numpy/blob/main/numpy/_core/tests/test_ufunc.py:

2025-01-21 14:23:15,112 ERROR [com.ibm.inf.CommandBus] (pool-20-thread-2) For input string: ".3" under radix 8

Exception in PythonScannerService.java:84
	  82                                  this.projectDirectory,
	  83                                  project.identifier());
	→ 84                  visitor.scanFile(context);
	  85              }
	  86              counter++;



Exception in ScanProcessManager.java:381
	  379                                      .orElseThrow(NoProjectDirectoryProvided::new));
	  380              final ScanResultDTO pythonScanResultDTO =
	→ 381                      pythonScannerService.scan(
	  382                              scanAggregate
	  383                                      .getGitUrl()



Exception in ScanProcessManager.java:117
	  115              case IndexModulesCommand indexModulesCommand ->
	  116                      this.handleIndexModulesCommand(indexModulesCommand);
	→ 117              case ScanCommand scanCommand -> this.handleScanCommand(scanCommand);
	  118              default -> {
	  119                  // nothing



Exception in CommandBus.java:63
	  61                          () -> {
	  62                              try {
	→ 63                                  iCommandHandler.handle(command);
	  64                              } catch (Exception e) {
	  65                                  LOGGER.error(e.getMessage(), e);

: java.lang.NumberFormatException: For input string: ".3" under radix 8
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:648)
	at java.base/java.lang.Integer.valueOf(Integer.java:963)
	at org.sonar.python.tree.NumericLiteralImpl.valueAsLong(NumericLiteralImpl.java:69)
	at com.ibm.engine.language.python.PythonSemantic.resolveValues(PythonSemantic.java:712)
	at com.ibm.engine.language.python.PythonSemantic.resolveValues(PythonSemantic.java:576)
	at com.ibm.engine.language.python.PythonSemantic.resolveValues(PythonSemantic.java:602)
	at com.ibm.engine.language.python.PythonSemantic.resolveTreeType(PythonSemantic.java:84)
	at com.ibm.engine.language.python.PythonLanguageTranslation.lambda$getMethodParameterTypes$0(PythonLanguageTranslation.java:93)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at com.ibm.engine.language.python.PythonLanguageTranslation.getMethodParameterTypes(PythonLanguageTranslation.java:96)
	at com.ibm.engine.language.python.PythonLanguageTranslation.getMethodParameterTypes(PythonLanguageTranslation.java:32)
	at com.ibm.engine.detection.MethodMatcher.match(MethodMatcher.java:166)
	at com.ibm.engine.rule.MethodDetectionRule.match(MethodDetectionRule.java:45)
	at com.ibm.engine.language.python.PythonDetectionEngine.run(PythonDetectionEngine.java:63)
	at com.ibm.engine.language.python.PythonDetectionEngine.run(PythonDetectionEngine.java:54)
	at com.ibm.engine.language.python.PythonDetectionEngine.run(PythonDetectionEngine.java:39)
	at com.ibm.engine.detection.DetectionStore.analyse(DetectionStore.java:257)
	at com.ibm.engine.executive.DetectionExecutive.start(DetectionExecutive.java:55)
	at com.ibm.plugin.rules.detection.PythonBaseDetectionRule.lambda$visitCallExpression$0(PythonBaseDetectionRule.java:80)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at com.ibm.plugin.rules.detection.PythonBaseDetectionRule.visitCallExpression(PythonBaseDetectionRule.java:70)
	at org.sonar.python.tree.CallExpressionImpl.accept(CallExpressionImpl.java:108)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:32)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:39)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitExpressionStatement(BaseTreeVisitor.java:204)
	at org.sonar.python.tree.ExpressionStatementImpl.accept(ExpressionStatementImpl.java:48)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:32)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:39)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitStatementList(BaseTreeVisitor.java:51)
	at org.sonar.python.tree.StatementListImpl.accept(StatementListImpl.java:46)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:32)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitFunctionDef(BaseTreeVisitor.java:138)
	at org.sonar.python.tree.FunctionDefImpl.accept(FunctionDefImpl.java:175)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:32)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:39)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitStatementList(BaseTreeVisitor.java:51)
	at org.sonar.python.tree.StatementListImpl.accept(StatementListImpl.java:46)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:32)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitClassDef(BaseTreeVisitor.java:152)
	at org.sonar.python.tree.ClassDefImpl.accept(ClassDefImpl.java:85)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:32)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:39)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitStatementList(BaseTreeVisitor.java:51)
	at org.sonar.python.tree.StatementListImpl.accept(StatementListImpl.java:46)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:32)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.visitFileInput(BaseTreeVisitor.java:46)
	at org.sonar.python.tree.FileInputImpl.accept(FileInputImpl.java:78)
	at org.sonar.plugins.python.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:32)
	at org.sonar.plugins.python.api.PythonVisitorCheck.scanFile(PythonVisitorCheck.java:50)
	at com.ibm.usecases.scanning.services.scan.python.PythonScannerService.scan(PythonScannerService.java:84)
	at com.ibm.usecases.scanning.processmanager.ScanProcessManager.handleScanCommand(ScanProcessManager.java:381)
	at com.ibm.usecases.scanning.processmanager.ScanProcessManager.handle(ScanProcessManager.java:117)
	at com.ibm.infrastructure.CommandBus.lambda$send$0(CommandBus.java:63)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants