문제

Since this rule does not work for me I've created easy test "project" structure:

/myTestProject
  /src
    /a
      /A.java
    /b
      /B.java

And content of .java files:

A.java

package a;

public class A {

    public A() {


    }

    public void someOther() {
        halo();
    }

    /**
     * @deprecated
     */
    @Deprecated
    public void halo() {
        int i = 0;
    }


}

B.java

package b;

import a.A;

public class B {

    public B() {

    }

    public void halo() {
        A a = new A();
        a.halo();
    }
}

I've enabled Avoid use of deprecated methods in my default quality profile. (Key CallToDeprecatedMethod in squid)

I ran SonarRunner however I don't have any issues in this code.

What have I forget?

EDIT: My enviroment SonarQube 4.1 and Sonar Runner 2.3

도움이 되었습니까?

해결책

I found answer in the following topic: http://sonarqube.15.x6.nabble.com/sonar-dev-sonar-squid-needs-class-file-td5019909.html#a5019937

As title of this topic says: "sonar squid needs class file"

In this topic we can read that files *.class from our project are required.

I haven't build my project. So there weren't any *.class files.

It's not clearly stated in rules description or other places that *.class files are required.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top