2016-09-09 15 views
5

SuppressFBWarnings का उपयोग करने के लिए आयात करने के लिए क्या करें? मैंने नए सॉफ़्टवेयर को सहायता/इंस्टॉल के जरिए खोजबग प्लगइन स्थापित किया है जब मैं आयात edu टाइप करता हूं, तो मैं विकल्प प्राप्त करने के लिए ctrl space नहीं कर सकता।@SuppressFBWarnings का उपयोग करने के लिए आयात करने के लिए क्या करें?

उदाहरण

try { 
    String t = null; 
    @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
    value="NP_ALWAYS_NULL", 
    justification="I know what I'm doing") 
    int sl = t.length(); 
    System.out.printf("Length is %d", sl); 
} catch (Throwable e) { 
... 
} 

त्रुटि

उत्तर

4

"edu एक विशेष प्रकार के हल नहीं किया जा सकता है" है आदेश FindBugs एनोटेशन, आप annotations.jar और jsr305.jar शामिल करने के लिए की जरूरत का उपयोग करने के अपने क्लासपाथ पर FindBugs वितरण से। यदि आप सुनिश्चित हैं कि आप केवल @SuppressFBWarnings एनोटेशन (और others नहीं) चाहते हैं, तो annotations.jar अकेले पर्याप्त होगा।

आप libFindBugs distribution के फ़ोल्डर में दो JARs पा सकते हैं।

आप Maven उपयोग कर रहे हैं:

<dependency> 
    <groupId>com.google.code.findbugs</groupId> 
    <artifactId>annotations</artifactId> 
    <version>3.0.1</version> 
    <scope>provided</scope> 
</dependency> 
<dependency> 
    <groupId>com.google.code.findbugs</groupId> 
    <artifactId>jsr305</artifactId> 
    <version>3.0.1</version> 
    <scope>provided</scope> 
</dependency> 

आप Gradle उपयोग कर रहे हैं:

dependencies { 
    compileOnly 'com.google.code.findbugs:annotations:3.0.1' 
    compileOnly 'com.google.code.findbugs:jsr305:3.0.1' 
} 

compileOnly Maven क्या कॉल्स provided दायरे से Gradle स्वाद है।

संबंधित मुद्दे