/** Test for Bug #5102. Never reproduced but interesting little test, worth keeping around */ public void testPR() throws Exception { // create a project with a RefreshLocalJavaFileBuilder and a SortBuilder on the classpath IProject project = getWorkspace().getRoot().getProject("P1"); project.create(null); project.open(null); IProjectDescription desc = project.getDescription(); ICommand one = desc.newCommand(); one.setBuilderName(RefreshLocalJavaFileBuilder.BUILDER_NAME); ICommand two = desc.newCommand(); two.setBuilderName(SortBuilder.BUILDER_NAME); desc.setBuildSpec(new ICommand[] {one, two}); project.setDescription(desc, null); // do a full build project.build(IncrementalProjectBuilder.FULL_BUILD, null); // do an incremental build by creating a file IFile file = project.getFile("Foo"); file.create(getRandomContents(), true, getMonitor()); }
private boolean hasJavaBuilder(IProject project) throws CoreException { ICommand[] buildCommands = project.getDescription().getBuildSpec(); for (int i = 0, l = buildCommands.length; i < l; i++) if (buildCommands[i].getBuilderName().equals(JavaCore.BUILDER_ID)) return true; return false; }