Unable to analyze System.java

79 views
Skip to first unread message

kimm...@gmail.com

unread,
May 3, 2016, 2:57:51 AM5/3/16
to SonarQube, milha...@lge.com
Hi. I'm trying to analyze our own System.java (package java.lang) and it always gets failed.


Then, using sonar-scanner 2.6, I gave it options like

-Dsonar.sources=. -Dsonar.analysis.mode=publish -e -X

and our SonarQube Instance's version is 5.3 and running Java plugin 3.13.1

This is a part of the result

INFO: Scanner configuration file: /home/milhankim/opt/sonar-scanner-2.6/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 2.6
INFO: Java 1.8.0_91 Oracle Corporation (64-bit)
INFO: Linux 4.5.0-1-amd64 amd64
INFO: Error stacktraces are turned on.
INFO: User cache: /home/milhankim/.sonar/cache
DEBUG: Extract sonar-scanner-api-batch in temp...
DEBUG: Get bootstrap index...
DEBUG: Get bootstrap completed
DEBUG: Create isolated classloader...
DEBUG: Start temp cleaning...
DEBUG: Temp cleaning done
DEBUG: Execution getVersion
DEBUG: Execution start
DEBUG: Publish global mode
DEBUG: cache: /home/milhankim/.sonar/ws_cache/http%3A%2F%2Fcodexray.lge.com%3A7400/global
INFO: Load global repositories
DEBUG: GET 200 http://codexray.lge.com:7400/batch/global | time=201ms
INFO: Load global repositories (done) | time=258ms
INFO: User cache: /home/milhankim/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=4ms
DEBUG: Load plugins
DEBUG: Load plugins (done) | time=5ms
DEBUG: API compatibility mode is enabled on plugin Java [java] (built with API lower than 5.2)
DEBUG: Plugins:
DEBUG:   * Java 3.13.1 (java)
DEBUG: Execution getVersion
INFO: SonarQube server 5.3
INFO: Default locale: "ko_KR", source code encoding: "UTF-8" (analysis is platform dependent)
DEBUG: Work directory: /home/milhankim/sandbox/VAL/.sonar
DEBUG: Execution getVersion
DEBUG: Execution execute
INFO: Process project properties
DEBUG: Process project properties (done) | time=2ms
DEBUG: cache: /home/milhankim/.sonar/ws_cache/http%3A%2F%2Fcodexray.lge.com%3A7400/5.3/projects/VAL_TEST
INFO: Load project repositories




...........





DEBUG
: ----- Classpath analyzed by Squid:
DEBUG
: -----
DEBUG
: Completing symbol : Object
DEBUG
: Completing symbol : Class
DEBUG
: Completing symbol : Constructor
DEBUG
: Completing symbol : TypeVariable
DEBUG
: Completing symbol : CallerSensitive
DEBUG
: Completing symbol : Retention
DEBUG
: Completing symbol : Documented
DEBUG
: Completing symbol : RetentionPolicy
DEBUG
: Completing symbol : Enum
DEBUG
: Completing symbol : Comparable
DEBUG
: Completing symbol : Target
DEBUG
: Completing symbol : ElementType
DEBUG
: Completing symbol : ReflectionData
DEBUG
: Completing symbol : SoftReference
DEBUG
: Completing symbol : Reference
DEBUG
: Completing symbol : ReferenceQueue
DEBUG
: Completing symbol : Map
DEBUG
: Completing symbol : Set
DEBUG
: Completing symbol : Collection
DEBUG
: Completing symbol : Iterable
DEBUG
: Completing symbol : Iterator
DEBUG
: Completing symbol : Consumer
DEBUG
: Completing symbol : FunctionalInterface
DEBUG
: Completing symbol : Spliterator
DEBUG
: Completing symbol : Comparator
DEBUG
: Completing symbol : Function
DEBUG
: Completing symbol : ToIntFunction
DEBUG
: Completing symbol : ToLongFunction
DEBUG
: Completing symbol : ToDoubleFunction
DEBUG
: Completing symbol : Predicate
DEBUG
: Completing symbol : Stream
DEBUG
: Completing symbol : BaseStream
DEBUG
: Completing symbol : IntFunction
DEBUG
: Completing symbol : BinaryOperator
DEBUG
: Completing symbol : BiFunction
DEBUG
: Completing symbol : Optional
DEBUG
: Completing symbol : Supplier
DEBUG
: Completing symbol : BiConsumer
DEBUG
: Completing symbol : Collector
DEBUG
: Completing symbol : Builder
DEBUG
: Completing symbol : SafeVarargs
DEBUG
: Completing symbol : UnaryOperator
DEBUG
: Completing symbol : Entry
DEBUG
: Metric lines is an internal metric computed by SonarQube. Provided value is ignored.
DEBUG
: Completing symbol : IOException
DEBUG
: Metric lines is an internal metric computed by SonarQube. Provided value is ignored.
INFO
: Analysis report generated in /home/milhankim/sandbox/VAL/.sonar/batch-report
INFO
: ------------------------------------------------------------------------
INFO
: EXECUTION FAILURE
INFO
: ------------------------------------------------------------------------
INFO
: Total time: 3.942s
INFO
: Final Memory: 49M/253M
INFO
: ------------------------------------------------------------------------
ERROR
: Error during SonarQube Scanner execution
org
.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : '/home/milhankim/sandbox/VAL/System.java'
 at org
.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:93)
 at org
.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67)
 at org
.sonar.java.JavaSquid.scanSources(JavaSquid.java:136)
 at org
.sonar.java.JavaSquid.scan(JavaSquid.java:129)
 at org
.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:90)
 at org
.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
 at org
.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
 at org
.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
 at org
.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
 at org
.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
 at org
.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
 at org
.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
 at org
.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
 at org
.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
 at org
.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
 at org
.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
 at org
.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
 at org
.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
 at org
.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
 at org
.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
 at org
.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
 at org
.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
 at org
.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:498)
 at org
.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
 at com
.sun.proxy.$Proxy0.execute(Unknown Source)
 at org
.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
 at org
.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
 at org
.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
 at org
.sonarsource.scanner.cli.Main.execute(Main.java:72)
 at org
.sonarsource.scanner.cli.Main.main(Main.java:60)
Caused by: java.lang.NullPointerException
 at org
.sonar.java.checks.CallToDeprecatedMethodCheck.isDeprecatedMethod(CallToDeprecatedMethodCheck.java:96)
 at org
.sonar.java.checks.CallToDeprecatedMethodCheck.visitNode(CallToDeprecatedMethodCheck.java:74)
 at org
.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:88)
 at org
.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:113)
 at org
.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:90)
 at org
.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:113)
 at org
.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:90)
 at org
.sonar.java.ast.visitors.SubscriptionVisitor.scanTree(SubscriptionVisitor.java:71)
 at org
.sonar.java.ast.visitors.SubscriptionVisitor.scanFile(SubscriptionVisitor.java:64)
 at org
.sonar.java.checks.CallToDeprecatedMethodCheck.scanFile(CallToDeprecatedMethodCheck.java:52)
 at org
.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:128)
 at org
.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:84)
 
... 33 more



Since not only our own System.java but also Android's one also brings same error, I guess there's something SonarSource team can do! :)

Thank you!

Nicolas Peru

unread,
May 3, 2016, 3:06:56 AM5/3/16
to kimm...@gmail.com, SonarQube, milha...@lge.com
Hi, 

This is an already fixed issue : https://jira.sonarsource.com/browse/SONARJAVA-1660 that should be available in upcoming release of the java plugin. 

Root cause is that we don't build semantic for package java.lang (for reasons a bit complicated to detail). 
I would be interested to know why you end up analyzing a file in that package ?

Cheers, 

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/258a1fbe-536d-4e85-9bda-cd62ace09251%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com

kimm...@gmail.com

unread,
May 3, 2016, 3:17:26 AM5/3/16
to SonarQube, kimm...@gmail.com, milha...@lge.com
I'm actually glad to hear that!

About that System.java: Simply, we needed to write down our own version of System.java. :)

By the way, thank you for all your quick support

2016년 5월 3일 화요일 오후 4시 6분 56초 UTC+9, Nicolas Peru 님의 말:
...
Reply all
Reply to author
Forward
0 new messages