View | Details | Raw Unified | Return to bug 325195
Collapse All | Expand All

(-)ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java (-1 / +52 lines)
Lines 1434-1440 Link Here
1434
			JavaProjectHelper.delete(project);
1434
			JavaProjectHelper.delete(project);
1435
		}
1435
		}
1436
	}
1436
	}
1437
	
1437
1438
	/**
1439
	 * Tests if CleanUp works when the number of problems in a single CU is greater than the
1440
	 * Compiler option {@link JavaCore#COMPILER_PB_MAX_PER_UNIT} which has a default value of 100.
1441
	 * 
1442
	 * @throws Exception if assert fails
1443
	 * @since 3.7
1444
	 */
1445
	public void testCleanUpWithCUProblemsGreaterThanMaxProblemsPerCUPreference() throws Exception {
1446
		IJavaProject project= JavaProjectHelper.createJavaProject("CleanUpTestProject", "bin");
1447
		try {
1448
			int count;
1449
			final int PROBLEMS_COUNT= 101;
1450
			JavaProjectHelper.addRTJar16(project);
1451
			IPackageFragmentRoot src= JavaProjectHelper.addSourceContainer(project, "src");
1452
			IPackageFragment pack1= src.createPackageFragment("test1", false, null);
1453
			StringBuffer buf= new StringBuffer();
1454
			buf.append("package test1;\n");
1455
			buf.append("interface I {\n");
1456
			for (count= 0; count < PROBLEMS_COUNT; count++)
1457
				buf.append("    void m" + count + "();\n");
1458
			buf.append("}\n");
1459
			buf.append("class X implements I {\n");
1460
			for (count= 0; count < PROBLEMS_COUNT; count++)
1461
				buf.append("    public void m" + count + "() {} // @Override error in 1.5, not in 1.6\n");
1462
			buf.append("}\n");
1463
			ICompilationUnit cu1= pack1.createCompilationUnit("I.java", buf.toString(), false, null);
1464
1465
			enable(CleanUpConstants.ADD_MISSING_ANNOTATIONS);
1466
			enable(CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE);
1467
			enable(CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE_FOR_INTERFACE_METHOD_IMPLEMENTATION);
1468
1469
			buf= new StringBuffer();
1470
			buf.append("package test1;\n");
1471
			buf.append("interface I {\n");
1472
			for (count= 0; count < PROBLEMS_COUNT; count++)
1473
				buf.append("    void m" + count + "();\n");
1474
			buf.append("}\n");
1475
			buf.append("class X implements I {\n");
1476
			for (count= 0; count < PROBLEMS_COUNT; count++) {
1477
				buf.append("    @Override\n");
1478
				buf.append("    public void m" + count + "() {} // @Override error in 1.5, not in 1.6\n");
1479
			}
1480
			buf.append("}\n");
1481
			String expected1= buf.toString();
1482
1483
			assertRefactoringResultAsExpected(new ICompilationUnit[] { cu1 }, new String[] { expected1 });
1484
		} finally {
1485
			JavaProjectHelper.delete(project);
1486
		}
1487
	}
1488
1438
	public void testCodeStyle01() throws Exception {
1489
	public void testCodeStyle01() throws Exception {
1439
		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
1490
		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
1440
		StringBuffer buf= new StringBuffer();
1491
		StringBuffer buf= new StringBuffer();

Return to bug 325195