Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for known reusable types being implicitly wasted. #643

Open
NightlyNexus opened this issue Jun 15, 2017 · 1 comment
Open

Check for known reusable types being implicitly wasted. #643

NightlyNexus opened this issue Jun 15, 2017 · 1 comment

Comments

@NightlyNexus
Copy link
Contributor

String.matches(), String.split(), and String.replaceAll() are prime examples of seductive convenience APIs. These are especially damaging, as they are commonly used in loops, where caching a Pattern is an easy fix.
It'd be cool to have Error Prone complain about their usages and suggest using the Pattern APIs directly.

@davidburstrom
Copy link

Agreed, I just had a look at this in conjunction with the existing ConstantPatternCompile.

copybara-service bot pushed a commit that referenced this issue Dec 7, 2023
#MIGRATION_3P_JAVA_SRC_CHECKER_FRAMEWORK_DATAFLOW__DEFAULT_SERVICE

  - c9b1e103fbe5ea1a3fc5d8e52a16c9982ed0bc76 Prep for next release by Werner Dietl <wdietl@gmail.com>
  - 4f53c5bf42e357682104fd3cbf4878457d1d0e0d Extract version variable and update version (#630) by Werner Dietl <wdietl@gmail.com>
  - 3c4dad383006e706dc102d4d835298e1e1e12114 Do not use `thisValue` when it is the NullType (#636) by Werner Dietl <wdietl@gmail.com>
  - d7f9dabf1240e40484ce2b3c1c6e9feecaabe29c Generalize improvement of initialization type frames (#642) by Florian Lanzinger <lanzinger@kit.edu>
  - a7b753565fe9843d5e5f1ade6564bab68fa266e9 Update dependency commons-io:commons-io to v2.15.1 (#643) by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 3ed0c114c3d686eadc803207640487e86d1d086e Update dependency gradle to v8.5 (#644) by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 5c59bff87210b78a7fc7f8cd7b7372d2d7e60981 Update dependency com.amazonaws:aws-java-sdk-bom to v1.12... by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 2170fdab53832a3b9016f200a78189c76298f87e Update dependency com.diffplug.spotless:spotless-plugin-g... by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 8eb212555daec5323fd1f1af786092cbbbeef8a0 Update dependency io.github.classgraph:classgraph to v4.8... by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 4c08ea3751b40620d20eb05ca85ead9a42f500f9 Update dependency org.checkerframework:stubparser to v3.2... by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 2dee1c3763640e4bec88bc0b8a11a9f6bad1a5ea Warn about redundant null cases in switch statements and ... by Aosen Xiong <82676488+Ao-senXiong@users.noreply.github.com>
  - 780fef9e0225761ba44000091a2f024a6ffbdecb typetools/checker-framework 3.41.0 release (#650) by Werner Dietl <wdietl@gmail.com>
  - 9c804e41ed0f506713ac50224d2a63f2d2568dc2 Consistently spell it `JUnit` by Werner Dietl <wdietl@gmail.com>
  - 9ad831a2432ad5cbf6bb1a99dff4121f4a6dc4e3 Add missing import to stub file by Werner Dietl <wdietl@gmail.com>
  - 28f6b0fc670596c5943ca93e01b480429ef0a907 Remove warnings about junit-assertions.astub that do not ... by Werner Dietl <wdietl@gmail.com>
  - a4c50adad5e36bc746cfabddba41b5f661da54d5 Formatting tweak by Werner Dietl <wdietl@gmail.com>
  - 66bb90d7431427ed39f67d7a9899f93d430220c1 Make error keys consistent by Werner Dietl <wdietl@gmail.com>
  - 6be13eba81909bedc263c6b1a9d4c3583af556b7 Simplify code, suppress Optional Checker FP, code consist... by Werner Dietl <wdietl@gmail.com>
  - 011fbb759104d1277700a9e7893f435af00a5f90 Code comment formatting by Werner Dietl <wdietl@gmail.com>
  - 5b60183f3d3934dcb205adfb77c729399687c9bc Fix formatting by Werner Dietl <wdietl@gmail.com>
  - 13f7887e1941d0b6b18a9a9c85088e42fbb56c13 Fix error keys and warning texts by Werner Dietl <wdietl@gmail.com>
  - 084ca4b52ab4d067a93ae32ea04c892ec36bf72a Fix terminology and use EISOP website by Werner Dietl <wdietl@gmail.com>
  - f62005ea47ffe9bae7561d51ed9a0a2bed4f89c0 Skip try-with-resources test on Java 8 by Werner Dietl <wdietl@gmail.com>
  - 97af13821ff7ed86c6b5f3740799a28d2a054608 Add a note by Werner Dietl <wdietl@gmail.com>
  - c2df6d6cc48878b92970c568e5388ddafa60b60f Prep for release by Werner Dietl <wdietl@gmail.com>
  - c08538fbc8e167a931cbe405614b52663a8e67be new release 3.41.0-eisop1 by Werner Dietl <wdietl@gmail.com>

PiperOrigin-RevId: 588226344
copybara-service bot pushed a commit that referenced this issue Dec 7, 2023
#MIGRATION_3P_JAVA_SRC_CHECKER_FRAMEWORK_DATAFLOW__DEFAULT_SERVICE

  - c9b1e103fbe5ea1a3fc5d8e52a16c9982ed0bc76 Prep for next release by Werner Dietl <wdietl@gmail.com>
  - 4f53c5bf42e357682104fd3cbf4878457d1d0e0d Extract version variable and update version (#630) by Werner Dietl <wdietl@gmail.com>
  - 3c4dad383006e706dc102d4d835298e1e1e12114 Do not use `thisValue` when it is the NullType (#636) by Werner Dietl <wdietl@gmail.com>
  - d7f9dabf1240e40484ce2b3c1c6e9feecaabe29c Generalize improvement of initialization type frames (#642) by Florian Lanzinger <lanzinger@kit.edu>
  - a7b753565fe9843d5e5f1ade6564bab68fa266e9 Update dependency commons-io:commons-io to v2.15.1 (#643) by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 3ed0c114c3d686eadc803207640487e86d1d086e Update dependency gradle to v8.5 (#644) by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 5c59bff87210b78a7fc7f8cd7b7372d2d7e60981 Update dependency com.amazonaws:aws-java-sdk-bom to v1.12... by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 2170fdab53832a3b9016f200a78189c76298f87e Update dependency com.diffplug.spotless:spotless-plugin-g... by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 8eb212555daec5323fd1f1af786092cbbbeef8a0 Update dependency io.github.classgraph:classgraph to v4.8... by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 4c08ea3751b40620d20eb05ca85ead9a42f500f9 Update dependency org.checkerframework:stubparser to v3.2... by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  - 2dee1c3763640e4bec88bc0b8a11a9f6bad1a5ea Warn about redundant null cases in switch statements and ... by Aosen Xiong <82676488+Ao-senXiong@users.noreply.github.com>
  - 780fef9e0225761ba44000091a2f024a6ffbdecb typetools/checker-framework 3.41.0 release (#650) by Werner Dietl <wdietl@gmail.com>
  - 9c804e41ed0f506713ac50224d2a63f2d2568dc2 Consistently spell it `JUnit` by Werner Dietl <wdietl@gmail.com>
  - 9ad831a2432ad5cbf6bb1a99dff4121f4a6dc4e3 Add missing import to stub file by Werner Dietl <wdietl@gmail.com>
  - 28f6b0fc670596c5943ca93e01b480429ef0a907 Remove warnings about junit-assertions.astub that do not ... by Werner Dietl <wdietl@gmail.com>
  - a4c50adad5e36bc746cfabddba41b5f661da54d5 Formatting tweak by Werner Dietl <wdietl@gmail.com>
  - 66bb90d7431427ed39f67d7a9899f93d430220c1 Make error keys consistent by Werner Dietl <wdietl@gmail.com>
  - 6be13eba81909bedc263c6b1a9d4c3583af556b7 Simplify code, suppress Optional Checker FP, code consist... by Werner Dietl <wdietl@gmail.com>
  - 011fbb759104d1277700a9e7893f435af00a5f90 Code comment formatting by Werner Dietl <wdietl@gmail.com>
  - 5b60183f3d3934dcb205adfb77c729399687c9bc Fix formatting by Werner Dietl <wdietl@gmail.com>
  - 13f7887e1941d0b6b18a9a9c85088e42fbb56c13 Fix error keys and warning texts by Werner Dietl <wdietl@gmail.com>
  - 084ca4b52ab4d067a93ae32ea04c892ec36bf72a Fix terminology and use EISOP website by Werner Dietl <wdietl@gmail.com>
  - f62005ea47ffe9bae7561d51ed9a0a2bed4f89c0 Skip try-with-resources test on Java 8 by Werner Dietl <wdietl@gmail.com>
  - 97af13821ff7ed86c6b5f3740799a28d2a054608 Add a note by Werner Dietl <wdietl@gmail.com>
  - c2df6d6cc48878b92970c568e5388ddafa60b60f Prep for release by Werner Dietl <wdietl@gmail.com>
  - c08538fbc8e167a931cbe405614b52663a8e67be new release 3.41.0-eisop1 by Werner Dietl <wdietl@gmail.com>

PiperOrigin-RevId: 588812139
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants