aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark ""Recompile with -Xlint:unchecked for details message" appear when run Ant project" Watch ""Recompile with -Xlint:unchecked for details message" appear when run Ant project" New topic
Author

"Recompile with -Xlint:unchecked for details message" appear when run Ant project

Haifeng Jiang
Ranch Hand

Joined: Dec 14, 2008
Posts: 42
Hi guys,

When I run build.xml I got below error message. Anyone can help on this? Thanks in advance.
Buildfile: D:\eclipse\workspace\testAnt\build.xml
compile:
[echo] compile the project
[javac] Compiling 13 source files to D:\classes
[javac] D:\eclipse\workspace\BmiJava\reng\report\statement\SctnSVISalesOpptyDetails.java:193: compareTo(java.math.BigDecimal) in java.math.BigDecimal cannot be applied to (java.lang.Object)
[javac] BIG_DECIMAL_ZERO.compareTo(endUserEntitledPrice) == 0)
[javac] ^
[javac] D:\eclipse\workspace\BmiJava\reng\report\statement\SctnSVISalesOpptyDetails.java:249: compareTo(java.math.BigDecimal) in java.math.BigDecimal cannot be applied to (java.lang.Object)
[javac] BIG_DECIMAL_ZERO.compareTo(endUserEntitledPrice) == 0)
[javac] ^
[javac] Note: D:\eclipse\workspace\BmiJava\fwf\WfBlock.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors

BUILD FAILED
D:\eclipse\workspace\testAnt\build.xml:22: Compile failed; see the compiler error output for details.

Total time: 1 second


Thinking a lot. Gaining a lot.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

You're getting a standard Java compile error:

compareTo(java.math.BigDecimal) in java.math.BigDecimal cannot be applied to (java.lang.Object), I'm guessing BIG_DECIMAL_ZERO is declared as an Object, it needs to be a BigDecimal.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Haifeng Jiang
Ranch Hand

Joined: Dec 14, 2008
Posts: 42
Martijn Verburg wrote:You're getting a standard Java compile error:

compareTo(java.math.BigDecimal) in java.math.BigDecimal cannot be applied to (java.lang.Object), I'm guessing BIG_DECIMAL_ZERO is declared as an Object, it needs to be a BigDecimal.

But when I use eclipse, the project can be compiled successfully. And I checked I used the same version 1.6 Jdk to compile the project.

My build.xml file as below:


Does that error relate to the jdk version? Or ant will use there own jdk to compile the project? Can help me on this? Thanks.
Haifeng Jiang
Ranch Hand

Joined: Dec 14, 2008
Posts: 42
I got the answer just now. The cause is compareTo method doesn't allow Object as the type of parameter. Now I forcibly convert it to BigDecimal. Now it works fine. Thanks so much!

BIG_DECIMAL_ZERO.compareTo((BigDecimal)endUserEntitledPrice) == 0)
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Well done! And thanks for posting back your solution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "Recompile with -Xlint:unchecked for details message" appear when run Ant project