Lines 228-233
Link Here
|
228 |
otherPackageInfoPath, |
228 |
otherPackageInfoPath, |
229 |
new Problem("my/foo/package-info.java", "The type package-info is already defined", otherPackageInfoPath, 0, 0, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ |
229 |
new Problem("my/foo/package-info.java", "The type package-info is already defined", otherPackageInfoPath, 0, 0, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ |
230 |
} |
230 |
} |
|
|
231 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=323785 |
232 |
// (NPE upon creation/deletion of package-info.java in default package) |
233 |
public void test323785 () throws JavaModelException { |
234 |
|
235 |
IPath projectPath = env.addProject("Project", "1.5"); |
236 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
237 |
fullBuild(projectPath); |
238 |
|
239 |
// remove old package fragment root so that names don't collide |
240 |
env.removePackageFragmentRoot(projectPath, ""); |
241 |
|
242 |
IPath root = env.addPackageFragmentRoot(projectPath, "src"); |
243 |
env.setOutputFolder(projectPath, "bin"); |
244 |
|
245 |
fullBuild(projectPath); |
246 |
|
247 |
env.addFile(root, "package-info.java", ""); |
248 |
|
249 |
incrementalBuild(projectPath); |
250 |
expectingNoProblems(); |
251 |
|
252 |
} |
253 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=323785 |
254 |
// verify that changes to package info containing secondary types do trigger incremental build. |
255 |
public void test323785a () throws JavaModelException { |
256 |
|
257 |
IPath projectPath = env.addProject("Project", "1.5"); |
258 |
env.addExternalJars(projectPath, Util.getJavaClassLibs()); |
259 |
fullBuild(projectPath); |
260 |
|
261 |
// remove old package fragment root so that names don't collide |
262 |
env.removePackageFragmentRoot(projectPath, ""); |
263 |
|
264 |
IPath root = env.addPackageFragmentRoot(projectPath, "src"); |
265 |
env.setOutputFolder(projectPath, "bin"); |
266 |
|
267 |
IPath xJavaPath = env.addFile(root, "X.java", "class X extends Y {}\n"); |
268 |
fullBuild(projectPath); |
269 |
env.addFile(root, "package-info.java", "class Y {}\n"); |
270 |
incrementalBuild(projectPath); |
271 |
expectingNoProblems(); |
272 |
env.addFile(root, "package-info.java", "final class Y {}\n"); |
273 |
incrementalBuild(projectPath); |
274 |
expectingOnlySpecificProblemFor( |
275 |
xJavaPath, |
276 |
new Problem("X.java", "The type X cannot subclass the final class Y", xJavaPath, 16, 17, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); |
277 |
|
278 |
} |
231 |
protected void assertSourceEquals(String message, String expected, String actual) { |
279 |
protected void assertSourceEquals(String message, String expected, String actual) { |
232 |
if (actual == null) { |
280 |
if (actual == null) { |
233 |
assertEquals(message, expected, null); |
281 |
assertEquals(message, expected, null); |