Skip to content

Fix: add @deprecated Javadoc and handle deprecated method properly#17331

Open
A0R0P0I7T wants to merge 2 commits intoapache:masterfrom
A0R0P0I7T:fix-deprecated-javadoc
Open

Fix: add @deprecated Javadoc and handle deprecated method properly#17331
A0R0P0I7T wants to merge 2 commits intoapache:masterfrom
A0R0P0I7T:fix-deprecated-javadoc

Conversation

@A0R0P0I7T
Copy link

Description

This PR fixes SonarCloud issues in the MQTT example module related to deprecated method handling and missing Javadoc.

The deprecated method format(ByteBuf payload) previously threw a NotImplementedException. It is now updated to delegate to format(String topic, ByteBuf payload) to ensure backward compatibility.

Additionally, the missing @deprecated Javadoc tag has been added to align with SonarCloud rules.

Changes

  • Added @deprecated Javadoc tag to deprecated method
  • Replaced NotImplementedException with delegation to the newer method
  • Removed unused import of NotImplementedException

Motivation

Fix SonarCloud issues:

  • java:S1123 (missing @deprecated Javadoc)
  • java:S1133 (improper deprecated code handling)

SonarCloud links:

Verification

  • Ran mvn spotless:apply
  • Ran mvn clean install -DskipTests
  • Build passes locally

Checklist

  • been self-reviewed
  • added Javadocs for modified methods
  • follows project coding style (spotless applied)

Files Modified

  • example/mqtt-customize/src/main/java/org/apache/iotdb/mqtt/server/CustomizedJsonPayloadFormatter.java

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

Successfully merging this pull request may close these issues.

1 participant