SORU
25 EKİM 2012, PERŞEMBE


Birleştirme birden fazla @SuppressWarnings açıklamalar - Eclipse Indigo

Sorun, her öğe @SuppressWarnings kendi açıklama ihtiyacı yok ki multple uyarı baskılar birleştirmek için güçlü olmak.

Örneğin:

public class Example
    public Example() {
        GO go = new GO();  // unused
        ....
        List<String> list = ( List<String> ) go.getList(); // unchecked
    }
    ...
    // getters/setters/other methods
}

Şimdi iki @SuppressWarnings olması yerine bu şekilde bu iki uyarı için sınıf düzeyinde, yani: bir tane istiyorum

@SuppressWarnings( "unused", "unchecked" )
public class Example
    public Example() {
        GO go = new GO();  // unused - suppressed
        ....
        List<String> list = ( List<String> ) go.getList(); // unchecked - suppressed
    }
    ...
    // getters/setters/other methods
}

Ama bu geçerli bir sözdizimi değildir, orada bunu yapmak için bir yol var mı?

CEVAP
25 EKİM 2012, PERŞEMBE


Aşağıdakileri kullanın: @SuppressWarnings({"unused", "unchecked"})

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • akalyne

    akalyne

    13 Mayıs 2009
  • STITCHLESS TV how to sew your own style tutorials

    STITCHLESS T

    9 HAZİRAN 2011
  • theatre2film

    theatre2film

    12 NİSAN 2006