Commits

Anonymous committed 04ea6ca

Update Unit Checker example so that it compiles

Comments (0)

Files changed (5)

checker/examples/units-extension/Demo.java

-import checkers.units.quals.*;
+import org.checkerframework.checker.units.qual.*;
 
 public class Demo {
     @Hz int frq;

checker/examples/units-extension/Frequency.java

 import java.lang.annotation.*;
 
+import org.checkerframework.checker.units.qual.UnknownUnits;
+import org.checkerframework.framework.qual.*;
 
 
 /**
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
 @TypeQualifier
-@SubtypeOf( { Unqualified.class } )
+@SubtypeOf( { UnknownUnits.class } )
 public @interface Frequency {}

checker/examples/units-extension/FrequencyRelations.java

 import javax.annotation.processing.ProcessingEnvironment;
 import javax.lang.model.element.AnnotationMirror;
 
-import checkers.types.AnnotatedTypeMirror;
-import checkers.util.AnnotationUtils;
-import checkers.util.AnnotationBuilder;
-
-import checkers.units.*;
+import org.checkerframework.checker.units.UnitsRelations;
+import org.checkerframework.checker.units.qual.*;
+import org.checkerframework.framework.type.AnnotatedTypeMirror;
+import org.checkerframework.framework.util.AnnotationBuilder;
 
 /** Relations among units of frequency. */
 public class FrequencyRelations implements UnitsRelations {
 
     public UnitsRelations init(ProcessingEnvironment env) {
         AnnotationBuilder builder = new AnnotationBuilder(env, Hz.class);
-        builder.setValue("value", checkers.units.quals.Prefix.one);
+        builder.setValue("value", Prefix.one);
         hz = builder.build();
 
-        builder = new AnnotationBuilder(env, checkers.units.quals.s.class);
-        builder.setValue("value", checkers.units.quals.Prefix.one);
+        builder = new AnnotationBuilder(env,  org.checkerframework.checker.units.qual.s.class);
+        builder.setValue("value", Prefix.one);
         s = builder.build();
 
         return this;

checker/examples/units-extension/Hz.java

 import java.lang.annotation.*;
 
+import org.checkerframework.checker.units.qual.Prefix;
+import org.checkerframework.checker.units.qual.UnitsRelations;
 import org.checkerframework.framework.qual.*;
 
 /**

checker/examples/units-extension/Makefile

-JAVAC?=../../checkers/bin/javac
+JAVAC?=../../bin/javac
 
 FILES=Frequency.java \
   FrequencyRelations.java \