Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: avatica-1.10.0, 1.12.0
    • Component/s: None
    • Labels:
      None

      Description

      Calcite should not use deprecated methods and classes, especially in third-party libraries. I propose that we adopt a zero-tolerance policy, fixing deprecated calls as soon as they occur. As long as the third-party libraries use semantic versioning, this should give us prior warning before things disappear.

      You can find the calls to deprecated APIs by adding <compilerArgument>-Xlint:deprecation</compilerArgument> then running mvn clean package -DskipTests | grep 'has been deprecated' | grep -v 'in org.apache.calcite'. Currently there are 51 when you run in JDK9 and Guava 20.0. Here are the first few:

      [WARNING] /home/jhyde/open1/calcite.2/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java:[254,38] getPackage(java.lang.String) in java.lang.Package has been deprecated
      [WARNING] /home/jhyde/open1/calcite.2/linq4j/src/test/java/org/apache/calcite/linq4j/test/Linq4jTest.java:[736,25] Integer(int) in java.lang.Integer has been deprecated
      [WARNING] /home/jhyde/open1/calcite.2/linq4j/src/test/java/org/apache/calcite/linq4j/test/Linq4jTest.java:[737,26] Integer(int) in java.lang.Integer has been deprecated
      [WARNING] /home/jhyde/open1/calcite.2/linq4j/src/test/java/org/apache/calcite/linq4j/test/Linq4jTest.java:[738,25] Integer(int) in java.lang.Integer has been deprecated
      [WARNING] /home/jhyde/open1/calcite.2/core/src/main/java/org/apache/calcite/rex/RexBuilder.java:[539,47] ROUND_HALF_DOWN in java.math.BigDecimal has been deprecated
      

      We should fix these (and other deprecated APIs when we run on other JDK versions and other Guava versions), then add a nightly check that none are added back.

        Activity

        Hide
        elserj Josh Elser added a comment -

        I propose that we adopt a zero-tolerance policy, fixing deprecated calls as soon as they occur.

        +1

        We should fix these (and other deprecated APIs when we run on other JDK versions and other Guava versions), then add a nightly check that none are added back.

        +1

        Show
        elserj Josh Elser added a comment - I propose that we adopt a zero-tolerance policy, fixing deprecated calls as soon as they occur. +1 We should fix these (and other deprecated APIs when we run on other JDK versions and other Guava versions), then add a nightly check that none are added back. +1
        Hide
        julianhyde Julian Hyde added a comment -

        I'm working on this. The fix will fix both Avatica and Calcite in one swoop.

        Enforcement will be asynchronous: If people introduce warnings the build won't fail, but my calcite-regress.sh script will, and you'll soon get an email from me. By the way, I run that script every night on various combinations of JDK1.7, JDK1.8, JDK9, Guava 14.0.1, Guava 20.0 and Guava 21.0.

        Show
        julianhyde Julian Hyde added a comment - I'm working on this. The fix will fix both Avatica and Calcite in one swoop. Enforcement will be asynchronous: If people introduce warnings the build won't fail, but my calcite-regress.sh script will, and you'll soon get an email from me. By the way, I run that script every night on various combinations of JDK1.7, JDK1.8, JDK9, Guava 14.0.1, Guava 20.0 and Guava 21.0.
        Hide
        elserj Josh Elser added a comment -

        If people introduce warnings the build won't fail, but my calcite-regress.sh script will, and you'll soon get an email from me

        I was wondering how you were planning to do this . If you'd like, I can help you set up a new job on the ASF jenkins to run this script and email offenders so that we're not reliant on your personal builds or time sending an email.

        Enforcement will be asynchronous

        It'd be great if we could catch it synchronously, but I don't know of a maven plugin that would do this check. Maybe it's an option on the compiler-plugin? Would have to do some searching, but I didn't want to derail your current plan.

        Show
        elserj Josh Elser added a comment - If people introduce warnings the build won't fail, but my calcite-regress.sh script will, and you'll soon get an email from me I was wondering how you were planning to do this . If you'd like, I can help you set up a new job on the ASF jenkins to run this script and email offenders so that we're not reliant on your personal builds or time sending an email. Enforcement will be asynchronous It'd be great if we could catch it synchronously, but I don't know of a maven plugin that would do this check. Maybe it's an option on the compiler-plugin? Would have to do some searching, but I didn't want to derail your current plan.
        Hide
        julianhyde Julian Hyde added a comment -

        My inclination is not to try to automate anything in ASF infrastructure. Managing a flaky server in an environment one doesn't control is a huge time sink.

        It's much easier to change process than tooling. The maven build will now output messages about deprecated APIs. Committers need to make sure that there aren't any such messages. Some one them may even be technical enough to figure out how to do this using 'grep'.

        Show
        julianhyde Julian Hyde added a comment - My inclination is not to try to automate anything in ASF infrastructure. Managing a flaky server in an environment one doesn't control is a huge time sink. It's much easier to change process than tooling. The maven build will now output messages about deprecated APIs. Committers need to make sure that there aren't any such messages. Some one them may even be technical enough to figure out how to do this using 'grep'.
        Hide
        elserj Josh Elser added a comment -

        My inclination is not to try to automate anything in ASF infrastructure. Managing a flaky server in an environment one doesn't control is a huge time sink.

        I would have agreed with you half a year ago, but I've actually been seeing much more stable builds coming out of builds.a.o lately. Anyways, offer stands, but it's your time/interest in the problem – I don't want to be telling you how to spend it

        Show
        elserj Josh Elser added a comment - My inclination is not to try to automate anything in ASF infrastructure. Managing a flaky server in an environment one doesn't control is a huge time sink. I would have agreed with you half a year ago, but I've actually been seeing much more stable builds coming out of builds.a.o lately. Anyways, offer stands, but it's your time/interest in the problem – I don't want to be telling you how to spend it
        Hide
        julianhyde Julian Hyde added a comment -
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/5181563f (covers both Calcite and Avatica) and accompanied by changes to my batch scripts in https://github.com/julianhyde/share/commit/a0b9ec403884fba911618d4878954517f2970f90 .
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.12.0 (2017-03-24).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.12.0 (2017-03-24).

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            julianhyde Julian Hyde
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development