代码如下: @Test public void testMonitorInfo(){ Connection connection = alarmService.conn("121.40.157.200", "deploy", "deploy"); Map<Alarm.AlarmType,Object> map = alarmService.minitorResult(connection); Double cpuInfo =(Double)map.get(Alarm.AlarmType.CPU); System.out.println("cpuInfo:"+cpuInfo); Double memInfo =(Double)map.get(Alarm.AlarmType.MEM); System.out.println("memInfo:"+memInfo); Map<String,Double> disInfo = (Map<String,Double>)map.get(Alarm.AlarmType.DISK); System.out.println("disInfo:" + disInfo); Assert.assertEquals(1,1); }报警告E:\BriAir\src\test\java\com\hp\briair\AlarmServiceTest.java:43: 警告: [unchecked] 未经检查的转换 Map<String,Double> disInfo = (Map<String,Double>)map.get(Alarm.AlarmType.DISK); ^需要: Map<String,Double>找到: Object1 个警告从警告代码来看map已经用泛型约束了(Map<String,Double>)map,请问是什么原因导致该警告?
添加回答
举报
0/150
提交
取消