Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing function closeQuietly(Ljava/io/Closeable;) in latest version of guava jar #1846

Closed
gissuebot opened this issue Oct 31, 2014 · 1 comment

Comments

@gissuebot
Copy link

Original issue created by shridhar.patil01 on 2014-09-12 at 03:42 PM


My jenkins plugin works on guava 17.0 and jenkins version 1.578 works on guava 11.0.0 jar.
I am using Jenkins 1.578 and my plugin works on guava-17.0.jar.
In Jenkins lib folder we have guava-11.0.1.jar.
Scenario 1.
On Windows 7 Enterprise 64-bit : I replaced the 11.0.0 jar with 17.0 version and my plugin and Jenkins both works fine.
Scenario 2.
On Linux x86_64 I replaced the 11.0.0 jar with 17.0 version and my plugin works fine.
but after successfully running the job on Jenkins, I get error while opening the output console and I have to view the output on Plain text option.
Exception
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-1.578.jar!/hudson/model/Run/console.jelly:65:27: <j:whitespace> com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V
at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:103)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:390)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)

@gissuebot
Copy link
Author

Original comment posted by cgdecker@google.com on 2014-09-12 at 04:42 PM


closeQuietly(Closeable) was intentionally deprecated and then removed (see #1118 As of 17.0, there's closeQuietly(InputStream) and closeQuietly(Reader), as closeQuietly is generally safe in those cases. Using it with a stream that's used for output is a bad idea, which is why we removed it.

You should be able to replace it with try-with-resources (best) or Closer in most cases.


Status: WorkingAsIntended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant