/** * @see https://community.jboss.org/message/732539#732539 * @param projectName * @param pkgName */ private void jaxWsApi22RequirementWorkaround(String projectName, String pkgName) { SWTBotEclipseEditor editor = packageExplorer .openFile(projectName, "src", pkgName, "AreaService_Service.java") .toTextEditor(); String text = editor.getText(); boolean putComment = false; StringBuilder output = new StringBuilder(); for (String line : text.split(System.getProperty("line.separator"))) { if (line.contains( "This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2")) { putComment = true; } if (putComment) { output.append("//"); if (line.contains("}")) { putComment = false; } } output.append(line); output.append(System.getProperty("line.separator")); } editor.setText(output.toString()); editor.saveAndClose(); }