com.google.java.contract.PreconditionError: !code.isEmpty() at com.google.java.contract.core.apt.AnnotationSourceInfo.<init>.<pre>(AnnotationSourceInfo.java:55)

GitHub | nhatminhle | 2 years ago
  1. 0

    regression with cofoja-1.1-r146 annotation processor (pre-condition violation of cofoja itself)

    GitHub | 2 years ago | nhatminhle
    com.google.java.contract.PreconditionError: !code.isEmpty() at com.google.java.contract.core.apt.AnnotationSourceInfo.<init>.<pre>(AnnotationSourceInfo.java:55)

    Root Cause Analysis

    1. com.google.java.contract.PreconditionError

      !code.isEmpty() at com.google.java.contract.core.apt.AnnotationSourceInfo.<init>.<pre>(AnnotationSourceInfo.java:55)

      at com.google.java.contract.core.apt.AnnotationSourceInfo.<init>()
    2. Cofoja
      TypeBuilder$ContractExtensionBuilder.visitType
      1. com.google.java.contract.core.apt.AnnotationSourceInfo.<init>(AnnotationSourceInfo.java:65)
      2. com.google.java.contract.core.apt.AbstractTypeBuilder.createContractModel(AbstractTypeBuilder.java:174)
      3. com.google.java.contract.core.apt.AbstractTypeBuilder.visitAnnotation(AbstractTypeBuilder.java:206)
      4. com.google.java.contract.core.apt.AbstractTypeBuilder.scanAnnotations(AbstractTypeBuilder.java:277)
      5. com.google.java.contract.core.apt.TypeBuilder$ContractExtensionBuilder.visitType(TypeBuilder.java:99)
      6. com.google.java.contract.core.apt.TypeBuilder$ContractExtensionBuilder.visitType(TypeBuilder.java:85)
      6 frames
    3. Java Tools
      Symbol$ClassSymbol.accept
      1. com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:892)
      1 frame
    4. Cofoja
      TypeBuilder$ContractExtensionBuilder.visitType
      1. com.google.java.contract.core.apt.TypeBuilder.scanSuper(TypeBuilder.java:441)
      2. com.google.java.contract.core.apt.TypeBuilder$ContractExtensionBuilder.visitType(TypeBuilder.java:103)
      3. com.google.java.contract.core.apt.TypeBuilder$ContractExtensionBuilder.visitType(TypeBuilder.java:85)
      3 frames
    5. Java Tools
      Symbol$ClassSymbol.accept
      1. com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:892)
      1 frame
    6. Cofoja
      TypeBuilder$ContractExtensionBuilder.visitType
      1. com.google.java.contract.core.apt.TypeBuilder.scanSuper(TypeBuilder.java:436)
      2. com.google.java.contract.core.apt.TypeBuilder$ContractExtensionBuilder.visitType(TypeBuilder.java:103)
      3. com.google.java.contract.core.apt.TypeBuilder$ContractExtensionBuilder.visitType(TypeBuilder.java:85)
      3 frames
    7. Java Tools
      Symbol$ClassSymbol.accept
      1. com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:892)
      1 frame
    8. Cofoja
      TypeBuilder.visitType
      1. com.google.java.contract.core.apt.TypeBuilder.scanSuper(TypeBuilder.java:436)
      2. com.google.java.contract.core.apt.TypeBuilder.visitType(TypeBuilder.java:272)
      3. com.google.java.contract.core.apt.TypeBuilder.visitType(TypeBuilder.java:65)
      3 frames
    9. Java Tools
      Symbol$ClassSymbol.accept
      1. com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:892)
      1 frame
    10. Cofoja
      AnnotationProcessor.process
      1. com.google.java.contract.core.apt.TypeFactory.createType(TypeFactory.java:76)
      2. com.google.java.contract.core.apt.AnnotationProcessor.createTypes(AnnotationProcessor.java:327)
      3. com.google.java.contract.core.apt.AnnotationProcessor.process(AnnotationProcessor.java:166)
      3 frames
    11. Java Tools
      Main.compile
      1. com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
      2. com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
      3. com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
      4. com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
      5. com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
      6. com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
      7. com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
      8. com.sun.tools.javac.main.Main.compile(Main.java:439)
      9. com.sun.tools.javac.main.Main.compile(Main.java:353)
      10. com.sun.tools.javac.main.Main.compile(Main.java:342)
      11. com.sun.tools.javac.main.Main.compile(Main.java:333)
      12. com.sun.tools.javac.Main.compile(Main.java:76)
      12 frames
    12. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      4 frames
    13. Ant
      Javac.execute
      1. org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
      2. org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1153)
      3. org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:930)
      3 frames
    14. org.netbeans.modules
      JavacTask.execute
      1. org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:144)
      1 frame
    15. Ant
      UnknownElement.execute
      1. org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      1 frame
    16. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:601)
      3 frames
    17. Ant
      UnknownElement.execute
      1. org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      2. org.apache.tools.ant.Task.perform(Task.java:348)
      3. org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
      4. org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      4 frames
    18. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:601)
      3 frames
    19. Ant
      UnknownElement.execute
      1. org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      2. org.apache.tools.ant.Task.perform(Task.java:348)
      3. org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
      4. org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      4 frames
    20. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:601)
      3 frames
    21. Ant
      Project.executeTargets
      1. org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      2. org.apache.tools.ant.Task.perform(Task.java:348)
      3. org.apache.tools.ant.Target.execute(Target.java:392)
      4. org.apache.tools.ant.Target.performTasks(Target.java:413)
      5. org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
      6. org.apache.tools.ant.Project.executeTarget(Project.java:1368)
      7. org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      8. org.apache.tools.ant.Project.executeTargets(Project.java:1251)
      8 frames
    22. org.apache.tools
      TargetExecutor.run
      1. org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:285)
      2. org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
      2 frames