Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2025479
  • 博文数量: 414
  • 博客积分: 10312
  • 博客等级: 上将
  • 技术积分: 4921
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-31 01:49
文章分类

全部博文(414)

文章存档

2011年(1)

2010年(29)

2009年(82)

2008年(301)

2007年(1)

分类: Java

2009-04-17 21:31:51

总是提示“Iterator is a raw type. References to generic type Iterator should be parameterized”


解决方法: 添加:  @SuppressWarnings("unchecked")

如:

private void addAttributes(ObjectType object, Builder builder, int Id) throws Exception {
    Iterator itAttributes = object.getAttributes();
    while (itAttributes.hasNext()) {
      AttributeType attr = (AttributeType) itAttributes.next();
      if (!attr.getName().equals("Id")) {
        setAttrValue(attr, object, builder, false);
      } else {
        builder.setAttribute(attr.getName(), "" + Id);
      }
    }
  }


修改为

  @SuppressWarnings("unchecked")
private void addAttributes(ObjectType object, Builder builder, int Id) throws Exception {
    Iterator itAttributes = object.getAttributes();
    while (itAttributes.hasNext()) {
      AttributeType attr = (AttributeType) itAttributes.next();
      if (!attr.getName().equals("Id")) {
        setAttrValue(attr, object, builder, false);
      } else {
        builder.setAttribute(attr.getName(), "" + Id);
      }
    }
  }

阅读(4984) | 评论(0) | 转发(0) |
0

上一篇:C++ string详解

下一篇:adb Core Analysis

给主人留下些什么吧!~~