Skip to content

fix: add compatible constructor for GoogleMapPolyClickEvent#181

Merged
paodb merged 2 commits into
masterfrom
fix-180
Jun 11, 2026
Merged

fix: add compatible constructor for GoogleMapPolyClickEvent#181
paodb merged 2 commits into
masterfrom
fix-180

Conversation

@javier-godoy

@javier-godoy javier-godoy commented Jun 10, 2026

Copy link
Copy Markdown
Member

Close #180

Summary by CodeRabbit

  • Chores

    • Project version bumped to 2.5.0-SNAPSHOT
    • Added a build profile to clean frontend/build artifacts and generated files
  • Improvements

    • Polygon click events now provide latitude and longitude as separate coordinate values
    • Previous single-payload polygon click event remains available but is deprecated

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8330ac52-b91a-4e7d-8f87-6b0fc0cfe76a

📥 Commits

Reviewing files that changed from the base of the PR and between f791878 and 47520d9.

📒 Files selected for processing (2)
  • pom.xml
  • src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java
  • pom.xml

Walkthrough

This PR bumps the add-on version to 2.5.0-SNAPSHOT, adds a new Maven profile dance to the POM, and adds a non-deprecated GoogleMapPolyClickEvent constructor that receives lat and lon as double parameters bound from event.detail.latLng.*, while retaining a deprecated JsonValue constructor.

Changes

Build and event extraction changes

Layer / File(s) Summary
Build metadata and dance profile
pom.xml
Add-on version updated to 2.5.0-SNAPSHOT and a new Maven profile dance added with maven-clean-plugin filesets targeting frontend/build artifacts.
GoogleMapPolyClickEvent coordinate binding
src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java
New constructor GoogleMapPolyClickEvent(GoogleMapPoly source, boolean fromClient, double lat, double lon) binds event.detail.latLng.lat() and event.detail.latLng.lng() into lat/lon; the prior JsonValue latLng constructor is retained and marked deprecated.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • mlopezFC
  • paodb
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes a version bump in pom.xml (2.4.1-SNAPSHOT to 2.5.0-SNAPSHOT) and a new 'dance' build profile that appear unrelated to fixing the GoogleMapPolyClickEvent deserialization issue. Clarify whether the pom.xml changes (version bump and new 'dance' profile) are intentional or should be moved to a separate PR focused on build configuration.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding a compatible constructor for GoogleMapPolyClickEvent to resolve the deserialization error reported in issue #180.
Linked Issues check ✅ Passed The PR adds a new constructor to GoogleMapPolyClickEvent that accepts double lat/lon parameters with proper @EventData bindings, directly addressing the JSON deserialization failure in issue #180.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-180

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java (1)

173-177: ⚡ Quick win

Add a Javadoc @deprecated note for the deprecated constructor.

Line 173 is annotated @Deprecated, but a matching Javadoc @deprecated entry is missing. Add it with the replacement constructor for clearer API guidance and to satisfy the reported static-analysis warning.

♻️ Proposed update
+    /**
+     * `@deprecated` Since 2.5.0, use
+     * {`@link` `#GoogleMapPolyClickEvent`(GoogleMapPoly, boolean, double, double)}.
+     */
     `@Deprecated`(since = "2.5.0", forRemoval = true)
     public GoogleMapPolyClickEvent(
         GoogleMapPoly source,
         boolean fromClient,
         JsonValue latLng) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java`
around lines 173 - 177, Add a Javadoc "`@deprecated`" tag to the deprecated
constructor GoogleMapPolyClickEvent(GoogleMapPoly source, boolean fromClient,
JsonValue latLng) explaining it is deprecated since 2.5.0 and pointing callers
to use the replacement constructor GoogleMapPolyClickEvent(GoogleMapPoly source,
boolean fromClient, double lat, double lng) (or whatever the new signature is) —
update the constructor's Javadoc block to include the `@deprecated` line with the
version and the suggested replacement constructor name.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java`:
- Around line 173-177: Add a Javadoc "`@deprecated`" tag to the deprecated
constructor GoogleMapPolyClickEvent(GoogleMapPoly source, boolean fromClient,
JsonValue latLng) explaining it is deprecated since 2.5.0 and pointing callers
to use the replacement constructor GoogleMapPolyClickEvent(GoogleMapPoly source,
boolean fromClient, double lat, double lng) (or whatever the new signature is) —
update the constructor's Javadoc block to include the `@deprecated` line with the
version and the suggested replacement constructor name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb52c67c-1d0f-44d4-bb68-76671dd90da1

📥 Commits

Reviewing files that changed from the base of the PR and between 1514273 and 8a51217.

📒 Files selected for processing (2)
  • pom.xml
  • src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java

@javier-godoy javier-godoy force-pushed the fix-180 branch 2 times, most recently from 2401322 to f791878 Compare June 11, 2026 11:25
@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java (1)

167-167: 💤 Low value

JavaDoc says "polygon" but the parameter accepts any GoogleMapPoly.

The JavaDoc states "the polygon that was clicked" but the parameter type is GoogleMapPoly, which is abstract and likely supports both polygons and polylines. Consider updating the documentation to be more accurate.

📝 Suggested documentation improvement
-     * `@param` source the polygon that was clicked
+     * `@param` source the poly (polygon or polyline) that was clicked
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java` at
line 167, Update the JavaDoc to accurately describe the parameter type: replace
references to "the polygon that was clicked" with wording that reflects the
GoogleMapPoly abstraction (e.g., "the GoogleMapPoly (polygon or polyline) that
was clicked") so the documentation matches the parameter type GoogleMapPoly;
ensure any nearby doc tags (including the fromClient description) remain
accurate and consistent with the method signature.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java`:
- Line 190: Remove the Java-9-specific attributes from the Deprecated annotation
on GoogleMapPoly (replace `@Deprecated`(since = "2.5.0", forRemoval = true) with
plain `@Deprecated`) and add a Javadoc `@deprecated` tag above the class/method that
records the "since 2.5.0" and "for removal" information (e.g., in the JavaDoc
for GoogleMapPoly) so the compatibility with Java 8 is preserved while retaining
the version/removal notes.

---

Nitpick comments:
In `@src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java`:
- Line 167: Update the JavaDoc to accurately describe the parameter type:
replace references to "the polygon that was clicked" with wording that reflects
the GoogleMapPoly abstraction (e.g., "the GoogleMapPoly (polygon or polyline)
that was clicked") so the documentation matches the parameter type
GoogleMapPoly; ensure any nearby doc tags (including the fromClient description)
remain accurate and consistent with the method signature.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 22a3bff6-c947-47a8-ab92-e06e5273877f

📥 Commits

Reviewing files that changed from the base of the PR and between 8a51217 and f791878.

📒 Files selected for processing (2)
  • pom.xml
  • src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java

Comment thread src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoly.java Outdated
@javier-godoy

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@javier-godoy javier-godoy requested review from paodb and scardanzan June 11, 2026 13:06
@javier-godoy javier-godoy marked this pull request as ready for review June 11, 2026 13:06
@paodb paodb merged commit cf452e9 into master Jun 11, 2026
7 checks passed
@paodb paodb deleted the fix-180 branch June 11, 2026 14:02
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

Error adding addClickListener to Polygon

2 participants