use pattern.pattern() instead of pattern in hashCode method
(consistent with equals method)
codegen-kotlin:
use regex.pattern instead of regex in hashCode method
(consistent with equals method)
if a data class has a Regex property, generate not only
an equals method but also a hashCode method
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/apple/pkl/pull/802
**Author:** [@odenix](https://github.com/odenix)
**Created:** 11/12/2024
**Status:** ✅ Merged
**Merged:** 11/14/2024
**Merged by:** [@bioball](https://github.com/bioball)
**Base:** `main` ← **Head:** `codegen-hashcode`
---
### 📝 Commits (1)
- [`f9ad550`](https://github.com/apple/pkl/commit/f9ad550e64c446e1d7021bcd29a757404cf91aab) codegen-java/kotlin: Fix generation of hashCode methods
### 📊 Changes
**5 files changed** (+39 additions, -16 deletions)
<details>
<summary>View changed files</summary>
📝 `pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/JavaCodeGenerator.kt` (+7 -5)
📝 `pkl-codegen-java/src/test/resources/org/pkl/codegen/java/PropertyTypes.jva` (+1 -1)
📝 `pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/KotlinCodeGenerator.kt` (+10 -9)
📝 `pkl-codegen-kotlin/src/test/kotlin/org/pkl/codegen/kotlin/KotlinCodeGeneratorTest.kt` (+20 -0)
📝 `pkl-codegen-kotlin/src/test/resources/org/pkl/codegen/kotlin/PropertyTypes.kotlin` (+1 -1)
</details>
### 📄 Description
codegen-java:
- use `pattern.pattern()` instead of `pattern` in hashCode method
(consistent with equals method)
codegen-kotlin:
- use `regex.pattern` instead of `regex` in hashCode method
(consistent with equals method)
- if a data class has a Regex property, generate not only
an equals method but also a hashCode method
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/802
Author: @odenix
Created: 11/12/2024
Status: ✅ Merged
Merged: 11/14/2024
Merged by: @bioball
Base:
main← Head:codegen-hashcode📝 Commits (1)
f9ad550codegen-java/kotlin: Fix generation of hashCode methods📊 Changes
5 files changed (+39 additions, -16 deletions)
View changed files
📝
pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/JavaCodeGenerator.kt(+7 -5)📝
pkl-codegen-java/src/test/resources/org/pkl/codegen/java/PropertyTypes.jva(+1 -1)📝
pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/KotlinCodeGenerator.kt(+10 -9)📝
pkl-codegen-kotlin/src/test/kotlin/org/pkl/codegen/kotlin/KotlinCodeGeneratorTest.kt(+20 -0)📝
pkl-codegen-kotlin/src/test/resources/org/pkl/codegen/kotlin/PropertyTypes.kotlin(+1 -1)📄 Description
codegen-java:
pattern.pattern()instead ofpatternin hashCode method(consistent with equals method)
codegen-kotlin:
regex.patterninstead ofregexin hashCode method(consistent with equals method)
an equals method but also a hashCode method
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.