Lines 14-21
Link Here
|
14 |
|
14 |
|
15 |
import junit.framework.Test; |
15 |
import junit.framework.Test; |
16 |
|
16 |
|
|
|
17 |
import org.eclipse.core.resources.IProject; |
18 |
import org.eclipse.core.resources.IResourceChangeEvent; |
19 |
import org.eclipse.core.resources.IResourceChangeListener; |
20 |
import org.eclipse.core.resources.IWorkspaceDescription; |
21 |
import org.eclipse.core.resources.WorkspaceJob; |
22 |
import org.eclipse.core.runtime.CoreException; |
17 |
import org.eclipse.core.runtime.IPath; |
23 |
import org.eclipse.core.runtime.IPath; |
|
|
24 |
import org.eclipse.core.runtime.IProgressMonitor; |
25 |
import org.eclipse.core.runtime.IStatus; |
18 |
import org.eclipse.core.runtime.Path; |
26 |
import org.eclipse.core.runtime.Path; |
|
|
27 |
import org.eclipse.core.runtime.Status; |
19 |
import org.eclipse.jdt.core.IAccessRule; |
28 |
import org.eclipse.jdt.core.IAccessRule; |
20 |
import org.eclipse.jdt.core.JavaCore; |
29 |
import org.eclipse.jdt.core.JavaCore; |
21 |
import org.eclipse.jdt.core.JavaModelException; |
30 |
import org.eclipse.jdt.core.JavaModelException; |
Lines 780-785
Link Here
|
780 |
} |
789 |
} |
781 |
} |
790 |
} |
782 |
|
791 |
|
|
|
792 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=114349 |
793 |
// this one fails; compare with testCycle7 (only one change in Object source), |
794 |
// which passes |
795 |
public void testCycle6() throws JavaModelException { |
796 |
Hashtable options = JavaCore.getOptions(); |
797 |
Hashtable newOptions = JavaCore.getOptions(); |
798 |
newOptions.put(JavaCore.CORE_CIRCULAR_CLASSPATH, JavaCore.WARNING); |
799 |
|
800 |
JavaCore.setOptions(newOptions); |
801 |
|
802 |
//---------------------------- |
803 |
// Project1 |
804 |
//---------------------------- |
805 |
IPath p1 = env.addProject("P1"); |
806 |
// remove old package fragment root so that names don't collide |
807 |
env.removePackageFragmentRoot(p1, ""); |
808 |
IPath root1 = env.addPackageFragmentRoot(p1, "src"); |
809 |
env.setOutputFolder(p1, "bin"); |
810 |
|
811 |
env.addClass(root1, "java/lang", "Object", |
812 |
"package java.lang;\n" + |
813 |
"public class Object {\n" + |
814 |
" Class getClass() { return null; }\n" + |
815 |
" String toString() { return \"\"; }\n" + // the line that changes |
816 |
"}\n" |
817 |
); |
818 |
|
819 |
//---------------------------- |
820 |
// Project2 |
821 |
//---------------------------- |
822 |
IPath p2 = env.addProject("P2"); |
823 |
// remove old package fragment root so that names don't collide |
824 |
env.removePackageFragmentRoot(p2, ""); |
825 |
IPath root2 = env.addPackageFragmentRoot(p2, "src"); |
826 |
env.setOutputFolder(p2, "bin"); |
827 |
|
828 |
env.addClass(root2, "java/lang", "Class", |
829 |
"package java.lang;\n" + |
830 |
"public class Class {\n" + |
831 |
" String getName() { return \"\"; };\n" + |
832 |
"}\n" |
833 |
); |
834 |
|
835 |
//---------------------------- |
836 |
// Project3 |
837 |
//---------------------------- |
838 |
IPath p3 = env.addProject("P3"); |
839 |
// remove old package fragment root so that names don't collide |
840 |
env.removePackageFragmentRoot(p3, ""); |
841 |
IPath root3 = env.addPackageFragmentRoot(p3, "src"); |
842 |
env.setOutputFolder(p3, "bin"); |
843 |
|
844 |
env.addClass(root3, "java/lang", "String", |
845 |
"package java.lang;\n" + |
846 |
"public class String {\n" + |
847 |
"}\n" |
848 |
); |
849 |
|
850 |
// Dependencies |
851 |
IPath[] accessiblePaths = new IPath[] {new Path("java/lang/*")}; |
852 |
IPath[] forbiddenPaths = new IPath[] {new Path("**/*")}; |
853 |
env.addRequiredProject(p1, p2, accessiblePaths, forbiddenPaths, false); |
854 |
env.addRequiredProject(p1, p3, accessiblePaths, forbiddenPaths, false); |
855 |
env.addRequiredProject(p2, p1, accessiblePaths, forbiddenPaths, false); |
856 |
env.addRequiredProject(p2, p3, accessiblePaths, forbiddenPaths, false); |
857 |
env.addRequiredProject(p3, p1, accessiblePaths, forbiddenPaths, false); |
858 |
env.addRequiredProject(p3, p2, accessiblePaths, forbiddenPaths, false); |
859 |
|
860 |
try { |
861 |
fullBuild(); |
862 |
|
863 |
expectingOnlySpecificProblemsFor(p1,new Problem[]{ |
864 |
new Problem("p1", "A cycle was detected in the build path of project: P1", p1, -1, -1, CategorizedProblem.CAT_BUILDPATH)//$NON-NLS-1$ //$NON-NLS-2$ |
865 |
}); |
866 |
expectingOnlySpecificProblemsFor(p2,new Problem[]{ |
867 |
new Problem("p2", "A cycle was detected in the build path of project: P2", p2, -1, -1, CategorizedProblem.CAT_BUILDPATH)//$NON-NLS-1$ //$NON-NLS-2$ |
868 |
}); |
869 |
expectingOnlySpecificProblemsFor(p3,new Problem[]{ |
870 |
new Problem("p3", "A cycle was detected in the build path of project: P3", p3, -1, -1, CategorizedProblem.CAT_BUILDPATH)//$NON-NLS-1$ //$NON-NLS-2$ |
871 |
}); |
872 |
|
873 |
} finally { |
874 |
JavaCore.setOptions(options); |
875 |
} |
876 |
} |
877 |
|
878 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=114349 |
879 |
// this one passes; compare with testCycle6 (only one change in Object source), |
880 |
// which fails |
881 |
public void testCycle7() throws JavaModelException { |
882 |
Hashtable options = JavaCore.getOptions(); |
883 |
Hashtable newOptions = JavaCore.getOptions(); |
884 |
newOptions.put(JavaCore.CORE_CIRCULAR_CLASSPATH, JavaCore.WARNING); |
885 |
|
886 |
JavaCore.setOptions(newOptions); |
887 |
|
888 |
//---------------------------- |
889 |
// Project1 |
890 |
//---------------------------- |
891 |
IPath p1 = env.addProject("P1"); |
892 |
// remove old package fragment root so that names don't collide |
893 |
env.removePackageFragmentRoot(p1, ""); |
894 |
IPath root1 = env.addPackageFragmentRoot(p1, "src"); |
895 |
env.setOutputFolder(p1, "bin"); |
896 |
|
897 |
env.addClass(root1, "java/lang", "Object", |
898 |
"package java.lang;\n" + |
899 |
"public class Object {\n" + |
900 |
" Class getClass() { return null; }\n" + |
901 |
" String toString() { return null; }\n" + // the line that changes |
902 |
"}\n" |
903 |
); |
904 |
|
905 |
//---------------------------- |
906 |
// Project2 |
907 |
//---------------------------- |
908 |
IPath p2 = env.addProject("P2"); |
909 |
// remove old package fragment root so that names don't collide |
910 |
env.removePackageFragmentRoot(p2, ""); |
911 |
IPath root2 = env.addPackageFragmentRoot(p2, "src"); |
912 |
env.setOutputFolder(p2, "bin"); |
913 |
|
914 |
env.addClass(root2, "java/lang", "Class", |
915 |
"package java.lang;\n" + |
916 |
"public class Class {\n" + |
917 |
" String getName() { return \"\"; };\n" + |
918 |
"}\n" |
919 |
); |
920 |
|
921 |
//---------------------------- |
922 |
// Project3 |
923 |
//---------------------------- |
924 |
IPath p3 = env.addProject("P3"); |
925 |
// remove old package fragment root so that names don't collide |
926 |
env.removePackageFragmentRoot(p3, ""); |
927 |
IPath root3 = env.addPackageFragmentRoot(p3, "src"); |
928 |
env.setOutputFolder(p3, "bin"); |
929 |
|
930 |
env.addClass(root3, "java/lang", "String", |
931 |
"package java.lang;\n" + |
932 |
"public class String {\n" + |
933 |
"}\n" |
934 |
); |
935 |
|
936 |
// Dependencies |
937 |
IPath[] accessiblePaths = new IPath[] {new Path("java/lang/*")}; |
938 |
IPath[] forbiddenPaths = new IPath[] {new Path("**/*")}; |
939 |
env.addRequiredProject(p1, p2, accessiblePaths, forbiddenPaths, false); |
940 |
env.addRequiredProject(p1, p3, accessiblePaths, forbiddenPaths, false); |
941 |
env.addRequiredProject(p2, p1, accessiblePaths, forbiddenPaths, false); |
942 |
env.addRequiredProject(p2, p3, accessiblePaths, forbiddenPaths, false); |
943 |
env.addRequiredProject(p3, p1, accessiblePaths, forbiddenPaths, false); |
944 |
env.addRequiredProject(p3, p2, accessiblePaths, forbiddenPaths, false); |
945 |
|
946 |
try { |
947 |
fullBuild(); |
948 |
|
949 |
expectingOnlySpecificProblemsFor(p1,new Problem[]{ |
950 |
new Problem("p1", "A cycle was detected in the build path of project: P1", p1, -1, -1, CategorizedProblem.CAT_BUILDPATH)//$NON-NLS-1$ //$NON-NLS-2$ |
951 |
}); |
952 |
expectingOnlySpecificProblemsFor(p2,new Problem[]{ |
953 |
new Problem("p2", "A cycle was detected in the build path of project: P2", p2, -1, -1, CategorizedProblem.CAT_BUILDPATH)//$NON-NLS-1$ //$NON-NLS-2$ |
954 |
}); |
955 |
expectingOnlySpecificProblemsFor(p3,new Problem[]{ |
956 |
new Problem("p3", "A cycle was detected in the build path of project: P3", p3, -1, -1, CategorizedProblem.CAT_BUILDPATH)//$NON-NLS-1$ //$NON-NLS-2$ |
957 |
}); |
958 |
|
959 |
} finally { |
960 |
JavaCore.setOptions(options); |
961 |
} |
962 |
} |
963 |
|
783 |
/* |
964 |
/* |
784 |
* Full buid case |
965 |
* Full buid case |
785 |
*/ |
966 |
*/ |
Lines 1223-1227
Link Here
|
1223 |
env.setBuildOrder(null); |
1404 |
env.setBuildOrder(null); |
1224 |
} |
1405 |
} |
1225 |
} |
1406 |
} |
1226 |
|
1407 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=160550 |
|
|
1408 |
public void test0100_cycle_with_bad_library() throws CoreException { |
1409 |
Hashtable options = JavaCore.getOptions(); |
1410 |
Hashtable newOptions = JavaCore.getOptions(); |
1411 |
newOptions.put(JavaCore.CORE_CIRCULAR_CLASSPATH, JavaCore.WARNING); |
1412 |
JavaCore.setOptions(newOptions); |
1413 |
try { |
1414 |
// jar preparation (broken jar: l/Super.class missing) |
1415 |
IPath brokenLibProjectPath = env.addProject("Lib"); |
1416 |
env.addExternalJars(brokenLibProjectPath, Util.getJavaClassLibs()); |
1417 |
IProject brokenLibProject = env.getProject(brokenLibProjectPath); |
1418 |
env.removePackageFragmentRoot(brokenLibProjectPath, ""); |
1419 |
IPath root0 = env.addPackageFragmentRoot(brokenLibProjectPath, "src"); |
1420 |
env.setOutputFolder(brokenLibProjectPath, "bin"); |
1421 |
env.addClass(root0, "l", "Super", |
1422 |
"package l;\n" + |
1423 |
"public class Super {\n" + |
1424 |
"}\n" |
1425 |
); |
1426 |
env.addClass(root0, "l", "Sub", |
1427 |
"package l;\n" + |
1428 |
"public class Sub extends Super {\n" + |
1429 |
"}\n" |
1430 |
); |
1431 |
fullBuild(); |
1432 |
String brokenLibJarExternalPath = |
1433 |
env.addInternalJar(brokenLibProjectPath, "broken.jar", |
1434 |
new String[] {"l/Sub.class"}, new String[]{"bin/l/Sub.class"}, |
1435 |
// avoid to include Super on purpose |
1436 |
false).toString(); |
1437 |
//---------------------------- |
1438 |
// Project1 |
1439 |
//---------------------------- |
1440 |
IPath p1 = env.addProject("P1"); |
1441 |
// remove old package fragment root so that names don't collide |
1442 |
env.removePackageFragmentRoot(p1, ""); |
1443 |
IPath root1 = env.addPackageFragmentRoot(p1, "src"); |
1444 |
env.setOutputFolder(p1, "bin"); |
1445 |
env.addExternalJars(p1, Util.getJavaClassLibs()); |
1446 |
env.addExternalJar(p1, brokenLibJarExternalPath); |
1447 |
/* IPath xPath = */ env.addClass(root1, "p", "X", |
1448 |
"package p;\n" + |
1449 |
"public class X extends l.Sub {\n" + |
1450 |
" q.Y m;\n" + |
1451 |
"}\n" |
1452 |
); |
1453 |
//---------------------------- |
1454 |
// Project2 |
1455 |
//---------------------------- |
1456 |
IPath p2 = env.addProject("P2"); |
1457 |
// remove old package fragment root so that names don't collide |
1458 |
env.removePackageFragmentRoot(p2, ""); |
1459 |
IPath root2 = env.addPackageFragmentRoot(p2, "src"); |
1460 |
env.setOutputFolder(p2, "bin"); |
1461 |
env.addExternalJars(p2, Util.getJavaClassLibs()); |
1462 |
env.addExternalJar(p2, brokenLibJarExternalPath); |
1463 |
/* IPath yPath = */ env.addClass(root2, "q", "Y", |
1464 |
"package q;\n" + |
1465 |
"public class Y extends l.Sub {\n" + |
1466 |
" p.X m;\n" + |
1467 |
"}\n" |
1468 |
); |
1469 |
// Dependencies |
1470 |
env.addRequiredProject(p1, p2, null, null, false); |
1471 |
env.addRequiredProject(p2, p1, null, null, false); |
1472 |
// Re-launcher |
1473 |
class PostBuildJob extends WorkspaceJob implements IResourceChangeListener { |
1474 |
int invocationsNb = 0; |
1475 |
public PostBuildJob() { |
1476 |
super("Post build"); |
1477 |
} |
1478 |
public void resourceChanged(IResourceChangeEvent event) { |
1479 |
invocationsNb++; |
1480 |
if (DEBUG) { |
1481 |
System.out.println("event #" + invocationsNb); |
1482 |
} |
1483 |
schedule(100); |
1484 |
} |
1485 |
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { |
1486 |
try { |
1487 |
Thread.sleep(500); |
1488 |
} catch (InterruptedException e) { /* */ } |
1489 |
return Status.OK_STATUS; |
1490 |
} |
1491 |
} |
1492 |
PostBuildJob listener = new PostBuildJob(); |
1493 |
try { |
1494 |
fullBuild(); |
1495 |
// TODO the problems layout is changed by patches, hence they are deactivated for now |
1496 |
// expectingOnlySpecificProblemsFor(p1, new Problem[] { |
1497 |
// new Problem("p1", "A cycle was detected in the build path of project: P1", |
1498 |
// p1, -1, -1, CategorizedProblem.CAT_BUILDPATH), |
1499 |
// new Problem("p1", "The project was not built since its build path is incomplete. Cannot find the class file for l.Super. Fix the build path then try building this project", |
1500 |
// p1, -1, -1, CategorizedProblem.CAT_BUILDPATH), |
1501 |
// new Problem("p1", "The type l.Super cannot be resolved. It is indirectly referenced from required .class files", |
1502 |
// xPath, 34, 39, CategorizedProblem.CAT_BUILDPATH), |
1503 |
// }); |
1504 |
// expectingOnlySpecificProblemsFor(p2, new Problem[] { |
1505 |
// new Problem("p2", "A cycle was detected in the build path of project: P2", |
1506 |
// p2, -1, -1, CategorizedProblem.CAT_BUILDPATH), |
1507 |
// new Problem("p2", "The project was not built since its build path is incomplete. Cannot find the class file for l.Super. Fix the build path then try building this project", |
1508 |
// p2, -1, -1, CategorizedProblem.CAT_BUILDPATH), |
1509 |
// new Problem("p2", "The type l.Super cannot be resolved. It is indirectly referenced from required .class files", |
1510 |
// yPath, 34, 39, CategorizedProblem.CAT_BUILDPATH), |
1511 |
// }); |
1512 |
IWorkspaceDescription description = brokenLibProject.getWorkspace().getDescription(); |
1513 |
description.setAutoBuilding(true); |
1514 |
brokenLibProject.getWorkspace().setDescription(description); |
1515 |
brokenLibProject.getWorkspace(). |
1516 |
addResourceChangeListener(listener, IResourceChangeEvent.POST_BUILD); |
1517 |
env.addClass(root1, "p", "X", |
1518 |
"package p;\n" + |
1519 |
"public class X extends l.Sub {\n" + |
1520 |
" q.Y m;\n" + |
1521 |
"}\n" |
1522 |
); |
1523 |
try { |
1524 |
Thread.sleep(3000); // beware, too low a delay would miss the point |
1525 |
} catch (InterruptedException e) { /* */ } |
1526 |
if (listener.invocationsNb > 1) { |
1527 |
fail("looping in build (" + listener.invocationsNb + " invocations)"); |
1528 |
} |
1529 |
} finally { |
1530 |
brokenLibProject.getWorkspace().removeResourceChangeListener(listener); |
1531 |
brokenLibProject.getWorkspace().getDescription().setAutoBuilding(false); |
1532 |
} |
1533 |
} finally { |
1534 |
JavaCore.setOptions(options); |
1535 |
} |
1536 |
} |
1537 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=160550 |
1538 |
public void test0101_cycle_with_bad_class_folder() throws CoreException { |
1539 |
Hashtable options = JavaCore.getOptions(); |
1540 |
Hashtable newOptions = JavaCore.getOptions(); |
1541 |
newOptions.put(JavaCore.CORE_CIRCULAR_CLASSPATH, JavaCore.WARNING); |
1542 |
JavaCore.setOptions(newOptions); |
1543 |
try { |
1544 |
// jar preparation (broken jar: l/Super.class missing) |
1545 |
IPath brokenLibProjectPath = env.addProject("Lib"); |
1546 |
env.addExternalJars(brokenLibProjectPath, Util.getJavaClassLibs()); |
1547 |
IProject brokenLibProject = env.getProject(brokenLibProjectPath); |
1548 |
env.removePackageFragmentRoot(brokenLibProjectPath, ""); |
1549 |
IPath root0 = env.addPackageFragmentRoot(brokenLibProjectPath, |
1550 |
"src1", null, false, "bin1"); |
1551 |
env.addClass(root0, "l", "Super", |
1552 |
"package l;\n" + |
1553 |
"public class Super {\n" + |
1554 |
"}\n" |
1555 |
); |
1556 |
root0 = env.addPackageFragmentRoot(brokenLibProjectPath, |
1557 |
"src2", null, false, "bin2"); |
1558 |
env.addClass(root0, "l", "Sub", |
1559 |
"package l;\n" + |
1560 |
"public class Sub extends Super {\n" + |
1561 |
"}\n" |
1562 |
); |
1563 |
fullBuild(); |
1564 |
IPath brokenClassFolderPath = brokenLibProjectPath.append("bin2"); |
1565 |
//---------------------------- |
1566 |
// Project1 |
1567 |
//---------------------------- |
1568 |
IPath p1 = env.addProject("P1"); |
1569 |
// remove old package fragment root so that names don't collide |
1570 |
env.removePackageFragmentRoot(p1, ""); |
1571 |
IPath root1 = env.addPackageFragmentRoot(p1, "src"); |
1572 |
env.setOutputFolder(p1, "bin"); |
1573 |
env.addExternalJars(p1, Util.getJavaClassLibs()); |
1574 |
env.addClassFolder(p1, brokenClassFolderPath); |
1575 |
/* IPath xPath = */ env.addClass(root1, "p", "X", |
1576 |
"package p;\n" + |
1577 |
"public class X extends l.Sub {\n" + |
1578 |
" q.Y m;\n" + |
1579 |
"}\n" |
1580 |
); |
1581 |
//---------------------------- |
1582 |
// Project2 |
1583 |
//---------------------------- |
1584 |
IPath p2 = env.addProject("P2"); |
1585 |
// remove old package fragment root so that names don't collide |
1586 |
env.removePackageFragmentRoot(p2, ""); |
1587 |
IPath root2 = env.addPackageFragmentRoot(p2, "src"); |
1588 |
env.setOutputFolder(p2, "bin"); |
1589 |
env.addExternalJars(p2, Util.getJavaClassLibs()); |
1590 |
env.addClassFolder(p2, brokenClassFolderPath); |
1591 |
/* IPath yPath = */ env.addClass(root2, "q", "Y", |
1592 |
"package q;\n" + |
1593 |
"public class Y extends l.Sub {\n" + |
1594 |
" p.X m;\n" + |
1595 |
"}\n" |
1596 |
); |
1597 |
// Dependencies |
1598 |
env.addRequiredProject(p1, p2, null, null, false); |
1599 |
env.addRequiredProject(p2, p1, null, null, false); |
1600 |
// Re-launcher |
1601 |
class PostBuildJob extends WorkspaceJob implements IResourceChangeListener { |
1602 |
int invocationsNb = 0; |
1603 |
public PostBuildJob() { |
1604 |
super("Post build"); |
1605 |
} |
1606 |
public void resourceChanged(IResourceChangeEvent event) { |
1607 |
invocationsNb++; |
1608 |
if (DEBUG) { |
1609 |
System.out.println("event #" + invocationsNb); |
1610 |
} |
1611 |
schedule(100); |
1612 |
} |
1613 |
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { |
1614 |
try { |
1615 |
Thread.sleep(500); |
1616 |
} catch (InterruptedException e) { /* */ } |
1617 |
return Status.OK_STATUS; |
1618 |
} |
1619 |
} |
1620 |
PostBuildJob listener = new PostBuildJob(); |
1621 |
try { |
1622 |
fullBuild(); |
1623 |
// TODO the problems layout is changed by patches, hence they are deactivated for now |
1624 |
// expectingOnlySpecificProblemsFor(p1, new Problem[] { |
1625 |
// new Problem("p1", "A cycle was detected in the build path of project: P1", |
1626 |
// p1, -1, -1, CategorizedProblem.CAT_BUILDPATH), |
1627 |
// new Problem("p1", "The project was not built since its build path is incomplete. Cannot find the class file for l.Super. Fix the build path then try building this project", |
1628 |
// p1, -1, -1, CategorizedProblem.CAT_BUILDPATH), |
1629 |
// new Problem("p1", "The type l.Super cannot be resolved. It is indirectly referenced from required .class files", |
1630 |
// xPath, 34, 39, CategorizedProblem.CAT_BUILDPATH), |
1631 |
// }); |
1632 |
// expectingOnlySpecificProblemsFor(p2, new Problem[] { |
1633 |
// new Problem("p2", "A cycle was detected in the build path of project: P2", |
1634 |
// p2, -1, -1, CategorizedProblem.CAT_BUILDPATH), |
1635 |
// new Problem("p2", "The project was not built since its build path is incomplete. Cannot find the class file for l.Super. Fix the build path then try building this project", |
1636 |
// p2, -1, -1, CategorizedProblem.CAT_BUILDPATH), |
1637 |
// new Problem("p2", "The type l.Super cannot be resolved. It is indirectly referenced from required .class files", |
1638 |
// yPath, 34, 39, CategorizedProblem.CAT_BUILDPATH), |
1639 |
// }); |
1640 |
IWorkspaceDescription description = brokenLibProject.getWorkspace().getDescription(); |
1641 |
description.setAutoBuilding(true); |
1642 |
brokenLibProject.getWorkspace().setDescription(description); |
1643 |
brokenLibProject.getWorkspace(). |
1644 |
addResourceChangeListener(listener, IResourceChangeEvent.POST_BUILD); |
1645 |
env.addClass(root1, "p", "X", |
1646 |
"package p;\n" + |
1647 |
"public class X extends l.Sub {\n" + |
1648 |
" q.Y m;\n" + |
1649 |
"}\n" |
1650 |
); |
1651 |
try { |
1652 |
Thread.sleep(3000); // beware, too low a delay would miss the point |
1653 |
} catch (InterruptedException e) { /* */ } |
1654 |
if (listener.invocationsNb > 1) { |
1655 |
fail("looping in build (" + listener.invocationsNb + " invocations)"); |
1656 |
} |
1657 |
} finally { |
1658 |
brokenLibProject.getWorkspace().removeResourceChangeListener(listener); |
1659 |
brokenLibProject.getWorkspace().getDescription().setAutoBuilding(false); |
1660 |
} |
1661 |
} finally { |
1662 |
JavaCore.setOptions(options); |
1663 |
} |
1664 |
} |
1227 |
} |
1665 |
} |