GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • CodeQL documentation
  • CodeQL overview
  • Writing CodeQL queries
  • CodeQL language guides
  • QL language reference
  • CodeQL standard-libraries
  • CodeQL query help
  • CodeQL repository
  • QL publications
  • CodeQL query help for C and C++
  • CodeQL query help for C#
  • CodeQL query help for GitHub Actions
  • CodeQL query help for Go
  • CodeQL query help for Java and Kotlin

This view

  • Original page
  • New address

GeezerVison is showing codeql.github.com — Deprecated method or constructor invocation — CodeQL query help documentation

Deprecated method or constructor invocation¶

ID: java/deprecated-call
Kind: problem
Security severity: 
Severity: recommendation
Precision: high
Tags:
   - maintainability
   - readability
   - non-attributable
   - external/cwe/cwe-477
Query suites:
   - java-security-and-quality.qls

Click to see the query in the CodeQL repository

A method (or constructor) can be marked as deprecated using either the @Deprecated annotation or the @deprecated Javadoc tag. Using a method that has been marked as deprecated is bad practice, typically for one or more of the following reasons:

  • The method is dangerous.

  • There is a better alternative method.

  • Methods that are marked as deprecated are often removed from future versions of an API. So using a deprecated method may cause extra maintenance effort when the API is upgraded.

Recommendation¶

Avoid using a method that has been marked as deprecated. Follow any guidance that is provided with the @deprecated Javadoc tag, which should explain how to replace the call to the deprecated method.

References¶

  • Help - Eclipse Platform: Java Compiler Errors/Warnings Preferences.

  • Java API Specification: Annotation Type Deprecated.

  • Java SE Documentation: How and When To Deprecate APIs.

  • Common Weakness Enumeration: CWE-477.

  • © GitHub, Inc.
  • Terms
  • Privacy
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.