summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/inspection/redundantCast/generics/BoxingTopCast/src/BoxingTopCast.java
blob: 148422b005889589a520d65d08507421525c1af9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class TestCasting
{
  public void testRedundantCast() throws Exception
  {
    Object o = getObject();
    double d = 0.0;

    if( o instanceof Integer )
    {
      d = (double) (Integer)o;
    }

    System.out.println( "d = " + d );
  }

  private Object getObject()
  {
    return new Integer(42);
  }
}