ctolkmit / checker-framework

Automatically exported from code.google.com/p/checker-framework
0 stars 0 forks source link

unit-checker with custom type fails to catch type mismatch #377

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download attached project
2. run ./build.sh
3.

What is the expected output? What do you see instead?
Compilation should fail because Main.java has a type mismatch. 

What version of the product are you using? On what operating system?
checker-1.8.7.jar on Fedora 3.15.6-200.fc20.x86_64

Please provide any additional information below.
In the build output, you can see these lines. 

warning: Could not find class for unit: Price. Ignoring unit.
warning: Could not find class for unit: Quantity. Ignoring unit.

However, I have specified the compile step with "-Aunits=Price,Quantity". 

Any help would be appreciated. 

Harsha

Original issue reported on code.google.com by harsha...@gmail.com on 17 Nov 2014 at 6:01

Attachments:

GoogleCodeExporter commented 9 years ago
Also, here's my output from running build.sh. 

Original comment by harsha...@gmail.com on 17 Nov 2014 at 6:04

Attachments:

GoogleCodeExporter commented 9 years ago
The classpath in the build file does not contain the working directory, which 
is why the UnitsChecker can't find them:

warning: Could not find class for unit: Price. Ignoring unit.
warning: Could not find class for unit: Quantity. Ignoring unit.

Add . to the classpath:
-cp .:checker-1.8.7.jar

Original comment by smil...@cs.washington.edu on 17 Nov 2014 at 6:32

GoogleCodeExporter commented 9 years ago

Original comment by Suzanne....@gmail.com on 17 Nov 2014 at 6:33