tailorlala / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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)

Original issue reported on code.google.com by shridhar...@googlemail.com on 12 Sep 2014 at 3:42

GoogleCodeExporter commented 9 years ago
closeQuietly(Closeable) was intentionally deprecated and then removed (see 
https://code.google.com/p/guava-libraries/issues/detail?id=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.

Original comment by cgdecker@google.com on 12 Sep 2014 at 4:42

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07