Findbugs 플러그인으로 Eclipse Java EE juno SR2 win32를 실행하고 있습니다. codesample 다음FindBugs의 단일 발견을 무시합니다.
은 FindBugs가 발견 표시 할 수 있습니다 :
catch (OutOfMemoryError e) {
tryAgain = true;
log.error("try to recover", e);
System.gc(); // not so happy about this
}
을 그리고 여기에 검사에 beeing하지 않도록
Bug: [..] forces garbage collection; extremely dubious except in benchmarking code
Code explicitly invokes garbage collection. Except for specific use in benchmarking, this is very dubious.
In the past, situations where people have explicitly invoked the garbage collector in routines such as close or
finalize methods has led to huge performance black holes. Garbage collection can be expensive. Any situation that forces
hundreds or thousands of garbage collections will bring the machine to a crawl.
Confidence: High, Rank: Of Concern (16)
Pattern: DM_GC
Type: Dm, Category: PERFORMANCE (Performance)
그래서 내가 어떻게이 행에 주석을 달 수있는 discription은?
나는 시도했다 작동하지 않습니다 (source)
@edu.umd.cs.findbugs.annotations.SuppressWarnings("DM_GC")
System.gc();
그래서 내가 말하는
@edu.umd.cs.findbugs.annotations.SuppressWarnings("DM_GC")
private bla(){
이 방법으로 이동 : "에듀 유형에 해결 될 수 없다" 그래서 나는 시도했다 :
@SuppressWarnings("DM_GC")
private bla(){
와 나는 "지원되지 않는 @SuppressWarnings있어 ("DM_GC") "
이것은 findbugs 버그, 특정 버그를 비활성화하는 방법에 대한 요청이 아닙니다.
감사합니다.
FYI : gc를 호출하는 것이 좋은 생각이 아닙니다.
대신 'SuppressFBWarnings'을 사용하면 상단에서 가져올 수 있습니다. –
이 문제가 해결되어 "@ edu.umd.cs.findbugs.annotations.SuppressWarnings ("DM_GC ")"가 작동합니다. 고맙습니다! – MemLeak