vancetang / reflections

Automatically exported from code.google.com/p/reflections
Do What The F*ck You Want To Public License
0 stars 0 forks source link

ZipDir.close() uses Java 7 API #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Compile the project with Java 5.

What is the expected output? What do you see instead?

The project should compile without errors, but instead you get

  ZipDir.java:[49,13] close(java.io.Closeable) in
  org.reflections.util.Utils cannot be applied to
  (java.util.zip.ZipFile)'

What version of the product are you using? On what operating system?

Version: 0.9.7-SNAPSHOT (Revision 155)
Java: 1.5.0_22

Please provide any additional information below.

ZipDir.close() uses Utils.close() which expects an object that implements 
Closeable. ZipFile does not implements Closeable in Java 5, it is first 
implemented in Java 7, so the code does not compile and run on Java 5 anymore 
(which is the specified Java version in the pom.xml of reflections-parent).

Original issue reported on code.google.com by reb...@gmx.ch on 3 May 2012 at 7:57

GoogleCodeExporter commented 9 years ago
as a quick fix you might use the attached patch

Original comment by gesellix on 4 May 2012 at 6:42

Attachments:

GoogleCodeExporter commented 9 years ago
on trunk

Original comment by ronm...@gmail.com on 4 May 2012 at 3:31

GoogleCodeExporter commented 9 years ago

Original comment by ronm...@gmail.com on 4 May 2012 at 3:31

GoogleCodeExporter commented 9 years ago
The attached file seems to be damaged. When I download it i always get a 2.8 KB 
file with all bytes being 0. I already wrote a workaround myself, but thanks 
for the effort.

I also noticed that guava 12.0 is compiled for Java 6, so reflections 0.9.7 
will not work with Java 5 even if this issue is fixed. Personally I think a 
library should be usable for as many Java versions as possible, but I don't 
know if you need any guava 12.0 functions, of you could use 11.0.2 instead.

Original comment by reb...@gmx.ch on 4 May 2012 at 4:57

GoogleCodeExporter commented 9 years ago
fixed 0.9.7

Original comment by ronm...@gmail.com on 22 May 2012 at 7:47