Lines 108-113
Link Here
|
108 |
expectingNoProblems(); |
108 |
expectingNoProblems(); |
109 |
} |
109 |
} |
110 |
|
110 |
|
|
|
111 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=231293 |
112 |
public void testMissingRequiredBinaries() throws JavaModelException { |
113 |
|
114 |
IPath p1 = env.addProject("P1", "1.5"); //$NON-NLS-1$ |
115 |
IPath p2 = env.addProject("P2"); //$NON-NLS-1$ |
116 |
|
117 |
env.addExternalJars(p1, Util.getJavaClassLibs()); |
118 |
// remove old package fragment root so that names don't collide |
119 |
env.removePackageFragmentRoot(p1, ""); //$NON-NLS-1$ |
120 |
IPath root1 = env.addPackageFragmentRoot(p1, "src"); //$NON-NLS-1$ |
121 |
env.setOutputFolder(p1, "bin"); //$NON-NLS-1$ |
122 |
|
123 |
env.addExternalJars(p2, Util.getJavaClassLibs()); |
124 |
// remove old package fragment root so that names don't collide |
125 |
env.removePackageFragmentRoot(p2, ""); //$NON-NLS-1$ |
126 |
IPath root2 = env.addPackageFragmentRoot(p2, "src"); //$NON-NLS-1$ |
127 |
IPath p2bin = env.setOutputFolder(p2, "bin"); //$NON-NLS-1$ |
128 |
|
129 |
env.addClass(root2, "p2", "Y", //$NON-NLS-1$ //$NON-NLS-2$ |
130 |
"package p2;\n"+ //$NON-NLS-1$ |
131 |
"public class Y {\n"+ //$NON-NLS-1$ |
132 |
" public void foo(int i) {}\n"+ //$NON-NLS-1$ |
133 |
" public void foo(int i, Z z) {}\n"+ //$NON-NLS-1$ |
134 |
"}\n"+ //$NON-NLS-1$ |
135 |
"class Z {}" //$NON-NLS-1$ |
136 |
); |
137 |
|
138 |
fullBuild(); |
139 |
expectingNoProblems(); |
140 |
|
141 |
env.addClassFolder(p1, p2bin, false); |
142 |
env.removeFile(p2bin.append("p2/Z.class")); //$NON-NLS-1$ |
143 |
|
144 |
env.addClass(root1, "p1", "X", //$NON-NLS-1$ //$NON-NLS-2$ |
145 |
"package p1;\n"+ //$NON-NLS-1$ |
146 |
"public class X {\n"+ //$NON-NLS-1$ |
147 |
" void test(p2.Y y) { y.foo(1); }\n"+ //$NON-NLS-1$ |
148 |
"}\n" //$NON-NLS-1$ |
149 |
); |
150 |
|
151 |
incrementalBuild(p1); |
152 |
expectingNoProblems(); |
153 |
|
154 |
IPath xx = env.addClass(root1, "p1", "XX", //$NON-NLS-1$ //$NON-NLS-2$ |
155 |
"package p1;\n"+ //$NON-NLS-1$ |
156 |
"public class XX {\n"+ //$NON-NLS-1$ |
157 |
" void test(p2.Y y) { y.foo('c'); }\n"+ //$NON-NLS-1$ |
158 |
"}\n" //$NON-NLS-1$ |
159 |
); |
160 |
|
161 |
incrementalBuild(p1); |
162 |
expectingOnlySpecificProblemsFor(p1,new Problem[]{ |
163 |
new Problem("p1", "The project was not built since its build path is incomplete. Cannot find the class file for p2.Z. Fix the build path then try building this project", p1, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR),//$NON-NLS-1$ //$NON-NLS-2$ |
164 |
new Problem("p1", "The type p2.Z cannot be resolved. It is indirectly referenced from required .class files", xx, 51, 61, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR)//$NON-NLS-1$ //$NON-NLS-2$ |
165 |
}); |
166 |
} |
167 |
|
111 |
public void testParameterizedMemberType() throws JavaModelException { |
168 |
public void testParameterizedMemberType() throws JavaModelException { |
112 |
IPath projectPath = env.addProject("Project", "1.5"); |
169 |
IPath projectPath = env.addProject("Project", "1.5"); |
113 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
170 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |