---
title: "Type safety: Unchecked cast from Object to List<Map<String,Object>>"
author: "流淚的芥末"
date: "2012-03-27T16:51:04Z"
tags: []
categories: ["编程语言"]
slug: "type-safety-unchecked-cast-from-object-to-list-map-string-object"
draft: false
lastmod: "2012-03-27T16:50:49Z"
id: 1465249
url: "https://suroi.iteye.com/blog/1465249"
---

表明Object转化为ArrayList这个转化并不是安全的。但是具体如何解除这个危险，目前还在调查中。以下是网上找到的取消警告的方法（危险并没有解除）。

第一：方法上添加@SuppressWarnings("unchecked")

第二：myeclipse的Window->Preferences->Java->Compiler->Errors/Warning->Generic types中Unchecked generic type operation设置为Ignore。

第三：myeclipse的Window->Preferences->Java->Compiler将Compiler compliance level 设置为小于1.5。