### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.ui Index: core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java,v retrieving revision 1.6 diff -u -r1.6 UnboundWildcardType.java --- core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java 28 Apr 2005 18:09:27 -0000 1.6 +++ core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java 26 May 2008 16:42:30 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,6 +24,10 @@ return getEnvironment().getJavaLangObject(); } + public TType[] getSubTypes() { + return new TType[] { getEnvironment().getJavaLangObject() }; + } + protected boolean doCanAssignTo(TType lhs) { switch(lhs.getKind()) { case STANDARD_TYPE: #P org.eclipse.jdt.ui.tests.refactoring Index: test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java,v retrieving revision 1.36 diff -u -r1.36 InferTypeArgumentsTests.java --- test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java 29 May 2007 18:38:45 -0000 1.36 +++ test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java 26 May 2008 16:42:31 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -142,6 +142,14 @@ performCuOK(); } + public void testCuGetClass2() throws Exception { + // Test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=211037 + // Does not really test that bug, since the problem only occurs with JDK 1.6, + // but our rtstubs15.jar is only 1.5. + // In 1.6, Object#getClass() declares return type Class, but in 1.5, it's Class. + performCuOK(); + } + public void testCuGetSuperclass() throws Exception { performCuOK(); } Index: resources/InferTypeArguments/testCuGetClass2/in/A.java =================================================================== RCS file: resources/InferTypeArguments/testCuGetClass2/in/A.java diff -N resources/InferTypeArguments/testCuGetClass2/in/A.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ resources/InferTypeArguments/testCuGetClass2/in/A.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,16 @@ +package p; + +class A { + void m(Object someObject) { + someObject.getClass(); + } + void m1(Object someObject) { + Class c= someObject.getClass(); + } + void i(Integer someInt) { + someInt.getClass(); + } + void i1(Integer someInt) { + Class c= someInt.getClass(); + } +} Index: resources/InferTypeArguments/testCuGetClass2/out/A.java =================================================================== RCS file: resources/InferTypeArguments/testCuGetClass2/out/A.java diff -N resources/InferTypeArguments/testCuGetClass2/out/A.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ resources/InferTypeArguments/testCuGetClass2/out/A.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,16 @@ +package p; + +class A { + void m(Object someObject) { + someObject.getClass(); + } + void m1(Object someObject) { + Class c= someObject.getClass(); + } + void i(Integer someInt) { + someInt.getClass(); + } + void i1(Integer someInt) { + Class c= someInt.getClass(); + } +}