`
MauerSu
  • 浏览: 497347 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

@SuppressWarnings

    博客分类:
  • J2SE
 
阅读更多
源:http://www.miss77.net/558.html
http://hi.baidu.com/niuzaiwenjie/item/e373a585a99fff14c216274f
评:
SuppressWarnings压制警告,即去除警告
rawtypes是说传参时也要传递带泛型的参数

rawtypes to suppress warnings relative to un-specific types when using generics on class params
rawtypes阶级PARAMS使用泛型时,抑制相对于非特定类型的警告



Update #1: All these annotations are still valid in Eclipse 3.4 and 3.5, there have been no new SuppressWarning arguments added in those versions of the JDT compiler.

If you are a Java developer and use the new @SuppressWarnings annotation in your code from time-to-time to suppress compiler warnings you, like me, have wondered probably about a million times already just exactly what are the supported values that can be used with this annotation.

The reason the list isn’t easy to find is because it’s compiler specific, which means Sun may have a different set of supported values than say IBM, GCJ or Apache Harmony.

Fortunately for us, the Eclipse folks have documented the values they support (As of Eclipse 3.3), here they are for reference:

all to suppress all warnings
boxing to suppress warnings relative to boxing/unboxing operations
cast to suppress warnings relative to cast operations
dep-ann to suppress warnings relative to deprecated annotation
deprecation to suppress warnings relative to deprecation
fallthrough to suppress warnings relative to missing breaks in switch statements
finally to suppress warnings relative to finally block that don’t return
hiding to suppress warnings relative to locals that hide variable
incomplete-switch to suppress warnings relative to missing entries in a switch statement (enum case)
nls to suppress warnings relative to non-nls string literals
null to suppress warnings relative to null analysis
rawtypes to suppress warnings relative to un-specific types when using generics on class params
restriction to suppress warnings relative to usage of discouraged or forbidden references
serial to suppress warnings relative to missing serialVersionUID field for a serializable class
static-access to suppress warnings relative to incorrect static access
synthetic-access to suppress warnings relative to unoptimized access from inner classes
unchecked to suppress warnings relative to unchecked operations
unqualified-field-access to suppress warnings relative to field access unqualified
unused to suppress warnings relative to unused code
分享到:
评论

相关推荐

    关于@SuppressWarnings("uncheck ")(转)

    关于@SuppressWarnings("uncheck ")

    Java分组、分页源码

    @SuppressWarnings("unused") private List pageList;// 存放分页中5页信息 @SuppressWarnings("unused") private boolean isFirstPage;// 是否为第一页 @SuppressWarnings("unused") private boolean ...

    @SuppressWarnings简介

    :java.lang.SuppressWarnings是J2SE 5.0中标准的Annotation之一。可以标注在类、字段、方法、参数、构造方法,以及局部变量上。

    jsp图书馆管理系统毕业设计

    @SuppressWarnings("unchecked") public List getBookcase(); public Bookcase getBookcaseById(Long id); public boolean validateByName(String name); public int allRowCount(); @...

    java写字板字体文件类源代码

    @SuppressWarnings("static-access") public FontFrame(MyNotepad myNotepad){ @SuppressWarnings("unused") int i = this.showConfirmDialog(myNotepad, createJPanel(), "字体", JOptionPane.OK_CANCEL_...

    ssh 万能类分页系统,可复用!

    @SuppressWarnings("unused") private boolean isFirstPage;//是否为第一页 @SuppressWarnings("unused") private boolean isLastPage;//是否为最后一页 @SuppressWarnings("unused") private boolean has...

    flume-plugin-maven-plugin-1.0.zip

    suppress-warnings.zip,@suppressWarnings注释的常量@suppressWarnings注释的常量

    java编写根据模板导出excel

    @SuppressWarnings({ "rawtypes", "unchecked" }) public void exportAndDownload(String templateFile, List<HashMap> datas) { try { filename = UUID.randomUUID() + templateFile; // FacesContext ...

    ibatis例子=》包含了常用方法介绍

    @SuppressWarnings("unchecked") public Map queryForMap(String sql_name, Object parameterObject, String keyProp,String valueProp) { Map map = null; try { map = sqlMap.queryForMap(sql_name, ...

    计算器java源码

    @SuppressWarnings("serial") public class testCalculator extends Frame { GridLayout g1; Button b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15; Panel p1,p2; Double x,y; JTextField tf1 = ...

    zxing.jar java生成二维码

    @SuppressWarnings("rawtypes") Map map = new HashMap(); //设置二维码的级别 map.put(EncodeHintType.ERROR_CORRECTION,ErrorCorrectionLevel.M); //设置二维码中文本的编码格式 map.put(EncodeHintType....

    hbase创建二级索引

    @SuppressWarnings("deprecation") @Override protected void map(ImmutableBytesWritable key, Result value, Context context) throws IOException, InterruptedException { //获取所有需要建索引的列 Set[]> keys...

    观看韩顺平学习整理java的笔记到异常

    帮助大家复习java基础知识其中有 hashCode 2 ...@SuppressWarnings 注解 17 元注解 19 @Retention 注解 19 @Target 注解 19 @Documented注解 20 @Inherited 注解 20 异常-Exception 21 编译异常 22 异常处理 2

    java网络编程抓取指定网页信息--UrlHtml(java源码)

    @SuppressWarnings("deprecation") public static void main(String[] s) throws IOException{ try { URL url = new URL("http://www.kum.net.cn"); DataInputStream in = new DataInputStream(url.open...

    BluetoothDemoV1.2

    @SuppressWarnings("unused") private static final int REQUEST_ENABLE = 0x1; private static final int REQUEST_EX = 1; /* 请求能够被搜索 */ private static final int REQUEST_DISCOVERABLE = 0x2; ...

    java操作json全jar包

    @SuppressWarnings("unchecked") Iterator<Object> it = jsonArr.iterator(); while(it.hasNext()){ String ff = (String)it.next(); System.out.println("获取的是:"+ff); } } }

    俄罗斯方块

    @SuppressWarnings("serial") class ERS_Block extends Frame { public static boolean isPlay=false; public static int level=1,score=0; public static TextField scoreField,levelField; public static ...

    LinkedList的用法

    @SuppressWarnings("unchecked") public static void main(String[] args) { LinkedList<String> list = new LinkedList(); list.add("aaa"); list.add("bbb"); list.add("ccc"); /* * public ...

Global site tag (gtag.js) - Google Analytics