在编写java类中使用了List/Map类,可是总是提示:List is a raw type. References to generic type List should be parameterized.

    后来在网上找到了这样的方法:

    在使用List/Map的每个方法前面加上下面的一句:

    @SuppressWarnings("unchecked")


    下面紧跟使用的方法。

    譬如:

    @SuppressWarnings("unchecked")
    public String selectsql(String basedataname){
         HttpServletRequest request = this.getRequest();
         if(basedataname != null && "mysql".equalsIgnoreCase(basedataname.trim()))    {
             esql = "select schema_name from schemata";
         }
          if(esql == null || "".equals(esql.trim())){
               esql = "select schema_name from schemata";
         }
         List list = exp(esql);
         request.setAttribute("list", list);
         return "database";
    }

    这样就不会再出现那样的提示了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-01-21
  • 2022-12-23
  • 2021-04-27
  • 2022-12-23
  • 2021-10-22
猜你喜欢
  • 2021-06-30
  • 2022-12-23
  • 2021-12-08
  • 2021-09-14
  • 2021-12-25
相关资源
相似解决方案