[JIRA] [cobertura] (JENKINS-18858) Cobertura Unable to delete coverage.xml on windows
Rahul Parekh commented on JENKINS-18858 Cobertura Unable to delete coverage.xml on windows We are running into the same issue and would appreciate if the fix can be pulled in. Thanks! This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] [cobertura] (JENKINS-18858) Cobertura Unable to delete coverage.xml on windows
SCM/JIRA link daemon commented on JENKINS-18858 Cobertura Unable to delete coverage.xml on windows Code changed in jenkins User: Roman Erzhukov Path: src/main/java/hudson/plugins/cobertura/CoberturaCoverageParser.java src/main/java/hudson/plugins/cobertura/IOUtils.java src/main/java/hudson/plugins/cobertura/renderers/SourceCodePainter.java http://jenkins-ci.org/commit/cobertura-plugin/0493955e7caae5c990fdc10fd3dc050910695467 Log: fix JENKINS-18858 This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] [cobertura] (JENKINS-18858) Cobertura Unable to delete coverage.xml on windows
SCM/JIRA link daemon commented on JENKINS-18858 Cobertura Unable to delete coverage.xml on windows Code changed in jenkins User: Seiji Sogabe Path: src/main/java/hudson/plugins/cobertura/CoberturaCoverageParser.java src/main/java/hudson/plugins/cobertura/IOUtils.java src/main/java/hudson/plugins/cobertura/renderers/SourceCodePainter.java http://jenkins-ci.org/commit/cobertura-plugin/c0f7d7be1f553821f0ea7029fa4344654faa5fb7 Log: Merge pull request #17 from romaerzhuk/master fix JENKINS-18858 Compare: https://github.com/jenkinsci/cobertura-plugin/compare/e43258c5ad57...c0f7d7be1f55 This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] [cobertura] (JENKINS-18858) Cobertura Unable to delete coverage.xml on windows
sogabe commented on JENKINS-18858 Cobertura Unable to delete coverage.xml on windows @Roman, Why don't you create pull request? This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] [cobertura] (JENKINS-18858) Cobertura Unable to delete coverage.xml on windows
Roman Erzhukov commented on JENKINS-18858 Cobertura Unable to delete coverage.xml on windows I make it now. This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] [cobertura] (JENKINS-18858) Cobertura Unable to delete coverage.xml on windows
Roman Erzhukov commented on JENKINS-18858 Cobertura Unable to delete coverage.xml on windows diff --git a/src/main/java/hudson/plugins/cobertura/CoberturaCoverageParser.java b/src/main/java/hudson/plugins/cobertura/CoberturaCoverageParser.java index d82fb6a..faeead6 100644 a/src/main/java/hudson/plugins/cobertura/CoberturaCoverageParser.java +++ b/src/main/java/hudson/plugins/cobertura/CoberturaCoverageParser.java @@ -51,13 +51,8 @@ public class CoberturaCoverageParser { bufferedInputStream = new BufferedInputStream(fileInputStream); return parse(bufferedInputStream, cumulative, sourcePaths); } finally { try { -if (bufferedInputStream != null) -bufferedInputStream.close(); -if (fileInputStream != null) -fileInputStream.close(); -} catch (IOException e) { -} +IOUtils.closeQuietly(bufferedInputStream); +IOUtils.closeQuietly(fileInputStream); } } diff --git a/src/main/java/hudson/plugins/cobertura/IOUtils.java b/src/main/java/hudson/plugins/cobertura/IOUtils.java new file mode 100644 index 000..6067365 /dev/null +++ b/src/main/java/hudson/plugins/cobertura/IOUtils.java @@ -0,0 +1,21 @@ +package hudson.plugins.cobertura; + +import java.io.Closeable; + +/** + * General IO stream manipulation utilities. + */ +public class IOUtils { + /** +* Closes a Closeable unconditionally. +* Equivalent to Closeable.close(), except any exceptions will be ignored. This is typically used in finally blocks. +*/ +public static void closeQuietly(Closeable closeable) { +if (closeable != null) { +try { + closeable.close(); +} catch (Throwable t) { +} +} + } +} diff --git a/src/main/java/hudson/plugins/cobertura/renderers/SourceCodePainter.java b/src/main/java/hudson/plugins/cobertura/renderers/SourceCodePainter.java index 0e6e0d0..a6c968e 100644 a/src/main/java/hudson/plugins/cobertura/renderers/SourceCodePainter.java +++ b/src/main/java/hudson/plugins/cobertura/renderers/SourceCodePainter.java @@ -1,5 +1,7 @@ package hudson.plugins.cobertura.renderers; +import static hudson.plugins.cobertura.IOUtils.closeQuietly; + import hudson.FilePath; import hudson.model.BuildListener; import hudson.plugins.cobertura.targets.CoveragePaint; @@ -97,26 +99,12 @@ public class SourceCodePainter implements FilePath.FileCallableBoolean, Serial } } finally { if (output != null) { -output.close(); -} if (bos != null) { -bos.close(); -} if (input != null) { -input.close(); -} if (is != null) { -is.close(); -} - - if (os != null) { -os.close(); -} if (reader != null) { -reader.close(); -} +closeQuietly(output); +closeQuietly(bos); +closeQuietly(input); +closeQuietly(is); +closeQuietly(os); +closeQuietly(reader); } } This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] [cobertura] (JENKINS-18858) Cobertura Unable to delete coverage.xml on windows
Roman Erzhukov created JENKINS-18858 Cobertura Unable to delete coverage.xml on windows Issue Type: Bug Assignee: stephenconnolly Components: cobertura Created: 19/Jul/13 6:17 PM Description: Sometimes job starting fails after successful executed with the error: ERROR: Failed to update svn://... org.tmatesoft.svn.core.SVNException: svn: E204900: Unable to delete ...\target\cobertura\report\coverage.xml at hudson.scm.subversion.UpdateWithCleanUpdater$TaskImpl$1.handleStatus(UpdateWithCleanUpdater.java:78) at org.tmatesoft.svn.core.wc.SVNStatusClient$1.receive(SVNStatusClient.java:356) at org.tmatesoft.svn.core.wc.SVNStatusClient$1.receive(SVNStatusClient.java:353) at org.tmatesoft.svn.core.wc2.SvnReceivingOperation.receive(SvnReceivingOperation.java:78) at org.tmatesoft.svn.core.internal.wc2.old.SvnOldGetStatus.handleStatus(SvnOldGetStatus.java:37) at org.tmatesoft.svn.core.internal.wc.SVNStatusEditor.sendUnversionedStatus(SVNStatusEditor.java:361) at org.tmatesoft.svn.core.internal.wc.SVNStatusEditor.getDirStatus(SVNStatusEditor.java:209) at org.tmatesoft.svn.core.internal.wc.SVNStatusEditor.handleDirEntry(SVNStatusEditor.java:321) at org.tmatesoft.svn.core.internal.wc.SVNStatusEditor.getDirStatus(SVNStatusEditor.java:256) at org.tmatesoft.svn.core.internal.wc.SVNStatusEditor.handleDirEntry(SVNStatusEditor.java:321) at org.tmatesoft.svn.core.internal.wc.SVNStatusEditor.getDirStatus(SVNStatusEditor.java:256) at org.tmatesoft.svn.core.internal.wc.SVNStatusEditor.closeEdit(SVNStatusEditor.java:114) at org.tmatesoft.svn.core.internal.wc16.SVNStatusClient16.doStatus(SVNStatusClient16.java:430) at org.tmatesoft.svn.core.internal.wc2.old.SvnOldGetStatus.run(SvnOldGetStatus.java:22) at org.tmatesoft.svn.core.internal.wc2.old.SvnOldGetStatus.run(SvnOldGetStatus.java:13) at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20) at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235) at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:291) at org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.java:360) at hudson.scm.subversion.UpdateWithCleanUpdater$TaskImpl.preUpdate(UpdateWithCleanUpdater.java:66) at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:151) at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:153) at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:903) at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:884) at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:867) at hudson.FilePath.act(FilePath.java:906) at hudson.FilePath.act(FilePath.java:879) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:843) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:781) at hudson.model.AbstractProject.checkout(AbstractProject.java:1387) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) Caused by: svn: E204900: Unable to delete ...\target\cobertura\report\coverage.xml at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:109) ... 37 more Caused by: java.io.IOException: Unable to delete ...\target\cobertura\report\coverage.xml at hudson.Util.deleteFile(Util.java:253) at hudson.Util.deleteRecursive(Util.java:305) at hudson.Util.deleteContentsRecursive(Util.java:202) at hudson.Util.deleteRecursive(Util.java:296) at hudson.Util.deleteContentsRecursive(Util.java:202) at hudson.Util.deleteRecursive(Util.java:296) at hudson.Util.deleteContentsRecursive(Util.java:202) at hudson.Util.deleteRecursive(Util.java:296) at