### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java =================================================================== RCS file: src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java diff -N src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/jdt/core/tests/compiler/regression/InnerClass15Test.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright (c) 2010 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.tests.compiler.regression; + +import java.util.Map; + +import junit.framework.Test; + +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; + +public class InnerClass15Test extends AbstractRegressionTest { +public InnerClass15Test(String name) { + super(name); +} +static { +// TESTS_NUMBERS = new int[] { 2 }; +} +public static Test suite() { + return buildMinimalComplianceTestSuite(testClass(), F_1_5); +} +protected Map getCompilerOptions() { + Map options = super.getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); + return options; +} +public void test001() { + this.runNegativeTest(new String[] { + "X.java", + "class X {\n" + + " void foo() {\n" + + " class X {}\n" + + " }\n" + + "}", + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " class X {}\n" + + " ^\n" + + "The nested type X cannot hide an enclosing type\n" + + "----------\n"); +} +public void test002() { + this.runNegativeTest(new String[] { + "X.java", + "class X {\n" + + " void foo() {\n" + + " class X {}\n" + + " }\n" + + "}", + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " class X {}\n" + + " ^\n" + + "The nested type X cannot hide an enclosing type\n" + + "----------\n"); +} +public static Class testClass() { + return InnerClass15Test.class; +} +} Index: src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java,v retrieving revision 1.85 diff -u -r1.85 TestAll.java --- src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java 11 May 2010 18:53:50 -0000 1.85 +++ src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java 14 May 2010 23:52:07 -0000 @@ -94,6 +94,7 @@ since_1_5.add(Deprecated15Test.class); since_1_5.add(InnerEmulationTest_1_5.class); since_1_5.add(AssignmentTest_1_5.class); + since_1_5.add(InnerClass15Test.class); // Tests to run when compliance is greater than 1.5 ArrayList since_1_6 = new ArrayList();