The method sort underfined for the type List<Range<Integer>>
ioflows opened this issue · 2 comments
Hi, thoqbk! I have downloaded the repository and I find there existing some error when use maven to packaging the jar. The error message are as follows:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /E:/Repo/traprange-master/src/test/java/com/giaybac/traprange/test/TESTP
DFBox.java:[57,15] 找不到符号
符号: 方法 sort(<匿名java.util.Comparator<com.google.common.collect.Range>>)
位置: 类型为java.util.List<com.google.common.collect.Range<java.lang.Integer>>
的变量 ranges
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.129 s
[INFO] Finished at: 2015-11-18T12:03:09+08:00
[INFO] Final Memory: 14M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:testCompile (default-testCompile) on project traprange: Compilation failure
[ERROR] /E:/Repo/traprange-master/src/test/java/com/giaybac/traprange/test/TESTP
DFBox.java:[57,15] 找不到符号
[ERROR] 符号: 方法 sort(<匿名java.util.Comparator<com.google.common.collect.Ra
nge>>)
[ERROR] 位置: 类型为java.util.List<com.google.common.collect.Range<java.lang.Int
eger>>的变量 ranges
I continue to move the project into Eclipse. After I fixed the libraries settings according to the pom.xml and import suggestions, the following code in PDFTableExtractor.java are suggested wrong.
this.textPositions.sort(new Comparator<TextPosition>() {
This appeared in many other java files, e.g. TrapRangeBuilder, and TESTPDFBox. And here is the Eclipse suggestion:
The method sort(new Comparator<Range>(){}) is undefined for the type List<Range<Integer>>
Could you make it clear how you implement the sort method?
Thank you very much.
Win 7 x64
Apache Maven 3.3.3
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
Hi friend!
My current implementation uses some Java 8 methods so it doesn't work in your environment.
The easiest way to make it run is upgrade the environment to Java 8, otherwise you can replace this statement by using method: Collections.sort.
I'm sorry because I didn't clarify it before.
Thank you so much!
Tho Q
Thanks for your reply! I have fixed that by using Java 8.